> ## 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.

# Get 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 clientSecret. 

If `reference_id` is passed, it will be passed to the Order object upon when the transaction happens. It can then be used as a filter in the /orders endpoint



## OpenAPI

````yaml /api_reference/onramp.yaml post /auth/client-tokens
openapi: 3.0.3
info:
  version: '1.0'
  title: Crypto API
  description: Reference for Sardine Crypto API
  contact:
    email: support@sardine.io
    name: Sardine
    url: docs.sardine.io
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:
      tags:
        - User Onboarding
      summary: Get 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 clientSecret. 


        If `reference_id` is passed, it will be passed to the Order object upon
        when the transaction happens. It can then be used as a filter in the
        /orders endpoint
      operationId: post-crypto-auth-client_session_token
      requestBody:
        description: ''
        content:
          application/json:
            schema:
              type: object
              x-examples:
                example-1:
                  referenceId: 42eadcb0-4a93-45af-9c8c-d295db5aeb6c
                  nft:
                    name: The best nft
                    price: 100
                    currencyCode: USD
                    contractAddress: '0x7fC0344254E1663C2eF24e3c063cbec231525C20'
                    imageUrl: >-
                      https://gateway.autograph.io/ipfsQmSAQm4gbhjSeUk7fuYppHd7Z8dfWpBvnFmqFSKqkrUJPM
                  identityPrefill:
                    firstName: fname
                    lastName: lname
                    dateOfBirth: '2000-01-01'
                    emailAddress: foobar@gmail.com
                    phone: '+19254485826'
                    address:
                      street1: 123 main st
                      street2: ''
                      city: irvine
                      regionCode: CA
                      postalCode: '02747'
                      countryCode: US
              properties:
                referenceId:
                  type: string
                  description: >-
                    Unique id representing a new session, must be regenerated
                    for each call
                customerId:
                  type: string
                  description: ID of customer
                externalUserId:
                  type: string
                  description: An ID generated by the merchant to uniquely identity a user.
                  format: uuid
                identityPrefill:
                  type: object
                  description: >-
                    If these fields are filled, they will be pre filled into the
                    UI
                  properties:
                    firstName:
                      type: string
                      description: First name of user
                    lastName:
                      type: string
                      description: Last name of user
                    dateOfBirth:
                      type: string
                      description: Date of birth in YYYY-MM-DD format
                    emailAddress:
                      type: string
                      description: Verified email of the user
                    phone:
                      type: string
                      description: Verified phone number of user
                    address:
                      type: object
                      properties:
                        street1:
                          type: string
                          description: Street address
                        street2:
                          type: string
                          description: Suite, Apt, etc
                        city:
                          type: string
                          description: 'City '
                        regionCode:
                          type: string
                          description: State or province
                        postalCode:
                          type: string
                          description: 'Zipcode '
                        countryCode:
                          type: string
                          description: ISO standard 2 digit country code
                paymentMethodTypeConfig:
                  type: object
                  properties:
                    default:
                      type: string
                      enum:
                        - us_debit
                        - us_credit
                        - international_debit
                        - international_credit
                        - apple-pay
                        - ach
                      description: >
                        The payment method that shows as default in the Sardine
                        onramp
                    enabled:
                      type: array
                      description: List of payment methods supported by Sardine
                      items:
                        type: string
                        enum:
                          - us_debit
                          - us_credit
                          - international_debit
                          - international_credit
                          - apple-pay
                          - ach
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  clientToken:
                    type: string
                    description: Authentication token returned
                  expiresAt:
                    type: string
                    description: Timestamp when clientToken will expire
                x-examples:
                  example-1:
                    clientToken: 8aeae330-9154-4051-ab98-d173ba2bc7f0
      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

````