v1
latestOpenAPI 3.0.1MIT2026-07-26336777.7 KBpost/subscription/create
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
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"
}
},
"callbackUrl": "https://example.com/callback",
"cancelUrl": "https://example.com/cancel",
"interval": "MONTH",
"intervalCount": 2,
"cycleCount": 2,
"upfrontAmount": 200,
"trialPeriodCount": 7,
"trialPeriodInterval": "DAY",
"metadata": {
"orderId": "12345",
"customerNote": "Deliver after 5 PM"
},
"customerId": "cus_Tfd3Jq1tZxPjYVhRQW2r3",
"productPage": {
"name": "Premium Subscription",
"description": "Access to premium features and content"
}
}Response
Create Subscription response
Example response
{
"subscriptionId": "sub_fooBOwYsaK50AEfK",
"createdAt": "2024-09-26T10:41:50.472+00:00",
"fwdUrl": "https://pay.xpaycheckout.com/?subscription_id=67f53a6e2097773e4f0112c8"
}