---
title: "Tokenize payment methods"
method: POST
path: "/appMarket/v2/paymentMethodTokens"
tags: ["Payment Methods"]
---

# Tokenize payment methods

`POST /appMarket/v2/paymentMethodTokens`

## Request

- Base URL: `https://marketplace.appdirect.com/api`
- URL: `https://marketplace.appdirect.com/api/appMarket/v2/paymentMethodTokens`
- Auth: none declared. Required headers: `AD-Public-Developer-Key`
- TypeScript: <https://skmtc.dev/appdirect/apis/companies/docs/appMarket/v2/paymentMethodTokens/post.ts> (a function with typed inputs; its response is checked against the schema)

Calls the payment gateway to validate the payment method, which is not yet associated with a user. A front-end should call this endpoint directly, not a back-end. Requires a public developer key (use the AD-Public-Developer-Key header), which you must obtain from AppDirect.

## Headers

- `AD-Public-Developer-Key` string, required

## Request body

- PaymentMethodTokenRequest: The Payload used to tokenize a Payment Method.
  - `paymentMethodType` string, required: The type of payment method, such as CARD, BANKACCOUNT, and so on.
  - `properties` object, required: The properties of the payment method, as listed in [getPaymentMethodTypes](#returns-all-supported-payment-method-types)
  - `billingAddress` BillingAddress, required: Billing address
    - `street1` string, required: First line of a street address
    - `street2` string, nullable: Second line of a street address, such as apartment or unit number
    - `city` string, required: City or town
    - `country` string, required: Country code in ISO-3166 format
    - `state` string, required: State, province, or region
    - `zip` string, required: ZIP or postal code
    - `phone` string, nullable: Phone number
    - `salutation` string, nullable: Personal salutation
    - `companyName` string, nullable: Company name
    - `fax` string, nullable: Fax number
    - `faxExtension` string, nullable: Fax number extension
    - `poBox` string, nullable: Post office box number

## Response `200`

OK

- PaymentMethodTokenResponse: The tokenized Payment Method.
  - `id` string, required: The token for the payment method.
  - `expiration` string, date-time, required: The date and time when the token expires
  - `paymentMethod` PaymentMethodForTokenization, required: The payment method definition, as returned by tokenization.
    - `paymentMethodType` string, required: The type of payment method, such as CARD, BANKACCOUNT, and so on.
    - `properties` object, required: The properties of the payment method, as listed in [getPaymentMethodTypes](#returns-all-supported-payment-method-types)
    - `billingAddress` BillingAddress, required: Billing address
      - `street1` string, required: First line of a street address
      - `street2` string, nullable: Second line of a street address, such as apartment or unit number
      - `city` string, required: City or town
      - `country` string, required: Country code in ISO-3166 format
      - `state` string, required: State, province, or region
      - `zip` string, required: ZIP or postal code
      - `phone` string, nullable: Phone number
      - `salutation` string, nullable: Personal salutation
      - `companyName` string, nullable: Company name
      - `fax` string, nullable: Fax number
      - `faxExtension` string, nullable: Fax number extension
      - `poBox` string, nullable: Post office box number
    - `accountDisplay` string, required: Account display text, such as the last 4 digits of the credit card number.
    - `default` boolean: Indicates whether this is the default payment method..

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `500`: Internal Server Error
- `502`: Bad Gateway
- `504`: Gateway Timeout

## Changes

- **2026-11-06** `1fc240f06971`: 6 breaking, 23 info
  - added `#/components/schemas/BasePaymentMethod, subschema #2: PaymentMethodTokenRequest` to the request body `allOf` list
  - the response's body type changed from no type to `object` for status `200`
  - the response's body type changed from no type to `object` for status `400`
  - the response's body type changed from no type to `object` for status `500`
  - …25 more

[Operation history](https://skmtc.dev/appdirect/apis/companies/changes/appMarket/v2/paymentMethodTokens/post.md)

---

[API](https://skmtc.dev/appdirect/apis/companies.md) - [All operations](https://skmtc.dev/appdirect/apis/companies/llms.txt) - [OpenAPI document](https://skmtc.dev/appdirect/apis/companies/revisions/1fc240f06971?raw)
