Charge a customer using tokenized card data
POST /v1/checkout/tokenized-card-payment
Headers
string
required
Bearer <access_token>string
required
Your account ID. Nomba credits the charge to this account.
Request body
string
required
The card token you stored from the webhook
object
required
Details of this charge
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
string
required
"00" when Nomba sent the charge to the bank. "400" when Nomba rejected the request before charging the card.string
required
Response description. Donβt use it to decide the outcome.
object
required
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.