> ## Documentation Index
> Fetch the complete documentation index at: https://developer.paywint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Checkout SDK Token

> Generates a short-lived, tamper-proof checkout token for initializing Paywint Inline Checkout.

This endpoint performs the following actions:
- Authenticates the platform using `X-Platform-ID` and `X-Signature`
- Resolves or creates a per-initiator signing secret
- Issues a signed checkout token embedding initiator and payer context
- Returns the token and its expiry for use by the frontend SDK



## OpenAPI

````yaml POST /api/checkout/token/platform
openapi: 3.1.0
info:
  title: paywint
  version: 0.1.0
servers:
  - url: http://localhost:8001
  - url: https://api.pw.wintpay.com
  - url: https://test.pw.wintpay.com
  - url: https://api.sandbox.paywint.com
security: []
paths:
  /api/checkout/token/platform:
    post:
      tags:
        - Inline Checkout
      summary: Generate Checkout Token (Platform)
      description: >-
        Generates a short-lived, tamper-proof checkout token for initializing
        Paywint Inline Checkout.


        This endpoint performs the following actions:

        - Authenticates the platform using `X-Platform-ID` and `X-Signature`

        - Resolves or creates a per-initiator signing secret

        - Issues a signed checkout token embedding initiator and payer context

        - Returns the token and its expiry for use by the frontend SDK
      operationId: create_platform_checkout_token_api_checkout_token_platform_post
      parameters:
        - name: X-Platform-ID
          in: header
          required: true
          schema:
            type: string
            format: uuid
            description: >-
              Unique platform identifier (UUID). You receive this during
              onboarding. Must be sent with every API request.
            title: X-Platform-Id
          description: >-
            Unique platform identifier (UUID). You receive this during
            onboarding. Must be sent with every API request.
        - name: X-Signature
          in: header
          required: true
          schema:
            type: string
            description: >-
              HMAC-SHA256 request signature for authentication. Use your
              platform secret key to compute it as: `METHOD + PATH + QUERY +
              BODY_HASH`.
            title: X-Signature
          description: >-
            HMAC-SHA256 request signature for authentication. Use your platform
            secret key to compute it as: `METHOD + PATH + QUERY + BODY_HASH`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckoutTokenCreateRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CommonResponse_CheckoutTokenResponse_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CheckoutTokenCreateRequest:
      properties:
        user_id:
          type: string
          format: uuid
          title: User Id
          description: Payer (end-user) UUID.
        amount:
          type: number
          maximum: 100000
          exclusiveMinimum: 0
          title: Amount
          description: Payment amount (canonical).
        currency:
          type: string
          maxLength: 10
          minLength: 3
          title: Currency
          description: Payment currency code (canonical).
          default: USD
      type: object
      required:
        - user_id
        - amount
      title: CheckoutTokenCreateRequest
      description: >-
        Token generation request for Inline Checkout.


        Notes

        Amount and currency are merchant-controlled for Inline Checkout. They
        are provided by the initiator backend

        when requesting the token and stored server-side keyed by the checkout
        nonce.
    CommonResponse_CheckoutTokenResponse_:
      properties:
        success:
          type: boolean
          title: Success
          description: Indicates whether the request was processed successfully.
          default: true
          example: true
        message:
          type: string
          title: Message
          description: >-
            A short, human-readable message describing the result of the
            request.
          default: Success
          example: Operation completed.
        data:
          anyOf:
            - $ref: '#/components/schemas/CheckoutTokenResponse'
            - type: 'null'
          description: The main response payload, if applicable
        queryGeneratedTime:
          anyOf:
            - type: number
            - type: 'null'
          title: Querygeneratedtime
          description: >-
            The Unix timestamp (in seconds) indicating when the response was
            generated.
          default: 1782303609.673092
          example: 1718006400
      type: object
      title: CommonResponse[CheckoutTokenResponse]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CheckoutTokenResponse:
      properties:
        checkout_token:
          type: string
          title: Checkout Token
          description: Signed Inline Checkout token.
        expires_at:
          type: string
          format: date-time
          title: Expires At
          description: Token expiration timestamp (UTC).
      type: object
      required:
        - checkout_token
        - expires_at
      title: CheckoutTokenResponse
      description: Checkout token response.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````