Skip to Content
FlowPayDocs

Payments

Create, read, list and cancel a payment.

Create

POST /v1/payments with the Idempotency-Key header (see Idempotency).

FieldDescription
merchant_referenceYour order reference, unique per application (128 characters max).
amountAmount in major units, strictly positive: 5000 or "15000". No more decimals than the currency allows (XOF: none).
currencyThree-letter code, for example XOF.
descriptionOptional, 500 characters max.
return_urlOptional http(s) address the customer comes back to after a redirect network. Without it, they come back to the FlowPay payment page, which shows the result. Required for a direct payment on a redirect network.
metadataOptional, your own fields. They are returned in webhooks.
countryOptional two-letter ISO code (BF): the payment page only offers that country's networks.
networksOptional list of networks (["BF_ORANGE", "BF_MOOV"]): the page only offers those. Empty or absent: no restriction.
network, msisdn, otpOptional: network makes the payment direct and opens the attempt in the same call. See Direct payment.

The response carries checkout_url, the link to give your customer. If you would rather keep the flow on your side, use direct payment.

Restricting the offered networks

country and networks combine: the page only offers networks that are available (in the currency and for the amount), in the country and in the list.

{
  "merchant_reference": "CMD-2026-0003",
  "amount": 5000,
  "currency": "XOF",
  "country": "BF",
  "networks": ["BF_ORANGE", "BF_MOOV"]
}

A listed network that is temporarily unavailable is simply left out: networks in the response gives the final list. If no network remains (for example country: "GH" with currency: "XOF"), the response is 422 no_network_available and nothing is created.

These two fields only apply to the payment page: they are ignored for a direct payment.

What a payment returns

FieldDescription
idThe payment identifier.
stateThe state, see below.
modeTEST (sk_test_… key) or LIVE.
merchant_referenceYour order reference.
amountAmount in major units, as a string: "5000".
amount_minorThe same amount in minor units, as an integer.
currencyFor example XOF.
description, metadataAs supplied at creation.
networksThe networks the customer can choose, in alphabetical order, after country and networks. Only one for a direct payment.
networkThe network of the latest attempt, the one the customer paid or tried to pay with; null until they have tried.
checkout_urlThe link to give your customer. null for a direct payment, which skips the page.
expires_atDeadline: if not paid by then, the payment becomes EXPIRED.
succeeded_atSettlement date, null until it succeeds.
created_atCreation date.
attemptsThe payment attempts, only when reading a payment (see below).

Dates are ISO-8601 UTC.

States

StateMeaning
CREATEDCreated, before it is opened to the customer. You will rarely see it.
AWAITING_CUSTOMERWaiting for the customer.
PROCESSINGThe customer approved, outcome pending.
SUCCEEDEDPaid.
FAILEDFinal failure.
EXPIREDThe deadline has passed.
CANCELEDCanceled.

SUCCEEDED, FAILED, EXPIRED and CANCELED are final: each sends a webhook.

Read

GET /v1/payments/{id} returns the payment and its attempts. Each attempt shows its number (attempt_no, 1 to 3), its state (state), the provider used (provider_key), its dates, and, if it failed, the failure class (failure_class, see Errors). Never the customer's number nor the provider's raw message.

A payment from another application is not found (404 intent_not_found).

List

GET /v1/payments returns the application's payments, most recent first.

ParameterDescription
stateKeep only this state, for example SUCCEEDED.
payment_link_idKeep only payments opened by this payment link.
referenceKeep only payments whose reference contains this text, case-insensitive (128 characters at most).
fromCreated from this instant, included: ISO 8601, for example 2026-11-03T00:00:00+00:00. Compute it in your time zone.
toCreated before this instant, excluded. Must come after from, otherwise 400 invalid_request.
pagePage number, from 0.
sizePage size: 20 by default, 100 at most.

The response is a page:

{
  "items": [],
  "page": 0,
  "size": 20,
  "total": 135,
  "total_pages": 7
}

Payments in the list do not carry attempts: read the payment to get them.

Cancel

POST /v1/payments/{id}/cancel. Only an AWAITING_CUSTOMER payment can be canceled: otherwise 409 not_cancelable. You receive a payment.canceled webhook.

On this page