Use the Tokenize Charge API to process a transaction using a saved card token. This enables secure and seamless repeat payments for returning customers without collecting card details again.
๐ Good to Know
To initiate a tokenize charge:
- Include your secret API key in the
api-key
header - Ensure the
cardToken
is obtained from the Save Card API
๐ ๏ธ Endpoint Details
Method | URL |
---|---|
POST | https://payment-api-service.transactpay.ai/payment/tokenize/charge |
Headers
api-key: YOUR_SECRET_API_KEY
Content-Type: application/json
๐ฆ Sample Payload
{
"customer": {
"firstname": "ideos",
"lastname": "pay",
"mobile": "+23481582333444",
"country": "NG",
"email": "[email protected]"
},
"order": {
"amount": 2,
"reference": "{{reference}}",
"description": "Pay",
"currency": "NGN"
},
"payment": {
"RedirectUrl": "https://www.hi.com"
},
"authorization": {
"cardToken": "TKNMDU4MzU4NzUwNTk0Mjg5NzQwMzgwNDA0NzQ1ODkz2173"
}
}
๐ Important Notes
Security TipNever expose your secret API key in frontend or public code repositories.
Reference Best PracticeAlways generate a unique
reference
per transaction to prevent duplicates and ensure proper tracking.
โ
Next Steps
- Get the card token using the Save Card API
- Initiate the charge using the token via this API
- Verify the result using the Verify Order API
{
"customer": {
"firstname": "ideos",
"lastname": "pay",
"mobile": "+23481582333444",
"country": "NG",
"email": "[email protected]"
},
"order": {
"amount": 2,
"reference": "{{reference}}",
"description": "Pay",
"currency": "NGN"
},
"payment": {
"RedirectUrl": "https://www.hi.com"
},
"authorization": {
"cardToken": "TKNMDU4MzU4NzUwNTk0Mjg5NzQwMzgwNDA0NzQ1ODkz2173"
}
}