Skip to main content
POST
cURL

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Headers

Idempotency-Key
string

A unique key for making the request idempotent. Must match pattern: ^[a-zA-Z0-9\-_:\.]+$. See Idempotent Requests for more details.

Maximum string length: 255
Pattern: ^[a-zA-Z0-9\-_:\.]+$

Body

application/json

Create Setup Method

currency
string
required

Three letter abbreviation of the currency. Refer supported currencies

Example:

"USD"

billingDetails
object
required

Billing details for the customer.

callbackUrl
string
required

The URL we will callback to once the setup is complete

Example:

"https://example.com/callback"

paymentMethods
string[]

List of payment methods to be enabled for setup. supported payment methods

💡 If a selected payment method is unavailable, the system will automatically fallback to card payments to ensure a smooth checkout experience.

Example:
customerId
string

The unique identifier for the customer, generated via the create-customer API.

Example:

"cus_Tfd3Jq1tZxPjYVhRQW2r3"

storeFrontId
string

The unique identifier for your storefront

Example:

"sf_sK8d3Jq1tZxPjYVhRQW2rf"

metadata
object

A collection of key-value pairs that can be attached to an object for storing additional structured information

Example:
phoneNumberRequired
boolean

Flag to indicate whether phone number is required from the customer during checkout. By default, this is false.

Example:

false

Response

Setup Method created successfully

setupMethodId
string

Unique identifier of the setup method

Example:

"sm_sK8d3Jq1tZxPjYVhRQW2rf"

fwdUrl
string

The URL to redirect the customer to complete the setup

Example:

"https://pay.xpaycheckout.com/setup-method?id=sm_sK8d3Jq1tZxPjYVhRQW2rf&secret=4b5PyxKSOuunnnFruohoiF"