Charge a Tokenized Card
Recurring or subscription payments can be processed using the tokenKey generated when a customerβs card was tokenized during checkout.
This allows you to charge the customer securely without asking for card details again.
Only include tokenizeCard: true when creating a checkout order if you intend to use the customerβs card for future payments. The returned tokenKey from the webhook will then be required for recurring charges.
To charge a tokenize card, send a POST request to this endpoint /v1/checkout/tokenized-card-payment.
curl --request POST \
--url https://api.nomba.com/v1/checkout/tokenized-card-payment \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'accountId: <accountid>' \
--data '{
"order": {
"orderReference": "90e81e8a-bc14-4ebf-89c0-57da752cca58",
"customerId": "762878332454",
"callbackUrl": "https://ip:port/merchant.com/callback",
"customerEmail": "[email protected]",
"amount": "10000.00",
"currency": "NGN",
"accountId": "01a10aeb-d989-460a-bbde-9842f2b4320f",
"splitRequest": {
"splitType": "PERCENTAGE",
"splitList": [
{
"accountId": "01a10aeb-d989-460a-bbde-9842f2b4320f",
"value": "65.45"
}
]
}
},
"tokenKey": "7628788443"
}'
Always verify the transaction after charging a tokenized card. You can use webhooks for instant notifications, but it is best practice to confirm the status via the Verify Transactions endpoint before providing value to your customers.