Payment Methods

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

Changed on

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.

post/appMarket/v2/paymentMethods

Request

Request body

ownerIdstring required

The ID of the user who owns the payment method.

companyIdstring required

The ID of the company in which to create the payment method.

tokenstring

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.

paymentMethodTypestring

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.

propertiesobject

The properties of the payment method, as listed in getPaymentMethodTypes Required when creating a payment method from payment method data, not applicable when creating it from token.

Example request

{
  "ownerId": "40e8af95-4caf-415a-96d9-7b023207b535",
  "companyId": "9c130291-cf29-4272-8005-a280b1e81388",
  "token": "pm_0838a859-dfa6-4863-aa38-042d50a9e69a"
}

Response

OK

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

idstring required

Id of the payment method.

accountDisplaystring required

Account display text, such as the last 4 digits of the credit card number.

defaultboolean

Indicates whether this is the default payment method.

Example response

{
  "id": "e35c2f85-ef92-4a8f-89f0-45b62fb95fa7",
  "accountDisplay": "1111",
  "default": false,
  "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 the new required request property

    • breaking

      added the new required request property

    • breaking

      the request's body type changed from no type to object

    • 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 new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added subschema #2: PaymentMethodAppMarket to the response body allOf list for the response 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