curl --request POST \
--url https://api.xpaycheckout.com/subscription/create \
--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": {
"country": "US",
"postalCode": "2424"
}
},
"description": "Order for 2 items",
"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"
}
}'
{
"subscriptionId": "sub_fooBOwYsaK50AEfK",
"createdAt": "2024-09-26T10:41:50.472+00:00",
"fwdUrl": "https://pay.xpaycheckout.com/?subscription_id=67f53a6e2097773e4f0112c8"
}
curl --request POST \
--url https://api.xpaycheckout.com/subscription/create \
--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": {
"country": "US",
"postalCode": "2424"
}
},
"description": "Order for 2 items",
"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"
}
}'
{
"subscriptionId": "sub_fooBOwYsaK50AEfK",
"createdAt": "2024-09-26T10:41:50.472+00:00",
"fwdUrl": "https://pay.xpaycheckout.com/?subscription_id=67f53a6e2097773e4f0112c8"
}
Basic authentication header of the form Basic <encoded-value>
, where <encoded-value>
is the base64-encoded string username:password
.
Create Subscription
The body is of type object
.
Create Subscription response
The response is of type object
.
Was this page helpful?