Skip to Content
FlowPayDocs

Read a payment and its attempts

GET
/v1/payments/{id}

A payment from another application is not found (404), like an identifier that does not exist: its existence is not revealed.

Authorization

ApiKeyBearer
headerAuthorizationBearer <sk_test_… | sk_live_…>

The application's API key. sk_test_…: sandbox, no money moves. sk_live_…: real.

Path Parameters

id*string

Payment identifier (UUID).

Formatuuid

Response Body

The payment, with the list of its attempts.

application/json
  1. response
id*string
Formatuuid
state*PaymentState
Value in"CREATED""AWAITING_CUSTOMER""PROCESSING""SUCCEEDED""FAILED""EXPIRED""CANCELED"
mode*string
Value in"LIVE""TEST"
merchant_reference*string
amount*string

Amount in major units, at the currency's exponent.

amount_minor*integer

The same amount in minor units.

Formatint64
currency*string
description?string|null
metadata*
networks*array<string>

Networks the payer can choose, in alphabetical order: those left after country and networks. Only one for a direct payment, the one the merchant chose.

network?|

The network of the latest attempt, the one the payer paid or tried to pay with; null until they have tried.

checkout_url*|

The payment page link, to give the payer. null for a direct payment, which skips the page: for a redirect network (Wave), the operator's link is redirect_url.

expires_at*string
Formatdate-time
succeeded_at?|
Formatdate-time
created_at*string
Formatdate-time
attempts?array<>|

Present when reading a payment and in the response of a direct payment (the opened attempt); null when creating a payment with a payment page, in the list and on cancellation.

next_action?string

Only present in a direct payment's response (network and msisdn at creation). REDIRECT: send the payer to redirect_url. NONE: nothing to do, the payer confirms on their phone; follow the payment with GET /v1/payments/{id} or the webhook.

Value in"NONE""REDIRECT"
redirect_url?|

Only present in the response of a direct payment. The operator's page, for REDIRECT.

Example Request
curl -X GET 'https://api.flowpay.example/api/v1/payments/{{paymentId}}'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "state": "CREATED",  "mode": "LIVE",  "merchant_reference": "string",  "amount": "5000",  "amount_minor": 5000,  "currency": "XOF",  "description": "string",  "metadata": {},  "networks": [    "BF_ORANGE"  ],  "network": "BF_ORANGE",  "checkout_url": "string",  "expires_at": "2019-08-24T14:15:22Z",  "succeeded_at": "2019-08-24T14:15:22Z",  "created_at": "2019-08-24T14:15:22Z",  "attempts": [    {      "attempt_no": 1,      "state": "CREATED",      "provider_key": "LIGDICASH",      "route_reason": "LOWEST_COST",      "route_cost_minor": 0,      "failure_class": "CUSTOMER_DECLINED",      "created_at": "2019-08-24T14:15:22Z",      "settled_at": "2019-08-24T14:15:22Z"    }  ],  "next_action": "NONE",  "redirect_url": "string"}