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

# Create a Meld payment token

> Use this endpoint to create long-lasting Meld payment tokens that can be used across service providers. These tokens can replace the payment method provided for future transactions. [For more details see this page](https://docs.meld.io/docs/payment-methods-and-tokenization).



## OpenAPI

````yaml /openapi/payments-20260203.json post /payments/tokens
openapi: 3.1.0
info:
  title: PAYMENTS
  termsOfService: urn:tos
  license:
    name: Apache 2.0
    url: https://springdoc.org
  version: '2026-02-03'
  description: ''
servers:
  - url: https://api-sb.meld.io
    description: Meld API sandbox
  - url: https://api.meld.io
    description: Meld API production
security: []
tags:
  - name: Payment
    description: ''
paths:
  /payments/tokens:
    post:
      tags:
        - Transactions
      summary: Create a Meld payment token
      description: >-
        Use this endpoint to create long-lasting Meld payment tokens that can be
        used across service providers. These tokens can replace the payment
        method provided for future transactions. [For more details see this
        page](https://docs.meld.io/docs/payment-methods-and-tokenization).
      operationId: /payment-token-post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PaymentTokenRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/PaymentTokenResponse'
        '400':
          description: 'Bad Request : check request values and format'
        '401':
          description: Invalid credentials
        '403':
          description: Unauthenticated or authenticated with insufficient access
        '500':
          description: >-
            Server Error. This applies to all 5xx errors, including but not
            limited to 500, 501, 502, 503, and 504 errors. You should treat all
            of these errors the same.
      security:
        - ApiKeyAuth: []
components:
  schemas:
    PaymentTokenRequest:
      type: object
      properties:
        customer:
          description: Information about your customer
          allOf:
            - $ref: '#/components/schemas/CustomerInput'
        paymentMethod:
          $ref: '#/components/schemas/PaymentMethodInput'
        serviceProviders:
          type: array
          description: >-
            The service provider(s) to attempt to create tokens with. If
            successful, the returned Meld payment token will be compatible with
            each of these providers.
          items:
            type: string
            enum:
              - AUTHORIZENET
              - BRAINTREE
              - CHECKOUT
              - CIRCLE
              - NMI
              - STRIPE
    PaymentTokenResponse:
      type: object
      properties:
        meldPaymentMethodTokenId:
          type: string
          description: The id of the meld payment method token
        serviceProviders:
          type: array
          description: >-
            List of service providers that successfully tokenized the provided
            payment method. This Meld payment token can be used to create future
            transactions with these service providers.
          items:
            type: string
            enum:
              - ACROSS
              - AEROPAY
              - AKOYA
              - ALCHEMYPAY
              - APPLEPAY
              - AUTHORIZENET
              - BANXA
              - BILIRA
              - BINANCECONNECT
              - BINANCEPAY
              - BLOCKCHAINDOTCOM
              - BOOMFI
              - BRAINTREE
              - BRALE
              - BTCDIRECT
              - CASHAPP
              - CHECKOUT
              - CIRCLE
              - COINBASEPAY
              - COINFLOW
              - DUENETWORK
              - ELDORADO
              - FINICITY
              - FLASHNET
              - FONBNK
              - GUARDARIAN
              - HARBOUR
              - KOYWE
              - KRYPTONIM
              - MERCURYO
              - MESH
              - MESO
              - MOONPAY
              - MOOV
              - MX
              - NMI
              - NOAH
              - ONMETA
              - ONRAMPMONEY
              - PAYBIS
              - PAYPAL
              - PLAID
              - RAMP
              - REVOLUT
              - ROBINHOOD
              - ROUTERPROTOCOL
              - SALTEDGE
              - SALTEDGEPARTNERS
              - SARDINE
              - SHIFT4
              - SHOPIFY
              - SIMPLEX
              - SKRILLCRYPTO
              - SQUARE
              - STRIPE
              - SUMSUB
              - SWAPPED
              - TANGOCARD
              - TELLER
              - TOPPER
              - TRANSAK
              - TREMENDOUS
              - TRANSFI
              - UNLIMIT
              - WYRE
              - XANPOOL
              - YELLOWCARD
              - YODLEE
    CustomerInput:
      type: object
      properties:
        addresses:
          type: array
          description: >-
            Your customer's addresses, such as BILLING, SHIPPING, RESIDENCE,
            etc.
          items:
            $ref: '#/components/schemas/CustomerAddressInput'
        billingAddress:
          $ref: '#/components/schemas/CustomerAddressInput'
        billingAddressDetails:
          $ref: '#/components/schemas/CustomerAddressDetails'
        email:
          type: string
          format: email
          description: Your customer's email address.
        externalId:
          type: string
          description: >-
            Your (optional) Id for this customer, for example an id or reference
            from your database which you may supply during customer creation
        id:
          type: string
          description: Meld's internal Id for the Customer
        name:
          description: Your customer's name
          allOf:
            - $ref: '#/components/schemas/CustomerName'
        nameEmpty:
          type: boolean
        nameJSONB:
          $ref: '#/components/schemas/JSONB'
        nameOrEmptyString:
          type: string
        nameOrNull:
          type: string
        phone:
          type: string
          description: Your customer's phone number
        residenceAddress:
          $ref: '#/components/schemas/CustomerAddressInput'
        residenceAddressDetails:
          $ref: '#/components/schemas/CustomerAddressDetails'
        shippingAddress:
          $ref: '#/components/schemas/CustomerAddressInput'
        shippingAddressDetails:
          $ref: '#/components/schemas/CustomerAddressDetails'
    PaymentMethodInput:
      type: object
      description: PaymentMethod objects represent your customer's payment instruments
      properties:
        details:
          $ref: '#/components/schemas/PaymentMethodDetails'
        type:
          type: string
          description: >-
            Payment method type used for this transaction, some methods may only
            apply for some providers, e.g. PLAID_TRANSFER_AUTHORIZATION for
            PLAID
          enum:
            - ACH
            - CARD
            - MELD_PAYMENT_TOKEN
            - PLAID_TRANSFER_AUTHORIZATION
          minLength: 1
      required:
        - details
        - type
    CustomerAddressInput:
      type: object
      properties:
        addressDetails:
          description: Address details
          allOf:
            - $ref: '#/components/schemas/CustomerAddressDetails'
        type:
          type: string
          description: Address type such as BILLING, SHIPPING, RESIDENCE, etc.
          enum:
            - BILLING
            - SHIPPING
            - RESIDENCE
    CustomerAddressDetails:
      type: object
      properties:
        addressDetailsFields:
          type: object
          writeOnly: true
        city:
          type: string
          description: City, district, suburb, town, or village
        country:
          type: string
          description: Two-letter country code (ISO 3166-1 alpha-2)
        firstName:
          type: string
          description: The first name on the address
        lastName:
          type: string
          description: The last name on the address
        lineOne:
          type: string
          description: Address line 1 (e.g., street, PO Box, or company name)
        lineTwo:
          type: string
          description: Address line 2 (e.g., apartment, suite, unit, or building)
        postalCode:
          type: string
          description: ZIP or postal code
        region:
          type: string
          description: State, county, province, or region
    CustomerName:
      type: object
      properties:
        firstName:
          type: string
          description: Your customer's first name
        lastName:
          type: string
          description: Your customer's last name
    JSONB: {}
    PaymentMethodDetails:
      description: >-
        [Details of the payment method used for this
        transaction](https://docs.meld.io/docs/payment-methods-and-tokenization)
      discriminator:
        propertyName: type
      oneOf:
        - title: CardDetails
          allOf:
            - $ref: '#/components/schemas/CardDetails'
        - title: AchDetails
          allOf:
            - $ref: '#/components/schemas/AchDetails'
        - title: MeldPaymentTokenDetails
          allOf:
            - $ref: '#/components/schemas/MeldPaymentTokenDetails'
    CardDetails:
      type: object
      description: Credit card details
      properties:
        cvc:
          type: string
          description: Card CVC
          example: '123'
          minLength: 1
        expiration:
          description: Expiration date
          allOf:
            - $ref: '#/components/schemas/CardExpiration'
        name:
          type: string
          description: The cardholder's name
        number:
          type: string
          description: Card number
          example: '4111111111111111'
          minLength: 1
      required:
        - cvc
        - number
    AchDetails:
      type: object
      description: ACH details
      properties:
        accountNumber:
          type: string
          description: Account number
          minLength: 1
        accountType:
          type: string
          description: Bank account type
          enum:
            - BUSINESS_CHECKING
            - CHECKING
            - SAVINGS
        name:
          description: Account name
          allOf:
            - $ref: '#/components/schemas/Name'
        routingNumber:
          type: string
          description: Routing number
          minLength: 1
      required:
        - accountNumber
        - accountType
        - routingNumber
    MeldPaymentTokenDetails:
      type: object
      description: Meld payment token details
      properties:
        meldPaymentToken:
          type: string
          description: Meld Payment Token
          minLength: 1
      required:
        - meldPaymentToken
    CardExpiration:
      type: object
      properties:
        month:
          type: integer
          format: int32
          description: Integer value for the expiration month
        year:
          type: integer
          format: int32
          description: Integer value for the expiration year
    Name:
      type: object
      properties:
        firstName:
          type: string
          minLength: 1
        lastName:
          type: string
          minLength: 1
      required:
        - firstName
        - lastName
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      x-default: BASIC <Meld API Key>

````