List payments
GEThttps://api.transfapp.com/api/v1/optimus/payment/
List all payments for a specific organization using API keys.
Request
Query Parameters
financial_status strrequired
ordering stringrequired
Which field to use when ordering the results.
page integerrequired
A page number within the paginated result set.
reference strrequired
status strrequired
type strrequired
Responses
- 200
- application/json
- Schema
- Example (from schema)
- ExampleOfResponse
Schema
count integerrequired
next urinullablerequired
previous urinullablerequired
results object[]
{
"count": 123,
"next": "http://api.example.org/accounts/?page=4",
"previous": "http://api.example.org/accounts/?page=2",
"results": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"account_alias": "string",
"first_name": "string",
"last_name": "string",
"email": "string",
"type": "request-payment",
"amount": "string",
"reference": "string",
"processing_number": "string",
"mode": "mtn-benin",
"status": "completed",
"financial_status": "pending",
"completed": "2024-04-07T02:21:55.074Z",
"processing": "2024-04-07T02:21:55.074Z",
"failed": "2024-04-07T02:21:55.074Z",
"created": "2024-04-07T02:21:55.074Z",
"updated": "2024-04-07T02:21:55.074Z",
"webhook_url": "string",
"refunded": "2024-04-07T02:21:55.074Z",
"test": true,
"paid_organization": true
}
]
}
Example of response
{
"count": 123,
"next": "http://api.example.org/accounts/?page=4",
"previous": "http://api.example.org/accounts/?page=2",
"results": [
{
"id": "d0d0de46737c4fa08853082021344d84",
"account_alias": "67101010",
"amount": "1200.00",
"completed": null,
"created": "2022-09-04T13:45:23.856438Z",
"email": null,
"failed": null,
"financial_status": "pending",
"first_name": null,
"last_name": null,
"mode": "mtn-benin",
"processing": "2022-09-04T13:45:23.859105Z",
"processing_number": null,
"reference": "PYDNGZLTYW",
"refunded": null,
"status": "processing",
"test": false,
"type": "request-payment",
"updated": "2022-09-04T13:45:23.859211Z",
"webhook_url": "https://example.com"
}
]
}
Authorization: Authorization
name: Authorizationtype: apiKeyin: headerdescription: The Transfa API uses API key authentication for most of the endpoints except the API status endpoint. The API Key is passed in the **Authorization** header with the following format `Authorization: YOUR_API_KEY`. Here's an example of a request written in Python. The following request creates a payment of type `request-payment`. ```python import requests url = "https://api.transfapp.com/api/v1/optimus/payment/" payload = { "account_alias": "67101010", "type": "request-payment", "amount": 1200, "mode": "mtn-benin", "webhook_url": "https://ptsv2.com/t/xw7zq-16s57325355/post" } headers = { "Content-Type": "application/json", "Idempotency-Key": "433753a7ae9d44f4b95903bbe813553a", "Authorization": "ak_test:gAAAAABjEdslstkCdDE7ubYtwuq96ugXdyXmSC8Am3HMi2MWnGrg4iAOe3g8aqaud8PzrLExxejfqLsalcB_jApiXs_9-Kt_3EC9hMZ9zW0AJ3bhTzsw0-BQF4bYcIdqcTfJHlNDU5qk" } response = requests.request("POST", url, json=payload, headers=headers) print(response.text) ``` ## Types of API Keys There are two types of API keys: Testing API Keys and Production API Keys. A Testing API key starts with the prefix `ak_test` coming with a private key with a prefix `ps_test`. The private key is used to sign data send/received via the webhooks. For the production keys, the API key starts with the `ak_live` prefix and the private key with the `ps_live` prefix. > **Note** : The API keys are generated and directly shown to you when you create them. We do not store the keys following our security guidelines. Make sure to keep them safe for usage. In case of leaking, you can freely revoke the API keys on the dashboard.
- curl
- python
- go
- nodejs
- ruby
- csharp
- php
- java
- powershell
- CURL
curl -L -X GET 'https://api.transfapp.com/api/v1/optimus/payment/' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>'
ResponseClear