Payments
How to set up recurring charges
In a nutshell
Store a reusable authorization from a first payment and charge it again later.
Copy linkCharge the first transaction
Start with a normal successful payment from Checkout, a mobile SDK, or another supported first-charge flow.
For card tokenization, Paystack recommends charging at least NGN 50.00, GHS 0.10, ZAR 1.00, KES 3.00, or USD 2.00.
Copy linkRetrieve the authorization
After the payment succeeds, retrieve the transaction result from your webhook endpoint or from transaction verification. The successful transaction includes an authorization object inside data.
{
"data": {
"authorization": {
"authorization_code": "AUTH_8dfhjjdt",
"card_type": "visa",
"last4": "1381",
"exp_month": "08",
"exp_year": "2018",
"bin": "412345",
"bank": "TEST BANK",
"channel": "card",
"signature": "SIG_idyuhgd87dUYSHO92D",
"reusable": true,
"country_code": "NG",
"account_name": "BoJack Horseman"
}
}
}
Copy linkStore the authorization and email
Save the full authorization object and the exact transaction email in your database. Use the signature to deduplicate cards so you do not store the same instrument more than once.
Copy linkCharge the stored authorization
When you need to bill the customer again, charge the saved authorization code with the same email.
curl https://api.paystack.co/transaction/charge_authorization \
-H "Authorization: Bearer YOUR_SECRET_KEY" \
-H "Content-Type: application/json" \
-d '{
"authorization_code": "AUTH_pmx3mgawyd",
"email": "[email protected]",
"amount": "300000"
}' \
-X POST
Copy linkHandle 2FA when required
Some recurring charges can return a paused response that requires the customer to authorize the payment on a hosted page.
{
"status": true,
"message": "Please, redirect your customer to the authorization url provided",
"data": {
"authorization_url": "https://checkout.paystack.com/resume/0744ub5o065nwyz",
"reference": "jvx2o36ghlvrgtt",
"access_code": "0744ub5o065nwyz",
"paused": true
}
}
Redirect the customer to data.authorization_url. You can also include callback_url in the request and metadata.cancel_action if you need custom completion and cancellation destinations.
Copy linkAuthorization fields
| Field | Meaning |
|---|---|
authorization_code | Token you pass to charge_authorization |
card_type | Card brand or type |
last4 | Last four digits of the card |
exp_month | Expiry month |
exp_year | Expiry year |
bin | First six digits of the card |
bank | Issuing bank |
channel | Payment channel, such as card |
signature | Stable identifier for the payment instrument |
reusable | Whether the authorization can be charged again |
country_code | ISO 3166-1 alpha-2 country code |
account_name | Name attached to the payment instrument when available |
Use webhooks or verification to confirm every recurring charge before fulfilment.