List payments
Retrieving lists of payments can be done using the dedicated endpoint.
Request
Here is a sample of a request to that endpoint:
Please note the following parameters:
- Parameter
from
: identify the starting date of the range for wish to fetch payments, the value here is2023-01-01T00:00:00.000Z
- Parameter
to
: identify the ending date of the range for wish to fetch payments, the value here is2023-01-01T12:00:00.000Z
- Parameters
page
andperPage
: allow you to navigate in the result pages
In case of high traffic, it cannot be expected to retrieve all payments without using pagination.
Pagination
Pagination is available on that endpoint.
A header is provided in the response to identify the number of results., it’s the Content-Range
header and its content looks like 0-99/2453
.
In that particular case, the first 100 results are fetched on a 2453 total - there is 25 pages of 100 results available.
Don’t forget to use date filters too to avoid the number of results changing between two requests.
Response
Results are automatically ordered by the created date in a descending order.
Here is a sample of the response in JSON format:
[
{
"id": "pi_HVSUvR5OvvyZn4ozGonNs",
"createdAt": "2023-11-06T11:52:18.139Z",
"updatedAt": "2023-11-06T11:52:26.382Z",
"merchantId": "wP8PsNc3Je3Djp2FTiQTO",
"purchaseReference": "purchaseReference",
"customerReference": "customerReference",
"amount": 10,
"currency": "XOF",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpbnRlbnRJZCI6InBpX0hWU1V2UjVPdnZ5Wm40b3pHb25OcyIsIm1lcmNoYW50SWQiOiJ3UDhQc05jM0plM0RqcDJGVGlRVE8iLCJtb2RlIjoic2FuZGJveCIsImlhdCI6MTY5OTI3MTUzOH0.Bg2PIujWvtGIlH1jSPRndUiyBD8WBNRuWUQ242GHCZ8",
"status": "successful",
"payments": [
{
"id": "pay_vhmS6bGBsTCP08rXOAFZJ",
"intentId": "pi_HVSUvR5OvvyZn4ozGonNs",
"createdAt": "2023-11-06T11:52:18.891Z",
"updatedAt": "2023-11-06T11:52:26.402Z",
"amount": 10,
"currency": "XOF",
"status": "successful",
"method": "mobile_money",
"country": "CI",
"provider": "orange",
"number": "00000001",
"fees": []
}
],
"mode": "sandbox"
},
{
"id": "pi_-RSGf4F7vqyPxfv2fYGpp",
"createdAt": "2023-11-06T11:52:17.914Z",
"updatedAt": "2023-11-06T11:52:25.978Z",
"merchantId": "wP8PsNc3Je3Djp2FTiQTO",
"purchaseReference": "purchaseReference",
"customerReference": "customerReference",
"amount": 10,
"currency": "XOF",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpbnRlbnRJZCI6InBpXy1SU0dmNEY3dnF5UHhmdjJmWUdwcCIsIm1lcmNoYW50SWQiOiJ3UDhQc05jM0plM0RqcDJGVGlRVE8iLCJtb2RlIjoic2FuZGJveCIsImlhdCI6MTY5OTI3MTUzN30.4XX1HeDk_Be_sEvaBcqx6GfxBB2qrFJu7btHVUyLZII",
"status": "successful",
"payments": [
{
"id": "pay_uEBdIHJLwytg6phBvhg3d",
"intentId": "pi_-RSGf4F7vqyPxfv2fYGpp",
"createdAt": "2023-11-06T11:52:18.605Z",
"updatedAt": "2023-11-06T11:52:25.986Z",
"amount": 10,
"currency": "XOF",
"status": "successful",
"method": "mobile_money",
"country": "CI",
"provider": "orange",
"number": "00000001",
"fees": []
}
],
"mode": "sandbox"
},
{
"id": "pi_UcRWisVdLCCw2Bq5S7XRl",
"createdAt": "2023-11-06T11:52:17.677Z",
"updatedAt": "2023-11-06T11:52:25.665Z",
"merchantId": "wP8PsNc3Je3Djp2FTiQTO",
"purchaseReference": "purchaseReference",
"customerReference": "customerReference",
"amount": 10,
"currency": "XOF",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpbnRlbnRJZCI6InBpX1VjUldpc1ZkTENDdzJCcTVTN1hSbCIsIm1lcmNoYW50SWQiOiJ3UDhQc05jM0plM0RqcDJGVGlRVE8iLCJtb2RlIjoic2FuZGJveCIsImlhdCI6MTY5OTI3MTUzN30.zOPnbV8pRL0LVWPtU_m2bdW5-KIKBkTfffGbiEOvhKY",
"status": "successful",
"payments": [
{
"id": "pay_GdhjiFTsMcT4aeXrmK6xJ",
"intentId": "pi_UcRWisVdLCCw2Bq5S7XRl",
"createdAt": "2023-11-06T11:52:18.352Z",
"updatedAt": "2023-11-06T11:52:25.668Z",
"amount": 10,
"currency": "XOF",
"status": "successful",
"method": "mobile_money",
"country": "CI",
"provider": "orange",
"number": "00000001",
"fees": []
}
],
"mode": "sandbox"
}
]