View Account Balance
The View Account Balance API is designed to retrieve the current balance of the account for a business unit of a supplier organization.
warning
It is important to handle account data securely and ensure that access is restricted to authorized users only.
API Endpoint
Method: GET
URL: https://<PA_RM_END_POINT>/retail-media/supplier/{supplierId}/view-balance
Request Header
Name | Value |
---|---|
Content-Type | application/json |
Authorization | Bearer ACCESS_TOKEN |
info
Please refer to the Authentication API documentation for bearer token.
Path Parameters
Parameter | Type | Description |
---|---|---|
supplierId | string | Get the supplier ID from the supplier API |
info
Please refer to the Supplier API documentation for detailed instructions on how to retrieve the supplierId
.
Response Payload
Success Response
- Status Code:
200 OK
- Payload: Returns account information of the supplier with balance in JSON format
{
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"ownerId": "00000000-0000-0000-0000-000000000000",
"credits": 1000.00,
"spent": 250.50,
"balance": 749.50
},
"message": "Data retrieved successfully.",
"status": "Success"
}
Response Parameters
Parameter | Type | Description |
---|---|---|
id | GUID | System generted account ID for the supplier in PA system. |
ownerId | GUID | Supplier ID who own the account. |
credits | decimal | Total amount that has been added. |
spent | decimal | Total amount that has been spent. |
balance | decimal | Available balance for the account |
Error Response
If an error occurs, the API will return an appropriate status code along with an error message.
- Sample Error Response:
{
"status": "Error"
"errorCode": 401,
"errors": ["error message 1", "error message 2"],
"message": "Details error message",
"metadata": {
"requestId": "3d65d860-5acd-4663-b14d-c0bb55317660",
"timeStamp": "2025-04-28T00:00:00.000Z"
},
}
Example Usage (JavaScript)
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "BEARER YOUR_ACCESS_TOKEN");
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect:'follow'
};
fetch("https://<PA_RM_END_POINT>/retail-media/supplier/{supplierId}/view-balance", requestOptions)
.then(response => response.json())
.then(result=> {
console.log(result);
})
.catch(error => console.log('error', error));