Create Subscription

Create a subscription for a customer using an existing plan code.

-H "x-api-key: your_secret_key"
-H "idempotency-key: unique-request-key"
POST {{host}}/v1/subscriptions

Request Body

FieldData TypeRequiredDescription
planCodestringYesPlan code, for example PLN_abc123.
customerstringYesCustomer email address.
cardstringNoSaved card/authorization identifier for card subscriptions.
startDatestringNoISO date/time to start the subscription.
paymentMethodstringNocard, mobile_money, bank_transfer, or bank.
redirectUrlstringNoRedirect URL for hosted payment steps.
invoiceLimitnumberNoMaximum number of invoices to generate before completing the subscription.
maxRetryCountnumberNoMaximum retry attempts for failed invoices.
gracePeriodDaysnumberNoGrace period before cancellation after failed retries.
{
  "planCode": "PLN_abc123",
  "customer": "[email protected]",
  "paymentMethod": "card",
  "redirectUrl": "https://merchant.example.com/subscriptions/callback",
  "invoiceLimit": 12,
  "maxRetryCount": 3,
  "gracePeriodDays": 3
}
{
  "status": true,
  "message": "Success",
  "code": 201,
  "data": {
    "id": "93ad2450-b49f-4c3f-a871-52a5455bdf62",
    "code": "SUB_abc123",
    "status": "ACTIVE",
    "paymentMethod": "card",
    "startDate": "2026-05-20T10:15:00.000Z",
    "nextPaymentDate": "2026-06-20T10:15:00.000Z",
    "retryCount": 0,
    "maxRetryCount": 3,
    "gracePeriodDays": 3
  }
}