POST
/
link
/
merchant
/
generate-link
curl --request POST \
  --url https://api.xpaycheckout.com/link/merchant/generate-link \
  --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",
  "dueDate": 32526868154000,
  "paymentMethods": [
    "CARD",
    "GOOGLE_PAY",
    "APPLE_PAY"
  ]
}'
{
  "shortUrl": "https://api.xpaycheckout.com/link/pcTrro7D"
}

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
Generate Payment Link
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

dueDate
integer
required

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

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

Response

200
application/json
Generate Payment Link
shortUrl
string

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