Plans API
Plans define price, currency, interval, trial length, invoice limits, and status. All plan endpoints requireX-Api-Key.
Plan object
POST /v1/plan/
Create a plan.Request body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Plan name. |
description | string | No | Plan description. |
amount | integer | Yes | Amount in minor units. |
currency | string | Yes | NGN. |
interval | enum | Yes | daily, weekly, bi-weekly, monthly, quarterly, yearly. |
intervalCount | integer | No | Interval multiplier. |
trialPeriodDays | integer | No | Trial length in days. |
invoiceLimit | integer | No | Maximum invoices before completion logic. |
Response
GET /v1/plan/
List plans.Query parameters
| Parameter | Type | Description |
|---|---|---|
page | integer | Page number. |
limit | integer | Page size. |
search | string | Accepted pagination query value. |
status | enum | active or inactive. |
interval | enum | Plan interval. |
amount | integer | Exact amount filter. |
Response
GET /v1/plan/:planCode
Retrieve one plan.Response
PUT /v1/plan/:planCode
Update a plan. The engine creates a new plan version after an update.Request body
| Field | Type | Description |
|---|---|---|
name | string | New name. |
description | string | New description. |
amount | integer | New amount. |
interval | enum | New interval. |
intervalCount | integer | New interval count. |
trialPeriodDays | integer | New trial length. |
invoiceLimit | integer | New invoice limit. |
status | enum | active or inactive. |
updateExistingSubscriptions | boolean | Apply the new version to existing subscriptions on their next billing cycle. |
