---
title: "Create a Meld payment token"
method: POST
path: "/payments/tokens"
tags: ["Transactions"]
---

# Create a Meld payment token

`POST /payments/tokens`

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

## Request body

- PaymentTokenRequest
  - `customer` CustomerInput
    - `addresses` CustomerAddressInput[] — Your customer's addresses, such as BILLING, SHIPPING, RESIDENCE, etc.
      - `addressDetails` CustomerAddressDetails
        - `addressDetailsFields` object
        - `city` string — City, district, suburb, town, or village
        - `country` string — Two-letter country code (ISO 3166-1 alpha-2)
        - `firstName` string — The first name on the address
        - `lastName` string — The last name on the address
        - `lineOne` string — Address line 1 (e.g., street, PO Box, or company name)
        - `lineTwo` string — Address line 2 (e.g., apartment, suite, unit, or building)
        - `postalCode` string — ZIP or postal code
        - `region` string — State, county, province, or region
      - `type` 'BILLING' | 'SHIPPING' | 'RESIDENCE' — Address type such as BILLING, SHIPPING, RESIDENCE, etc.
    - `billingAddress` CustomerAddressInput
      - `addressDetails` CustomerAddressDetails
        - `addressDetailsFields` object
        - `city` string — City, district, suburb, town, or village
        - `country` string — Two-letter country code (ISO 3166-1 alpha-2)
        - `firstName` string — The first name on the address
        - `lastName` string — The last name on the address
        - `lineOne` string — Address line 1 (e.g., street, PO Box, or company name)
        - `lineTwo` string — Address line 2 (e.g., apartment, suite, unit, or building)
        - `postalCode` string — ZIP or postal code
        - `region` string — State, county, province, or region
      - `type` 'BILLING' | 'SHIPPING' | 'RESIDENCE' — Address type such as BILLING, SHIPPING, RESIDENCE, etc.
    - `billingAddressDetails` CustomerAddressDetails
      - `addressDetailsFields` object
      - `city` string — City, district, suburb, town, or village
      - `country` string — Two-letter country code (ISO 3166-1 alpha-2)
      - `firstName` string — The first name on the address
      - `lastName` string — The last name on the address
      - `lineOne` string — Address line 1 (e.g., street, PO Box, or company name)
      - `lineTwo` string — Address line 2 (e.g., apartment, suite, unit, or building)
      - `postalCode` string — ZIP or postal code
      - `region` string — State, county, province, or region
    - `email` string, email — Your customer's email address.
    - `externalId` string — Your (optional) Id for this customer, for example an id or reference from your database which you may supply during customer creation
    - `id` string — Meld's internal Id for the Customer
    - `name` CustomerName
      - `firstName` string — Your customer's first name
      - `lastName` string — Your customer's last name
    - `nameEmpty` boolean
    - `nameJSONB` unknown
    - `nameOrEmptyString` string
    - `nameOrNull` string
    - `phone` string — Your customer's phone number
    - `residenceAddress` CustomerAddressInput
      - `addressDetails` CustomerAddressDetails
        - `addressDetailsFields` object
        - `city` string — City, district, suburb, town, or village
        - `country` string — Two-letter country code (ISO 3166-1 alpha-2)
        - `firstName` string — The first name on the address
        - `lastName` string — The last name on the address
        - `lineOne` string — Address line 1 (e.g., street, PO Box, or company name)
        - `lineTwo` string — Address line 2 (e.g., apartment, suite, unit, or building)
        - `postalCode` string — ZIP or postal code
        - `region` string — State, county, province, or region
      - `type` 'BILLING' | 'SHIPPING' | 'RESIDENCE' — Address type such as BILLING, SHIPPING, RESIDENCE, etc.
    - `residenceAddressDetails` CustomerAddressDetails
      - `addressDetailsFields` object
      - `city` string — City, district, suburb, town, or village
      - `country` string — Two-letter country code (ISO 3166-1 alpha-2)
      - `firstName` string — The first name on the address
      - `lastName` string — The last name on the address
      - `lineOne` string — Address line 1 (e.g., street, PO Box, or company name)
      - `lineTwo` string — Address line 2 (e.g., apartment, suite, unit, or building)
      - `postalCode` string — ZIP or postal code
      - `region` string — State, county, province, or region
    - `shippingAddress` CustomerAddressInput
      - `addressDetails` CustomerAddressDetails
        - `addressDetailsFields` object
        - `city` string — City, district, suburb, town, or village
        - `country` string — Two-letter country code (ISO 3166-1 alpha-2)
        - `firstName` string — The first name on the address
        - `lastName` string — The last name on the address
        - `lineOne` string — Address line 1 (e.g., street, PO Box, or company name)
        - `lineTwo` string — Address line 2 (e.g., apartment, suite, unit, or building)
        - `postalCode` string — ZIP or postal code
        - `region` string — State, county, province, or region
      - `type` 'BILLING' | 'SHIPPING' | 'RESIDENCE' — Address type such as BILLING, SHIPPING, RESIDENCE, etc.
    - `shippingAddressDetails` CustomerAddressDetails
      - `addressDetailsFields` object
      - `city` string — City, district, suburb, town, or village
      - `country` string — Two-letter country code (ISO 3166-1 alpha-2)
      - `firstName` string — The first name on the address
      - `lastName` string — The last name on the address
      - `lineOne` string — Address line 1 (e.g., street, PO Box, or company name)
      - `lineTwo` string — Address line 2 (e.g., apartment, suite, unit, or building)
      - `postalCode` string — ZIP or postal code
      - `region` string — State, county, province, or region
  - `paymentMethod` PaymentMethodInput — PaymentMethod objects represent your customer's payment instruments
    - `details` union, required — [Details of the payment method used for this transaction](https://docs.meld.io/docs/payment-methods-and-tokenization)
      - object — Credit card details
        - `cvc` string, required — Card CVC
        - `expiration` CardExpiration
          - `month` integer — Integer value for the expiration month
          - `year` integer — Integer value for the expiration year
        - `name` string — The cardholder's name
        - `number` string, required — Card number
      - object — ACH details
        - `accountNumber` string, required — Account number
        - `accountType` 'BUSINESS_CHECKING' | 'CHECKING' | 'SAVINGS', required — Bank account type
        - `name` Name
          - `firstName` string, required
          - `lastName` string, required
        - `routingNumber` string, required — Routing number
      - object — Meld payment token details
        - `meldPaymentToken` string, required — Meld Payment Token
    - `type` 'ACH' | 'CARD' | 'MELD_PAYMENT_TOKEN' | 'PLAID_TRANSFER_AUTHORIZATION', required — Payment method type used for this transaction, some methods may only apply for some providers, e.g. PLAID_TRANSFER_AUTHORIZATION for PLAID
  - `serviceProviders` string[] — 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.

## Response `200`

OK

## Other responses

- `400` — Bad Request : check request values and format
- `401` — Invalid credentials
- `403` — Unauthenticated or authenticated with insufficient access
- `500` — 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.

---

[API](https://skmtc.net/meld/apis/bank-linking.md) · [All operations](https://skmtc.net/meld/apis/bank-linking/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/meld/bank-linking/versions/818d6079a611/schema)
