Create Plans
Create a plan on your integration
To create a subscription, you'll need to pass information such as customer, plan, card and start date , customer and plan are both required.
Plan Details
Field | Data type | Required | Description |
---|---|---|---|
name | string | Yes | Name of plan |
description | string | Yes | A short info describing the plan |
interval | enum | Yes | Interval in words. Valid intervals are: daily , weekly , monthly , quarterly , biannually, annually`. |
amount | integer | Yes | Amount should be in supported local currency |
localCurrency | string | Yes | The currency in which the customer should be charged. The ISO 4217 currency code |
After collecting the necessary plan details. Make a POST request to our plans endpoint.
Note : Before making a post request, the secret key should be specified in the header.
-H "x-api-key: your_secret_key".
{{host}}/v1/plans
You can make API calls using this sample request. once all parameters are meet you would also get the response below;
{
"name": "TEST",
"description": "FIEXING",
"interval": "biannually",
"amount": 5000,
"localCurrency": "NGN"
}
{
"status": true,
"message": "Success",
"code": 201,
"data": {
"name": "TEST",
"description": "FIEXING",
"interval": "biannually",
"amount": "5000.00",
"integration": {
"id": "7783fd36-5d77-4f67-8c52-c69c27721790",
"reference": "ACCT_433003k7cm924vm",
"splitCode": null,
"isActive": true,
"isDefault": true,
"comments": {},
"createdAt": "2023-10-20T12:00:23.447Z",
"updatedAt": "2023-10-25T10:25:23.477Z",
"version": 3,
"region": {
"id": "faa05b6c-1851-4174-bbdf-67e15aa86817",
"name": "Nigeria",
"code": "NGA",
"alpha2Code": "NG",
"flagSvg": "https://flagcdn.com/ng.svg",
"flagPng": "https://flagcdn.com/w320/ng.png",
"currency": {
"code": "NGN",
"name": "Nigerian naira",
"symbol": "₦"
},
"demonym": "Nigerian",
"dialingCode": "+234",
"isActive": true,
"isDefault": false,
"isSettlement": false,
"isCollection": true,
"createdAt": "2023-09-11T21:52:43.997Z",
"updatedAt": "2023-09-11T21:52:43.997Z",
"version": 1
}
},
"code": "PLN_7263269_dIz_JeiVoKjr6Dm",
"deletedAt": null,
"id": "e2acfea4-2e5d-4bae-8581-f856beebc341",
"sendSms": false,
"sendInvoices": false,
"limit": "0.00",
"hostedPage": false,
"isActive": true,
"createdAt": "2024-06-21T15:41:21.664Z",
"updatedAt": "2024-06-21T15:41:21.664Z",
"version": 1
}
}
Updated 3 months ago