Get Balance
This endpoint retrieves the current financial status of a merchant’s account. It provides real-time information on:
Collection Pool Balance – the total amount currently available in all collection pools.
Payout Pool Balance – the total amount currently available for payouts.
Today’s Total Collections – the sum of all collections received for the current day.
This API is useful for monitoring cash flow and ensuring transparency in both collections and payouts.
Endpoint
GET
https://api.payright.my/api/v1/merchant/balanceUsage Examples
curl -X GET "https://api.payright.my/api/v1/merchant/balance" \
-H "auth-token: eyJhbGciO...XZI3CLi_a0BeUOJMPUK00"import http.client
import urllib.parse
# Parse the URL
url = "https://api.payright.my/api/v1/merchant/balance"
parsed_url = urllib.parse.urlparse(url)
# Create HTTPS connection
conn = http.client.HTTPSConnection(parsed_url.hostname)
# Prepare headers
headers = {
"auth-token": "eyJhbGciO...XZI3CLi_a0BeUOJMPUK00" #Insert auth-token here
}
# Send GET request
conn.request("GET", parsed_url.path, headers=headers)
# Read response
response = conn.getresponse()
print("Status:", response.status)
print("Response body:", response.read().decode())
# Close connection
conn.close()require 'net/http'
require 'uri'
# Parse the URL
url = URI.parse("https://api.payright.my/api/v1/merchant/balance")
# Create HTTP request
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["auth-token"] = "eyJhbGciO...XZI3CLi_a0BeUOJMPUK00" #Insert auth-token here
# Execute request
response = http.request(request)
# Output result
puts "Status: #{response.code}"
puts "Response body: #{response.body}"Authentication
string header required
To authenticate requests, include an Authorization header with the value
Key
Value
auth-token
<Your Payright auth token>
Response
application/json
{
"status": "ok",
"code": 200,
"data": {
"collection_balance": 1031.0,
"payout_balance": 97419.1,
"total_transaction_today": 1020.0
},
"uuid": "408ed601-0cf9-4835-9bef-f734410741dc",
"message": null,
"error": null
}{
"status": "fail",
"code": 403,
"data": {
"host": "api.payright-sandbox.my"
},
"uuid": null,
"message": "INVALID_TOKEN",
"error": null
}Response Attributes
Last updated