A Paystack authorization code is a token that represents a customer's saved payment method. It is created after the customer's first successful card payment. Paystack tokenizes the card details and returns an authorization_code string that you can use to charge the card again without the customer re-entering their information. Both the managed Subscriptions API and the manual charge_authorization endpoint use authorization codes under the hood.
Get weekly developer tips
Join 25,000+ developers. Practical guides, job tips, and new content — straight to your inbox.
No spam. Unsubscribe anytime.
Not every authorization can be used for recurring charges. The reusable field tells you which ones can.
Reusable (reusable: true): Card payments almost always produce reusable authorizations. You can call charge_authorization with these codes as many times as you need. The customer does not need to re-authenticate.
Non-reusable (reusable: false): Bank transfer and USSD payments typically produce non-reusable authorizations. These are one-time tokens. You cannot charge them again. They exist in the authorization object for record-keeping, but calling charge_authorization with them will fail.
This distinction matters because your application needs to handle both cases. If a customer's first payment was via bank transfer, you have their money but you do not have a reusable authorization. You cannot set up recurring billing for them until they make a card payment.
function canSetupRecurring(authorization) {
if (!authorization.reusable) {
console.log('This payment method cannot be used for recurring charges.');
console.log('Channel:', authorization.channel);
console.log('The customer needs to pay with a card to enable recurring billing.');
return false;
}
return true;
}
// When processing a successful payment
function handleSuccessfulPayment(transactionData) {
var auth = transactionData.authorization;
if (canSetupRecurring(auth)) {
// Safe to store for recurring billing
storeAuthorizationForRecurring(transactionData.customer.email, auth);
} else {
// Grant access for this payment only
// Prompt the customer to add a card for recurring billing
promptForCardPayment(transactionData.customer.email);
}
}
For a complete treatment of this topic, including mobile money and country-specific behavior, see reusable vs non-reusable authorizations.
An authorization code is not a card number, but it can be used to charge real money. Treat it with the same seriousness you would treat any payment credential.
What authorization codes can do
What authorization codes cannot do
Storage guidelines
For a complete guide on secure storage patterns, see storing authorization codes securely.
KES 2,999
The definitive guide to building payment systems with Paystack — from your first transaction to production-grade payment infrastructure across Africa. 9 modules, 47 lessons. Free preview available.
Start Paystack Course