Charge a customer using tokenized card data
POST /v1/checkout/tokenized-card-payment
Headers
Request body
Sub-account (order.accountId) and split (order.splitRequest) settings aren’t applied to charges on a saved card yet. callbackUrl isn’t needed, because there’s no page to redirect the customer to.
Response body
"00" when Nomba sent the charge to the bank. "400" when Nomba rejected the request before charging the card.Read the response
An OTP is the only challenge you can complete on a saved-card charge. If the bank asks for a 3D Secure check instead, the charge fails. Ask the customer to make a new card-saving payment with that card.
Charge on a schedule
Nomba doesn’t schedule API charges. Your server decides when each customer is due. A common setup is a scheduled job, such as a cron job, that runs every day:- Find every customer whose payment is due today.
- Charge each one with a new
orderReference. - Record the result against the customer’s subscription.
otpRequired is true, notify the customer straight away with a link to a page where they can enter the code.
When a charge fails
Rejected by Nomba (code "400"). Nothing was sent to the bank. Common messages:
Declined by the bank (
code "00", data.status false). The bank’s reason is in data.message, for example Insufficient funds. or Your card has expired. Please use a different card. The exact wording depends on the bank and card network.
To retry safely:
- If you don’t know whether a charge went through (for example, your request timed out), send it again with the same
orderReference. Nomba never charges the sameorderReferencetwice. If the first request reached Nomba, the retry is rejected with “An order already exists with this order reference”. Verify thatorderReferenceto see the result. - If the bank declined the charge, don’t retry straight away. Wait, for example 24 hours, and stop after a few attempts. Use a new
orderReferencefor each new attempt. - Ask the customer for a new card if the charge keeps failing, or if the card has expired.
Next: Complete an OTP challenge
Finish a charge when the customer’s bank asks for an OTP.