Viewing Balances

API Documentation for Viewing Balances

This document provides detailed instructions for developers to view the balances for a specific merchant using the provided API.

Endpoint

  • URL: /api/merchants/{merchantId}/balances
  • Method: GET
  • Content-Type: application/json

Description

This API endpoint allows you to retrieve the balance details for a specific merchant.

Request URL

Replace {merchantId} with the actual merchant ID.

https://api.paylink.sa/api/merchants/{merchantId}/balances

HTTP Method

  • GET

Request Headers

  • Content-Type: application/json
  • X-API-KEY: your_api_key

Example curl Command

curl -X GET https://api.paylink.sa/api/merchants/{merchantId}/balances \
-H "Content-Type: application/json" \
-H "X-API-KEY: your_api_key"

Replace {merchantId} with the actual merchant ID and your_api_key with your actual API key in the headers.

Success Response

If the request is successful, you will receive a 200 OK status code with the following response body:

{
  "balance": 50000,
  "currency": "SAR"
}

Error Response

If there is an error in the request, you will receive a 400 Bad Request status code with an error message:

{
  "message": "Invalid request data"
}

By following these steps and using the provided documentation, you should be able to successfully view the balances for a specific merchant using the API.