Skip to main content

Subscription

Manage customer subscriptions to your recurring billing plans via $paystack->subscription.

Create a Subscription​

Subscribe an existing customer to a billing plan.

$response = $paystack->subscription->create([
'customer' => 'CUS_xnxdt6s1zg1f4nx',
'plan' => 'PLN_gx2wn530m0i3w3m',
]);
Authorization Requirement

The customer must already have a reusable card authorization on your integration before you can create a subscription directly. If multiple authorizations exist, you can pass an optional authorization code in the payload.


List Subscriptions​

Retrieve a paginated list of subscriptions on your integration.

$response = $paystack->subscription->list([
'perPage' => 20,
'page' => 1,
]);
ParameterTypeDescription
perPageintNumber of records to retrieve per page (default: 50).
pageintPage number to retrieve (default: 1).
customerintFilter subscriptions by a specific customer ID.
planintFilter subscriptions by a specific plan ID.

Fetch a Subscription​

Retrieve full details of a specific subscription using its subscription_code or numeric id.

$response = $paystack->subscription->fetch('SUB_vsyqdmlzble3uii');

Enable or Disable a Subscription​

Activate a paused subscription or cancel an active one using its subscription_code and email_token.

$response = $paystack->subscription->enable([
'code' => 'SUB_vsyqdmlzble3uii',
'token' => 'd7gofp6yppn3qz7',
]);
Store the Email Token

Paystack returns email_token when you create or fetch a subscription. Save this token alongside subscription_code in your database so your backend can programmatically enable or cancel subscriptions without manual dashboard intervention.