Subscriptions
Subscriptions currently support create, fetch, list, enable, disable, and subscription update-link operations.
Create a subscription
php
use Maxiviper117\Paystack\Data\Input\Subscription\CreateSubscriptionInputData;
use Maxiviper117\Paystack\Facades\Paystack;
$response = Paystack::createSubscription(
new CreateSubscriptionInputData(
customer: 'CUS_123',
plan: 'PLN_123',
)
);Other supported subscription actions
FetchSubscriptionActionListSubscriptionsActionEnableSubscriptionActionDisableSubscriptionActionGenerateSubscriptionUpdateLinkActionSendSubscriptionUpdateLinkAction
Matching DTOs:
FetchSubscriptionInputDataListSubscriptionsInputDataEnableSubscriptionInputDataDisableSubscriptionInputDataGenerateSubscriptionUpdateLinkInputDataSendSubscriptionUpdateLinkInputDataFetchSubscriptionResponseDataListSubscriptionsResponseDataEnableSubscriptionResponseDataDisableSubscriptionResponseDataGenerateSubscriptionUpdateLinkResponseDataSendSubscriptionUpdateLinkResponseData
Subscription response DTOs use the backed SubscriptionStatus enum for the documented values active, non-renewing, attention, completed, and cancelled.
Relationship to plans
Subscriptions depend on an existing Paystack plan. A common flow is:
- Create or fetch a plan.
- Use the plan code in
CreateSubscriptionInputData. - Manage the subscription lifecycle through the subscription actions.
- Generate or email a card-update link when the customer needs to refresh their subscription authorization.