Skip to main content
POST
/
s2s
/
payments
/
intent
cURL
curl --request POST \
  --url https://api.xpaycheckout.com/s2s/payments/intent \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --data '{
  "amount": 10000,
  "currency": "USD",
  "customer_id": "cus_Tfd3Jq1tZxPjYVhRQW2r3",
  "payment_method": "APPLE_PAY",
  "receiptId": "receipt_abc123",
  "channel": "web",
  "description": "",
  "callback_url": "https://yourserver.com/webhook",
  "metadata": {},
  "tokenise": true
}'
{
  "payment_id": "pay_8Ks3Jq1tZxPjYVhRQW2r5",
  "forward_url": "",
  "status": "CREATED",
  "amount": 10000,
  "currency": "USD",
  "customer_id": "cus_Tfd3Jq1tZxPjYVhRQW2r3",
  "receiptId": "receipt_abc123",
  "payment_method": "APPLE_PAY",
  "created_at": 1728128100000
}
Creates a payment intent for redirect-based payment methods (Apple Pay, Klarna, etc.). Returns a payment_id and forward_url for redirecting the user.
After a user tokenizes a card once with Apple Pay wallet, further payments can be done directly via fully backend without redirection to Apple Pay using the charge endpoints.

Authorizations

Authorization
string
header
required

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

Body

application/json

Create Payment Intent Request

amount
integer
required

Amount in smallest currency unit (e.g., cents)

Example:

10000

currency
string
required

Three-letter currency code

Example:

"USD"

customer_id
string
required

Unique customer identifier

Example:

"cus_Tfd3Jq1tZxPjYVhRQW2r3"

payment_method
string
required

Payment method for redirect (APPLE_PAY, KLARNA, etc.)

Example:

"APPLE_PAY"

receiptId
string
required

Client's receipt identifier

Example:

"receipt_abc123"

callback_url
string
required

Webhook URL for payment status updates

Example:

"https://yourserver.com/webhook"

channel
string

Channel identifier (e.g., "web", "ios", "android")

Example:

"web"

description
string

Payment description

Example:

""

metadata
object

Additional key-value pairs (max 50 pairs)

tokenise
boolean

This boolean tokenises and stores the payment method (e.g., Apple Pay) for future use. If sending this value, corresponding customer_id is also required

Example:

true

Response

Payment intent created successfully

payment_id
string
Example:

"pay_8Ks3Jq1tZxPjYVhRQW2r5"

forward_url
string

Forward URL for redirecting user

Example:

""

status
enum<string>
Available options:
CREATED
Example:

"CREATED"

amount
integer
Example:

10000

currency
string
Example:

"USD"

customer_id
string
Example:

"cus_Tfd3Jq1tZxPjYVhRQW2r3"

receiptId
string
Example:

"receipt_abc123"

payment_method
string
Example:

"APPLE_PAY"

created_at
integer

Epoch timestamp in milliseconds of when payment intent was created

Example:

1728128100000