Documentation
Take your first payment.
Everything below is the real contract: the routes, the statuses, the failure codes, and the rules a correct integration follows.
Your first call
const response = await fetch(
'https://secure.nyukiai.com/v1/payment_intents',
{
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.NYUKIAI_SECRET_KEY}`,
'Idempotency-Key': crypto.randomUUID(),
'Content-Type': 'application/json',
},
body: JSON.stringify({
amount: '500000', // minor units, as a string
currency: 'XAF',
country: 'CM', // decides the corridor and the route
methodType: 'MOBILE_MONEY',
reference: 'order-4471',
providerParams: { msisdn: '237699000000' },
}),
},
);
const intent = await response.json();
// REQUIRES_CONFIRMATION. Nothing has been charged yet — confirm to start it.
console.log(intent.id, intent.status);{
"id": "pi_01JAY2K5RQ9M3W7ZB8XF4TC6VD",
"object": "payment_intent",
"status": "REQUIRES_CONFIRMATION",
"amount": "500000",
"currency": "XAF",
"country": "CM",
"methodType": "MOBILE_MONEY",
"provider": null,
"flowKind": null,
"reference": "order-4471",
"description": null,
"nextAction": null,
"lastPaymentError": null,
"expiresAt": 1785869300000,
"created": 1785869000000,
"clientSecret": "pi_01JAY2K5RQ_secret_8f2a4cQ1wZ"
}- Base URL
- https://secure.nyukiai.com
- Send on every write
- Idempotency-Key
Everything else
Quickstart
Four steps from an empty project to a payment you can watch resolve.
Authentication
Every request carries a bearer token. Which token you use decides what it may do — and which environment it touches.
Hosted checkout
Send the customer to a NyukiAI page — or embed it in yours — that offers every method that can take the payment: mobile money, card, PayPal. No payment UI to build.
The payment flow
One instruction, one or more attempts. Understanding that split is most of what makes the rest of the API predictable.
Marketplace sellers
Take payments on behalf of the shops on your marketplace, keep a commission, and pay each one out from a wallet of their own.
Disputes and refunds
A buyer with a problem can say so without an account, and you decide what happens. A refund goes back to the number that paid.
Webhooks
Events are written to an outbox in the same database transaction as the change that caused them, then delivered with retries. That is what makes "we sent it" and "it happened" the same claim.
Failure codes
Every provider's own error vocabulary is mapped onto this list, so your retry logic is written once. Whether a code is worth retrying is part of the contract, not a guess.
Conventions
Five rules that hold everywhere in the API. Reading them once is cheaper than discovering the fourth one in production.
