POST
/
payments
/
create-intent
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",
  "receiptId": "order123",
  "customerDetails": {
    "name": "John Doe",
    "email": "john.doe@example.com",
    "contactNumber": 9123456789,
    "customerAddress": {
      "addressLine1": "123 Main St",
      "addressLine2": "Apt 101",
      "city": "Los Angeles",
      "state": "California",
      "country": "United States",
      "postalCode": "123456"
    }
  },
  "description": "Order for 2 items",
  "callbackUrl": "https://example.com/callback",
  "paymentMethods": [
    "CARD",
    "GOOGLE_PAY",
    "APPLE_PAY"
  ],
  "customerReferenceId": "customer123"
}'
{
  "amount": 100,
  "currency": "USD",
  "presentmentCurrency": "USD",
  "receiptId": "order123",
  "mode": "TEST",
  "customerDetails": {
    "name": "John Doe",
    "email": "john.doe@example.com",
    "contactNumber": "9123456789",
    "customerAddress": {
      "addressLine1": "123 Main St",
      "addressLine2": "Apt 101",
      "city": "Los Angeles",
      "state": "California",
      "country": "United States",
      "postalCode": "123456"
    }
  },
  "description": "Order for 2 items",
  "callbackUrl": "https://example.com/callback",
  "createdAt": "2024-09-26T10:41:50.472+00:00",
  "status": "CREATED",
  "xIntentId": "66f53a6e2097773e4f0112c8",
  "fwdUrl": "https://pay.xpaycheckout.com/?xpay_intent_id=67f53a6e2097773e4f0112c8"
}

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 Intent
amount
integer
required

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)

currency
string
required

Three letter abbreviation of the currency. Refer supported currencies

customerDetails
object
required

Details about the customer

callbackUrl
string
required

The URL we will callback to with the order status once it finishes.

receiptId
string

Your identifier of the order

description
string

The description of the order, if any

paymentMethods
string[]

List of payment methods to be enabled for the link. supported payment methods

customerReferenceId
string

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

Response

200
application/json
Create Intent response
amount
integer

The amount in lowest count unit (e.g., cents for USD)

currency
string

Three-letter currency code

presentmentCurrency
string

The currency that the customer paid in

receiptId
string

Your identifier for the order

mode
string

The mode in which the transaction was made (e.g., TEST or LIVE)

customerDetails
object
description
string

Description of the order, if any

callbackUrl
string

Callback URL to notify order status

createdAt
string

Timestamp of when the intent was created

status
string

Current status of the intent.

xIntentId
string

Unique identifier of the intent

fwdUrl
string

The URL to redirect the customer to the xPay payment gateway for payment.