---
title: "Create payment methods using a token OR by providing all of the payment method data"
method: POST
path: "/appMarket/v2/paymentMethods"
tags: ["Payment Methods"]
---

# Create payment methods using a token OR by providing all of the payment method data

`POST /appMarket/v2/paymentMethods`

## Request

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

When using a token, the validated payment method is assigned to the current user on the current marketplace. When providing all of the payment method data, the payment gateway is called, and the payment method is validated and assigned to the user.

## Request body

- PaymentMethodRequest: The Payload to create a payment method. There are two ways to create a payment method: with a token or with full payment method data. In the latter case, the request is similar to the one for createPaymentMethodToken, but with the addition of the ownerId and companyId parameters.
  - `ownerId` string, required: The ID of the user who owns the payment method.
  - `companyId` string, required: The ID of the company in which to create the payment method.
  - `token` string: Token of the payment method, as returned by createPaymentMethodToken. Required when creating a payment method from a token, not applicable when creating it from payment method data.
  - `paymentMethodType` string: The type of payment method, such as CARD, BANKACCOUNT, and so on. Required when creating a payment method from payment method data, not applicable when creating it from token.
  - `properties` object: The properties of the payment method, as listed in [getPaymentMethodTypes](#returns-all-supported-payment-method-types) Required when creating a payment method from payment method data, not applicable when creating it from token.
  - `billingAddress` BillingAddress: 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

- PaymentMethodAppMarket: The payment method definition, as returned by creation.
  - `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
  - `id` string, required: Id of the payment method.
  - `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`: 7 breaking, 25 info
  - added the new required request property `companyId`
  - added the new required request property `ownerId`
  - the request's body type changed from no type to `object`
  - the response's body type changed from no type to `object` for status `400`
  - …28 more

[Operation history](https://skmtc.dev/appdirect/apis/companies/changes/appMarket/v2/paymentMethods/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)
