Payment Methods

Tokenize payment methods

Changed on

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.

post/appMarket/v2/paymentMethodTokens

Request

Headers

AD-Public-Developer-Keystring required

Request body

paymentMethodTypestring required

The type of payment method, such as CARD, BANKACCOUNT, and so on.

propertiesobject required

The properties of the payment method, as listed in getPaymentMethodTypes

Example request

{
  "paymentMethodType": "CARD",
  "properties": {
    "number": "4111111111111111",
    "securityCode": "123",
    "cardHolderName": "John Smith",
    "expirationMonth": "5",
    "expirationYear": "2019",
    "brand": "VISA"
  },
  "billingAddress": {
    "street1": "279 Prince St",
    "city": "Montreal",
    "state": "Quebec",
    "country": "CA",
    "zip": "H3C 2N4"
  }
}

Response

OK

idstring required

The token for the payment method.

expirationstring date-time required

The date and time when the token expires

Example response

{
  "id": "pm_0838a859-dfa6-4863-aa38-042d50a9e69a",
  "expiration": "2018-04-112T19:15:00Z",
  "paymentMethod": {
    "accountDisplay": "1111",
    "paymentMethodType": "CARD",
    "properties": {
      "cardHolderName": "John Smith",
      "expirationMonth": "5",
      "expirationYear": "2019",
      "brand": "VISA"
    },
    "billingAddress": {
      "street1": "279 Prince St",
      "city": "Montreal",
      "state": "Quebec",
      "country": "CA",
      "zip": "H3C 2N4"
    }
  }
}

Changes

    • breaking

      added subschema #2: PaymentMethodTokenRequest to the request body allOf list

    • breaking

      the response's body type changed from no type to object for status

    • breaking

      the response's body type changed from no type to object for status

    • breaking

      the response's body type changed from no type to object for status

    • breaking

      the response's body type changed from no type to object for status

    • breaking

      the response's body type changed from no type to object for status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the optional property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status

    • info

      added the required property to the response with the status