v1

latestOpenAPI 3.0.1MIT2026-07-26336777.7 KB

This API can be used to generate payment links programmatically. Payments links are basically standalone webpages where your customer can make a one time payment.

post/link/merchant/generate-link

Headers

Idempotency-Keystring

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

Request body

amountinteger 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)

currencystring required

Three letter abbreviation of the currency. Refer supported currencies

receiptIdstring

Your identifier of the order

descriptionstring

The description of the order, if any

expiryDateinteger required

Timestamp in epoch milliseconds, indicating the expiration time of the link

callbackUrlstring

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

cancelUrlstring

The URL to redirect the customer to when they cancel the payment. If not provided, the callbackUrl will be used as fallback.

paymentMethodsstring[]

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

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

storeFrontIdstring

🔵 Beta Feature - The unique identifier for your storefront. This ID is used to associate the payment link 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

multiUseLimitinteger

The maximum number of times this payment link can be used. If null, the link can be used only once. Must be greater than 0 if provided.

phoneNumberRequiredboolean

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

allowedCardInstallmentTenuresstring[]

Optional. Restricts which Card Installment (EMI) tenures (in months) are offered at checkout. If omitted, all tenures enabled on your account are offered.

Example request

{
  "amount": 100,
  "currency": "USD",
  "receiptId": "order123",
  "customerDetails": {
    "name": "John Doe",
    "email": "john.doe@example.com",
    "contactNumber": "+919123456789",
    "customerAddress": {
      "addressLine1": "123 Main St",
      "addressLine2": "Apt 1",
      "city": "New York",
      "state": "NY",
      "country": "US",
      "postalCode": "2424"
    }
  },
  "description": "Order for 2 items",
  "expiryDate": 32526868154000,
  "callbackUrl": "https://example.com/callback",
  "cancelUrl": "https://example.com/cancel",
  "paymentMethods": [
    "CARD",
    "GOOGLE_PAY",
    "APPLE_PAY"
  ],
  "storeFrontId": "sf_sK8d3Jq1tZxPjYVhRQW2rf",
  "multiUseLimit": 5,
  "productPage": {
    "name": "Premium Subscription",
    "description": "Access to premium features and content"
  },
  "allowedCardInstallmentTenures": [
    "three",
    "six"
  ]
}

Response

Generate Payment Link

shortUrlstring

The shortened URL generated by the xPay API. This link can be shared with customers for completing payments.

disclaimerstring

A message highlighting unsupported currency and payment method pairs. You may use this information to communicate these limitations to your users and set expectations.

Example response

{
  "shortUrl": "https://api.xpaycheckout.com/link/pcTrro7D",
  "disclaimer": "GBP is not supported on Klarna. The payment will default to USD."
}