Plans
The PlanResource allows you to create and manage payment plans on your integration. These plans can be used for recurring subscriptions or installment payment options for your customers.
Tip: You can also create and manage plans directly from your Paystack Dashboard without using the API.
Create Plan
Create a plan on your integration.
Important: The
amountshould be in the subunit of the supported currency (e.g., kobo for Naira, pesewas for Cedi).
php
$plan = paystack()->plan()->create([
'name' => 'Monthly Retainer',
'amount' => 500000, // 5,000.00
'interval' => 'monthly',
'description' => 'Monthly retainer for services'
]);Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
name | String | Yes | Name of plan. |
amount | Integer | Yes | Amount should be in the subunit of the supported currency. |
interval | String | Yes | Interval in words. Valid intervals are: daily, weekly, monthly, quarterly, biannually (every 6 months), annually. |
description | String | No | A description for this plan. |
send_invoices | Boolean | No | Set to false if you don't want invoices to be sent to your customers. |
send_sms | String | No | Set to false if you don't want text messages to be sent to your customers. |
currency | String | No | Currency in which amount is set. |
invoice_limit | Integer | No | Number of invoices to raise during subscription to this plan. Can be overridden by specifying an invoice_limit while subscribing. |
List Plans
List plans available on your integration.
php
// List all plans
$plans = paystack()->plan()->list();
// Filter plans
$filtered = paystack()->plan()->list([
'perPage' => 20,
'status' => 'active',
'interval' => 'monthly'
]);Parameters
| Parameter | Type | Description |
|---|---|---|
perPage | Integer | Specify how many records you want to retrieve per page. Default: 50. |
page | Integer | Specify exactly what page you want to retrieve. Default: 1. |
status | String | Filter list by plans with specified status. |
interval | String | Filter list by plans with specified interval. |
amount | Integer | Filter list by plans with specified amount using the supported currency. |
Fetch Plan
Get details of a plan on your integration.
php
$idOrCode = 'PLN_gx2wn530m0i3w3m';
$plan = paystack()->plan()->fetch($idOrCode);Update Plan
Update a plan's details on your integration.
php
$idOrCode = 'PLN_gx2wn530m0i3w3m';
$updated = paystack()->plan()->update($idOrCode, [
'name' => 'Monthly Retainer (Renamed)',
'amount' => 600000
]);Parameters
| Parameter | Type | Description |
|---|---|---|
name | String | Name of plan. |
amount | Integer | Amount should be in the subunit of the supported currency. |
interval | String | Interval in words. Valid intervals are hourly, daily, weekly, monthly, quarterly, biannually, annually. |
description | String | A description for this plan. |
send_invoices | Boolean | Set to false if you don't want invoices to be sent to your customers. |
send_sms | String | Set to false if you don't want text messages to be sent to your customers. |
currency | String | Currency in which amount is set. |
invoice_limit | Integer | Number of invoices to raise during subscription to this plan. |
update_existing_subscriptions | Boolean | Set to true if you want the existing subscriptions to use the new changes. Set to false and only new subscriptions will be changed. Defaults to true when not set. |
