Check your balance
You can check your current balance by sending Amanpay a request. This section provides you with instructions on how to build such a request.
| URL | https://gateway.amanpay.io |
| API endpoint | /merchants/balance |
| HTTP request method | POST |
| Request body format | JSON |
| Header | Value | Description |
|---|---|---|
| Content-Type | application/json | HTTP header indicating the media type of the resource sent in the request body. |
| Authorization | calculated | Signature string. For the information on how to generate the signature, see Signature generation and verification. |
Parameters of the request to check balance:
The following table contains the parameters that have to be used in requests to check balance.
| Parameter | Type | Required | Description |
|---|---|---|---|
merchant_id | integer | Required | Your unique merchant ID that you got from Amanpay when integrating. |
Here is an example of a request to check balance.
curl -X POST "https://gateway.amanpay.io/merchants/balance" \
-H "Content-Type: application/json" \
-H "Authorization: 59ba6924772fdaf77434a5b8e2ddb02405bc0b66c1ca92c8ce4f2b0eead123f1674acac2346fbcdcb3ae0afb9e021231a7a766f70326bc6907b3b099c51c4ce1" \
-d '{
"merchant_id": 1758378
}'
Upon receiving your request, Amanpay sends a response to your system. The response contains your current balance per currency.
Here is an example of the data from a response to the request to check balance.
{
"merchant_id": 1758378,
"balance": [
{
"currency": "BDT",
"amount": 7000
},
{
"currency": "PKR",
"amount": 5849.76
}
],
"result_code": "OK",
"result_message": "request processed"
}