Authorizations
Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.
Body
Generate Subscription Link
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
Timestamp in epoch milliseconds, indicating the expiration time of the link
32526868154000
The interval group between subscriptions.
DAY, WEEK, MONTH, YEAR "MONTH"
The number of intervals between subscription billings. For example, interval = MONTH and intervalCount = 3 bills every 3 months.
2
The number of billing cycles for which the subscription will renew before ending. The first cycle is included in this count.
2
Your identifier of the order
"order123"
The description of the order, if any
"Order for 2 items"
The URL we will callback to with the subscriptionId once it finishes.
"https://example.com/callback"
The URL to redirect the customer to when they cancel the subscription. If not provided, the callbackUrl will be used as fallback.
"https://example.com/cancel"
The number of trial periods before the first billing cycle. Must be greater than or equal to 0 if provided.
Validation Rules:
- If
trialPeriodCountis provided,trialPeriodIntervalmust also be provided trialPeriodCountis not compatible withupfrontAmount- both cannot be provided simultaneously
x >= 07
The interval for the trial period.
Validation Rules:
- Required when
trialPeriodCountis provided
DAY, WEEK, MONTH, YEAR "DAY"
The maximum number of times this subscription link can be used. If null, the link can be used only once. Must be greater than 0 if provided.
x >= 15
Product Page - showcases more about the product in the payment links
Flag to indicate whether phone number is required from the customer during checkout. By default, this is false.
false
Response
Generate Subscription Link
The shortened URL generated by the xPay API. This link can be shared with customers for completing payments.
"https://api.xpaycheckout.com/subscription/link/pcTrro7D"
A message highlighting unsupported currency and payment method pairs. You may use this information to communicate these limitations to your users and set expectations.
"GBP is not supported on Klarna. The payment will default to USD."