Create a payment method

Starts attaching a payment method to a customer by exchanging a client-side confirmation token for a setup intent. Complete any additional authentication client-side using the returned client secret.

Authentication

AuthorizationBearer
API Key authentication using Bearer token

Request

Body
confirmationTokenstringRequired>=1 character

Confirmation token generated client-side by the payment processor’s elements (e.g. a Stripe ConfirmationToken ID).

customerIdstringOptional>=1 character
Paid customer ID to attach the payment method to.
externalCustomerIdstringOptional>=1 character
Your external customer ID to attach the payment method to.
returnUrlstringOptionalformat: "uri"

URL the customer is redirected to after completing any additional authentication step (e.g. 3-D Secure).

metadatamap from strings to stringsOptional

Key-value metadata stored on the setup intent.

Response

201
setupIntentobject
The setup intent created with the payment processor.
externalPaymentMethodIdstring or null
The payment processor's identifier for the attached payment method, when already available.
customerIdstring
The customer the payment method is being attached to.

Errors

400
Bad Request Error
403
Forbidden Error
404
Not Found Error
500
Internal Server Error