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.

Payments and charges

A payment intent is the instruction to collect an amount. A charge is one attempt against one provider. A declined card followed by a successful mobile-money payment is two charges under one payment.

Creating

Amount, currency, country and method type are required. Everything else — a customer, a wallet, a reference, provider parameters — is optional and is frozen onto the payment at creation.

Confirming

Confirming routes the payment. Routing is deterministic — priority, then app scope, then specificity, then id — and an open circuit makes the router skip a provider rather than fail the payment, so a second viable route keeps you trading through an outage.

The next action

Switch on flowKind, never on the provider name. There are six values and there will only ever be six: a new provider maps onto an existing one rather than adding a seventh. That is what lets us enable a provider without you shipping anything.

flowKindWhat you render
DEVICE_PUSHThe customer gets a USSD or in-app prompt and enters their PIN. Nothing happens in the browser — most mobile money runs this way.
REDIRECTThe browser goes to the provider — a 3-D Secure challenge, a Wave page, a PayPal login — and comes back to your return URL.
OTP_CHALLENGEThe provider issues a code the customer reads out. You collect it and submit it to confirm the payment.
DIRECTThe instrument is already authorised — a tokenised card. It resolves on the first call.
QR_DISPLAYRender the code we return and the customer scans it with their wallet app. Useful in person and on desktop.
VOUCHER_INSTRUCTIONShow the customer where to send funds and the reference to quote. We match the inbound transfer and resolve the payment.
{
  "country": "CM",
  "currency": "XAF",
  "methods": [
    {
      "methodType": "MOBILE_MONEY",
      "flowKind": "DEVICE_PUSH",
      "minAmount": "100",
      "maxAmount": "5000000"
    },
    {
      "methodType": "CARD",
      "flowKind": "REDIRECT",
      "minAmount": "500",
      "maxAmount": null
    }
  ]
}

Payment status

Status only ever moves forward. A reversal is a new object — a refund — never a status rolled back, so the first terminal value you see is safe to act on.

statusMeaningFinal
REQUIRES_PAYMENT_METHODCreated without a method. Rare — most integrations name one at creation.No
REQUIRES_CONFIRMATIONReady to start. Nothing has been charged yet.No
REQUIRES_ACTIONWaiting on the customer to approve, redirect or enter a code.No
PROCESSINGRouted to a provider and under way.No
REQUIRES_CAPTUREAuthorised, awaiting an explicit capture.No
SUCCEEDEDThe funds are confirmed. Fulfil the order here.Yes
FAILEDTerminal failure, carrying a canonical failure code.Yes
CANCELEDCancelled by you or by the customer before it completed.Yes
EXPIREDThe customer never completed it in time. Not a decline.Yes

Charge status

You rarely need these, but they are what the timeline on a payment is made of, and the failure code lives on the charge rather than the payment.

statusMeaning
PENDINGSent to the provider; no outcome yet.
AUTHORIZEDFunds held but not captured.
SUCCEEDEDCaptured.
FAILEDDeclined, with a failure code.
CANCELEDThe authorisation was released without capture.
EXPIREDThe window elapsed with no answer.
REFUNDEDFully reversed by refunds.
PARTIALLY_REFUNDEDPartly reversed.
DISPUTEDA dispute is open on it — a buyer’s or a chargeback — and the amount is held. A decision returns it to SUCCEEDED.