POST
/
subscription
/
create
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,
  "metadata": {
    "orderId": "12345",
    "customerNote": "Deliver after 5 PM"
  }
}'
{
  "subscriptionId": "66f53a6e2097773e4f0112c8",
  "createdAt": "2024-09-26T10:41:50.472+00:00",
  "fwdUrl": "https://pay.xpaycheckout.com/?subscription_id=67f53a6e2097773e4f0112c8"
}

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

Create Subscription

The body is of type object.

Response

200
application/json

Create Subscription response

The response is of type object.