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.
Authorizations
Basic authentication header of the form Basic <encoded-value>
, where <encoded-value>
is the base64-encoded string username:password
.
Body
The amount in lowest count unit. e.g.: For USD 1, amount is 100 representing 100 cents (The minimum amount should be greater than 1 USD)
100
Three letter abbreviation of the currency. Refer supported currencies
"USD"
Details about the customer
The URL we will callback to with the xIntentId once it finishes.
"https://example.com/callback"
Your identifier of the order
"order123"
The description of the order, if any
"Order for 2 items"
The URL to redirect the customer to when they cancel the payment. If not provided, the callbackUrl will be used as fallback.
"https://example.com/cancel"
List of payment methods to be enabled for the link. supported payment methods
["CARD", "GOOGLE_PAY", "APPLE_PAY"]
The customerReferenceId
is used to enable the saved payment method feature. When a new, unique customerReferenceId
is provided, a new customer profile is created. To retrieve and display a customer's previously saved payment methods, use the same customerReferenceId
in subsequent transactions.
⚠️Warning : Ensure the customerReferenceId
is unique for each customer. Using a duplicate ID may result in payment methods being unintentionally shared across different customers, compromising security and privacy
"customer123"
A collection of key-value pairs that can be attached to an object for storing additional structured information. This is useful for capturing custom data or context-specific attributes.
Constraints:
- Maximum of 50 key-value pairs allowed.
- Each key must be no longer than 40 characters.
- Each value must be a string and cannot exceed 500 characters.
{
"orderId": "12345",
"customerNote": "Deliver after 5 PM"
}
🔵 Beta Feature - The unique identifier for your storefront. This ID is used to associate the payment with a specific storefront in your account. When provided, it will replace the default DBA and logo with the corresponding storefront's branding. This feature is currently in beta testing and may be subject to changes.
To enable this feature, please contact hello@xpaycheckout.com
"sf_sK8d3Jq1tZxPjYVhRQW2rf"
Response
The amount in lowest count unit (e.g., cents for USD)
100
Three-letter currency code
"USD"
The currency that the customer paid in
"USD"
Your identifier for the order
"order123"
The mode in which the transaction was made (e.g., TEST or LIVE)
"TEST"
Description of the order, if any
"Order for 2 items"
Callback URL to notify order status
"https://example.com/callback"
The URL to redirect the customer to when they cancel the payment.
"https://example.com/cancel"
Timestamp of when the intent was created
"2024-09-26T10:41:50.472+00:00"
Current status of the intent.
"CREATED"
Unique identifier of the intent
"66f53a6e2097773e4f0112c8"
The URL to redirect the customer to the xPay payment gateway for payment.
"https://pay.xpaycheckout.com/?xpay_intent_id=67f53a6e2097773e4f0112c8"
A collection of key-value pairs that were provided when the object was created. These metadata values are echoed back in the response, allowing you to store and retrieve custom information such as context-specific attributes, references, or tags. This can be useful for correlating records in your system or attaching meaningful context to transactions.
{
"orderId": "12345",
"customerNote": "Deliver after 5 PM"
}
Was this page helpful?