Create a subscription
/v1/subscriptionsPairs a PLN_* plan with an AUTH_* stored card to start recurring billing.
Security guard — email must match the authorization owner. The email field must be the same email the customer used when the AUTH_* token was created. This is a defence against stolen-AUTH replay — without it, a merchant could charge any tokenised card by guessing its AUTH_* code. Mismatches return 403 FORBIDDEN.
The first charge fires immediately by default. Pass start_date to delay the first cycle. One active subscription per (customer, plan) pair — re-creating returns 409 CONFLICT.
Body parameters
planstringrequiredPlan code, e.g. PLN_8mFp2Lq9KdR4nXyZ. Plan must be active.
authorizationstringrequiredStored card authorization, e.g. AUTH_5Lp8WkQzR. The cron charges this card each cycle.
emailstringrequiredCustomer email. **Must match** the email that owns the authorization. Case-insensitive.
start_datestringoptionalISO-8601 timestamp. First charge fires on this date. Omit to charge immediately. Must not be in the past.
completed_after_chargesintegeroptionalFor finite-term plans (e.g. 12-month installments). After N successful charges, the subscription flips to completed and stops billing.
metadataobjectoptionalArbitrary key/value pairs for your own bookkeeping.
Response
201subscription_codestringTagPay-assigned code, prefixed with `SUB_`.
statusenum<'active' | 'paused' | 'cancelled' | 'completed' | 'past_due'>Lifecycle state. Starts as `active`.
plan_codestringPlan code this subscription is attached to.
customer_emailstringEmail of the customer being billed.
authorization_codestringThe `AUTH_*` token charged on each cycle.
amountintegerAmount per cycle in kobo, inherited from the plan.
next_charge_atstringISO-8601 timestamp of the next scheduled charge.
last_charge_atstring | nullLast charge attempt, or null on a fresh subscription.
last_charge_statusstring | nullResult of the last charge attempt, or null.
charge_countintegerSuccessful charges to date.
failed_attemptsintegerConsecutive failed attempts. Resets to 0 on success. Hits `past_due` after the retry policy exhausts.
completed_after_chargesinteger | nullCycle limit, or null for open-ended.
created_atstringISO-8601 timestamp.
updated_atstringISO-8601 timestamp.
Errors
NOT_FOUND404Plan or authorization not found in your account.FORBIDDEN403Email does not match the authorization owner (stolen-AUTH guard).VALIDATION_ERROR400Plan is inactive, or `start_date` is in the past.DUPLICATE_REFERENCE409Customer already has an active subscription to this plan. Cancel it first.