Tokenize a customer's card during their first payment so you can charge them again in the future (subscriptions, renewals, or one-click payments) without requiring them to re-enter their card details.

Card Tokenization allows you to debit a customer's card automatically on future transactions, without requiring any input from the customer. After the customer completes their first card payment with tokenization enabled, Monnify generates a secure token representing their card. You store this token and use it to charge them on subsequent payments.
cardToken from the cardDetails object.cardToken securely on your server, linked to the customer's account and email address.cardToken to the Charge Card Token API with no checkout UI required.Card tokenization must be activated on your integration before use. Contact [email protected] to enable this feature on your account.
If card tokenization is enabled on your merchant account, Monnify automatically returns a card token after any successful card payment — no additional parameter is needed in your SDK call.
Initialize a standard card payment. The token is returned automatically if tokenization is enabled on your account.
Initialize a standard card payment. The token is returned automatically if tokenization is enabled on your account.
Initialize a standard card payment. The token is returned automatically if tokenization is enabled on your account.
After the first payment completes, call the Get Transaction Status API using the transaction's transactionReference or paymentReference. The cardDetails object in the response contains the cardToken.
In the sandbox environment, Monnify does not return a real cardToken. Instead, check the supportsTokenization field in reusable: true means the card would produce a token in production, and false means it would not.
Once you have the cardToken, store it securely on your server alongside the customer's email address used for the original transaction. Both the token and the email must match on every subsequent charge, as Monnify validates this pair.
Use the stored cardToken to charge the customer for future payments. This call happens entirely server-to-server, with no checkout UI required.
| Error Message | Meaning | Action |
|---|---|---|
| Card token has expired. | The supplied token has expired. | Ask the customer to complete a new card payment with tokenization enabled to generate a fresh token. |
| Invalid card token | The token supplied in the request does not exist or is malformed. | Verify that the token stored in your database matches what was returned from the Get Transaction Status API. |
| Duplicate payment reference | The paymentReference used in the init-transaction request was already used in the same environment. | Generate a unique reference for every new transaction. |
Rate this page
How helpful is the content on this page?