> ## Documentation Index
> Fetch the complete documentation index at: https://docs.payments.sardine.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Post Client Token

> Exchange your `clientId` and `clientSecret` for a `clientToken` that can be be used in frontend code. `clientToken` will be unusable after the `expiresAt` time, which will normally be after 30 min. 


To try the request in the mock server on the right, substitute username for clientId and password for clientSecre



## OpenAPI

````yaml /api_reference/nft.yaml post /auth/client-tokens
openapi: 3.1.0
info:
  version: '1.0'
  title: NFT API
  summary: API to enable direct NFT purchasing
  description: Reference for Sardine Crypto API
servers:
  - url: https://api.sandbox.sardine.ai/v1
    description: Sandbox
  - url: https://api.sardine.ai/v1
    description: Prod Server
security:
  - {}
paths:
  /auth/client-tokens:
    post:
      summary: Post Client Token
      description: >-
        Exchange your `clientId` and `clientSecret` for a `clientToken` that can
        be be used in frontend code. `clientToken` will be unusable after the
        `expiresAt` time, which will normally be after 30 min. 



        To try the request in the mock server on the right, substitute username
        for clientId and password for clientSecre
      operationId: post-crypto-auth-client_session_token
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              type: object
              properties:
                referenceId:
                  type: string
                  description: Unique ID for an order
                  format: uuid
                expiresIn:
                  type: number
                  description: Time, in seconds, after which this Order will expire
                  maximum: 3600
                  examples:
                    - 60
                externalUserId:
                  type: string
                  description: >-
                    A unique ID that represents a user or customer. This can be
                    used if you wish to track orders on a per customer basis
                  format: uuid
                nft:
                  type: object
                  required:
                    - name
                    - imageUrl
                  properties:
                    name:
                      type: string
                      description: Name of NFT
                    imageUrl:
                      type: string
                      description: URL where image of the NFT can be retrieved from
                      format: uri
                    price:
                      type: number
                      description: Cost of the NFT in `currencyCode`
                      format: float
                      minimum: 0
                    executionType:
                      x-stoplight:
                        id: o949rg293xde1
                      enum:
                        - smart_contract
                    network:
                      type: string
                      x-stoplight:
                        id: 8s1vzwgs8ccji
                      example: polygon
                    recipientAddress:
                      type: string
                      x-stoplight:
                        id: a4ic9fhftejq6
                      example: '0x942D5A8BaC9684a3Fc1150b3cBbf931f32bBa514'
                    platform:
                      x-stoplight:
                        id: r3ksrs2amvgc5
                      enum:
                        - niftyswap
                        - sequence_market
                        - ERC8000
                        - ''
                    contractAddress:
                      type: string
                      x-stoplight:
                        id: pb6ylyj8k3oz8
                      example: '0x8bb759bb68995343ff1e9d57ac85ff5c5fb79334'
                    blockchainNftId:
                      type: string
                      x-stoplight:
                        id: 351snwicrti0o
                    quantity:
                      type: integer
                      description: Quantity of the good being purchased
                    currencyCode:
                      const: usd
                      description: 'Fiat currency this NFT is priced in. '
                taxRates:
                  type: object
                  description: >-
                    Which contains rates for countries/regions in ISO3166-2
                    format.
                  properties:
                    US-NY:
                      type: string
                      description: >-
                        countrycode-subdivisions like US-NY. "US-NY": 13 means
                        13% for NY state.
                      examples:
                        - US-NY = 13
                    US:
                      type: string
                      description: >-
                        Countrycode like US. It's percentage, US: 10 means 10%
                        tax for all US
                      examples:
                        - US = 10
                    US-CA:
                      type: string
                      description: >-
                        countrycode-subdivisions like US-CA. "US-CA": 20 means
                        20% for CA state.
                      examples:
                        - US-CA = 20
                identityPrefill:
                  type: object
                  description: >-
                    If fields here are passed, they will be pre filled in the
                    Checkout
                  properties:
                    firstName:
                      type: string
                      description: First name of customer
                    lastName:
                      type: string
                      description: Last name of customer
                    dateOfBirth:
                      type: string
                      description: Date of birth in YYYY-MM-DD
                      format: date
                    emailAddress:
                      type: string
                      description: Email address of user
                      format: email
                    phone:
                      type: string
                      description: Phone number of user with country code
                    address:
                      type: object
                      properties:
                        street1:
                          type: string
                        street2:
                          type: string
                        city:
                          type: string
                        regionCode:
                          type: string
                        postalCode:
                          type: string
                        countryCode:
                          type: string
            examples:
              example-1:
                value:
                  referenceId: 42eadcb0-4a93-45af-9c8c-d295db5aeb6c
                  customerId: adf02ae2-f633-11ec-b939-0242ac120002
                  nft:
                    name: 'NFT #1'
                    price: 100
                    currencyCode: USD
                    imageUrl: >-
                      https://gateway.nftcompany.io/ipfsQmSAQm4gbhjSeUk7fuYppHd7Z8dfWpBvnFmqFSKqkrUJPM
                  identityPrefill:
                    firstName: John
                    lastName: Doe
                    dateOfBirth: '2000-01-01'
                    emailAddress: foobar@gmail.com
                    phone: '+19254485826'
                    address:
                      street1: 123 Main st
                      street2: ''
                      city: irvine
                      regionCode: CA
                      postalCode: '02747'
                      countryCode: US
                  taxRates:
                    US: 10
                    US-CA: 20
              example-2:
                value:
                  nft:
                    name: The BEST NFT FOR DEMO PURPOSE NEW NFT
                    price: 100
                    currencyCode: CAD
                    contractAddress: '0x7fC0344254E1663C2eF24e3c063cbec231525C20'
                    imageUrl: >-
                      https://gateway.autograph.io/ipfs/QmSAQm4gbhjSeUk7fuYppHd7Z8dfWpBvnFmqFSKqkrUJPM
                  taxRates:
                    US: 10
                    US-CA: 20
                    US-NY: 13
              Smart contract execution:
                value:
                  referenceId: test-0.24678085734dwedwedwed04dwedfwrferfwedwed6884
                  expiresIn: 3600
                  identityPrefill:
                    firstName: fname
                    lastName: lname
                    dateOfBirth: '2000-01-01'
                    emailAddress: ethan.itovitch@allow.com
                    phone: '+19923793139'
                    address:
                      street1: 123 main st
                      street2: ''
                      city: irvine
                      regionCode: CA
                      postalCode: '02747'
                      countryCode: US
                  paymentMethodTypeConfig:
                    enabled:
                      - us_debit
                      - us_credit
                      - international_debit
                      - international_credit
                      - ach
                    default: us_debit
                  nft:
                    name: Hot wheels <> Sardine
                    imageUrl: >-
                      https://cdn.shopify.com/s/files/1/0568/1132/3597/files/HWNFT_S4_modular-grid_584x800b.jpg?v=1669157307
                    network: polygon
                    recipientAddress: '0x942D5A8BaC9684a3Fc1150b3cBbf931f32bBa514'
                    platform: niftyswap
                    blockchainNftId: '131111'
                    contractAddress: '0x8bb759bb68995343ff1e9d57ac85ff5c5fb79334'
                    executionType: smart_contract
                    quantity: 1
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  clientToken:
                    type: string
                    description: Unique token that is used to authenticate the merchant
                    format: uuid
                  expiresAt:
                    type: string
                    description: Time at which the order will expire
                    format: date-time
              examples:
                example-1:
                  value:
                    clientToken: 8aeae330-9154-4051-ab98-d173ba2bc7f0
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: string
                    description: Set to `false` if exchange is unsuccessful
                  message:
                    type: string
                    description: >-
                      Contains message describing what error occured during
                      exchange
              examples:
                Error:
                  value:
                    code: UNAUTHORIZED
                    message: Invalid client credentials
      security:
        - ClientToken: []
      servers:
        - url: https://api.sandbox.sardine.ai/v1
          description: Sandbox
        - url: https://api.sardine.ai/v1
          description: Prod Server
components:
  securitySchemes:
    ClientToken:
      type: http
      scheme: basic

````