NyukiAIPayment

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