Payments
Create, read, list and cancel a payment.
Create
POST /v1/payments with the Idempotency-Key header (see Idempotency).
| Field | Description |
|---|---|
merchant_reference | Your order reference, unique per application (128 characters max). |
amount | Amount in major units, strictly positive: 5000 or "15000". No more decimals than the currency allows (XOF: none). |
currency | Three-letter code, for example XOF. |
description | Optional, 500 characters max. |
return_url | Optional 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. |
metadata | Optional, your own fields. They are returned in webhooks. |
country | Optional two-letter ISO code (BF): the payment page only offers that country's networks. |
networks | Optional list of networks (["BF_ORANGE", "BF_MOOV"]): the page only offers those. Empty or absent: no restriction. |
network, msisdn, otp | Optional: 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
| Field | Description |
|---|---|
id | The payment identifier. |
state | The state, see below. |
mode | TEST (sk_test_… key) or LIVE. |
merchant_reference | Your order reference. |
amount | Amount in major units, as a string: "5000". |
amount_minor | The same amount in minor units, as an integer. |
currency | For example XOF. |
description, metadata | As supplied at creation. |
networks | The networks the customer can choose, in alphabetical order, after country and networks. Only one for a direct payment. |
network | The network of the latest attempt, the one the customer paid or tried to pay with; null until they have tried. |
checkout_url | The link to give your customer. null for a direct payment, which skips the page. |
expires_at | Deadline: if not paid by then, the payment becomes EXPIRED. |
succeeded_at | Settlement date, null until it succeeds. |
created_at | Creation date. |
attempts | The payment attempts, only when reading a payment (see below). |
Dates are ISO-8601 UTC.
States
| State | Meaning |
|---|---|
CREATED | Created, before it is opened to the customer. You will rarely see it. |
AWAITING_CUSTOMER | Waiting for the customer. |
PROCESSING | The customer approved, outcome pending. |
SUCCEEDED | Paid. |
FAILED | Final failure. |
EXPIRED | The deadline has passed. |
CANCELED | Canceled. |
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.
| Parameter | Description |
|---|---|
state | Keep only this state, for example SUCCEEDED. |
payment_link_id | Keep only payments opened by this payment link. |
reference | Keep only payments whose reference contains this text, case-insensitive (128 characters at most). |
from | Created from this instant, included: ISO 8601, for example 2026-11-03T00:00:00+00:00. Compute it in your time zone. |
to | Created before this instant, excluded. Must come after from, otherwise 400 invalid_request. |
page | Page number, from 0. |
size | Page 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.