Products
- One Time Payments
- Subscription
- Payment Links
- Setup Method
- Virtual Bank Accounts
Dashboard & Operations
Developer Resources
- Get Your Keys
- Authentication
- Errors
- API References
- Payments
- Subscriptions
- Payment Links
- Customer
- Setup Method
- Webhooks
- Sandbox Environment
- Mobile App Integration
Payments
Create Intent
This API is the first API to be called when the payment flow begins. Through this API, you inform xPay of the intent of the user to pay with all the requisite info about the user.
POST
/
payments
/
create-intent
cURL
Copy
curl --request POST \
--url https://api.xpaycheckout.com/payments/create-intent \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '{
"amount": 100,
"currency": "USD",
"currencies": [
"USD",
"EUR",
"GBP"
],
"receiptId": "order123",
"customerDetails": {
"name": "John Doe",
"email": "john.doe@example.com",
"contactNumber": 9123456789,
"customerAddress": {
"country": "US",
"postalCode": "2424"
}
},
"description": "Order for 2 items",
"callbackUrl": "https://example.com/callback",
"cancelUrl": "https://example.com/cancel",
"paymentMethods": [
"CARD",
"GOOGLE_PAY",
"APPLE_PAY"
],
"metadata": {
"orderId": "12345",
"customerNote": "Deliver after 5 PM"
},
"customerId": "cus_Tfd3Jq1tZxPjYVhRQW2r3",
"storeFrontId": "sf_sK8d3Jq1tZxPjYVhRQW2rf"
}'
Copy
{
"amount": 100,
"currency": "USD",
"presentmentCurrency": "USD",
"receiptId": "order123",
"mode": "TEST",
"customerDetails": {
"name": "John Doe",
"email": "john.doe@example.com",
"contactNumber": "9123456789",
"customerAddress": {
"country": "US",
"postalCode": "2424"
}
},
"description": "Order for 2 items",
"callbackUrl": "https://example.com/callback",
"cancelUrl": "https://example.com/cancel",
"createdAt": "2024-09-26T10:41:50.472+00:00",
"status": "CREATED",
"xIntentId": "66f53a6e2097773e4f0112c8",
"fwdUrl": "https://pay.xpaycheckout.com/?xpay_intent_id=67f53a6e2097773e4f0112c8",
"metadata": {
"orderId": "12345",
"customerNote": "Deliver after 5 PM"
}
}
Authorizations
Basic authentication header of the form Basic <encoded-value>
, where <encoded-value>
is the base64-encoded string username:password
.
Body
application/json
Create Intent
The body is of type object
.
Response
200
application/json
Create Intent response
The response is of type object
.
Was this page helpful?
cURL
Copy
curl --request POST \
--url https://api.xpaycheckout.com/payments/create-intent \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data '{
"amount": 100,
"currency": "USD",
"currencies": [
"USD",
"EUR",
"GBP"
],
"receiptId": "order123",
"customerDetails": {
"name": "John Doe",
"email": "john.doe@example.com",
"contactNumber": 9123456789,
"customerAddress": {
"country": "US",
"postalCode": "2424"
}
},
"description": "Order for 2 items",
"callbackUrl": "https://example.com/callback",
"cancelUrl": "https://example.com/cancel",
"paymentMethods": [
"CARD",
"GOOGLE_PAY",
"APPLE_PAY"
],
"metadata": {
"orderId": "12345",
"customerNote": "Deliver after 5 PM"
},
"customerId": "cus_Tfd3Jq1tZxPjYVhRQW2r3",
"storeFrontId": "sf_sK8d3Jq1tZxPjYVhRQW2rf"
}'
Copy
{
"amount": 100,
"currency": "USD",
"presentmentCurrency": "USD",
"receiptId": "order123",
"mode": "TEST",
"customerDetails": {
"name": "John Doe",
"email": "john.doe@example.com",
"contactNumber": "9123456789",
"customerAddress": {
"country": "US",
"postalCode": "2424"
}
},
"description": "Order for 2 items",
"callbackUrl": "https://example.com/callback",
"cancelUrl": "https://example.com/cancel",
"createdAt": "2024-09-26T10:41:50.472+00:00",
"status": "CREATED",
"xIntentId": "66f53a6e2097773e4f0112c8",
"fwdUrl": "https://pay.xpaycheckout.com/?xpay_intent_id=67f53a6e2097773e4f0112c8",
"metadata": {
"orderId": "12345",
"customerNote": "Deliver after 5 PM"
}
}
Assistant
Responses are generated using AI and may contain mistakes.