Lewati ke konten utama

Get Balance

Retrieve your merchant wallet balance.

Endpoint​

POST /api/disbursement/get-balance

Authentication​

RSA-SHA256 X-SIGNATURE header. See Authentication.

Request​

Headers​

HeaderRequiredDescription
X-SIGNATUREYesBase64-encoded RSA-SHA256 signature
Content-TypeYesapplication/json

Body​

FieldTypeRequiredDescription
clientIdstringYesYour legacy_client_id

Example​

PHP
$body = json_encode(['clientId' => 'TEST_CLIENT_001']);

$bodyHash = hash('sha256', $body);
$stringToSign = "TEST_CLIENT_001|TEST_SECRET_001|$bodyHash";
openssl_sign($stringToSign, $rawSig, $privateKey, OPENSSL_ALGO_SHA256);
$xSignature = base64_encode($rawSig);

$ch = curl_init('https://api.flypay.asia/api/disbursement/get-balance');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Content-Type: application/json',
'X-SIGNATURE: ' . $xSignature,
],
CURLOPT_POSTFIELDS => $body,
]);
$response = json_decode(curl_exec($ch), true);

Response​

HTTP 200 OK

{
"code": 200,
"message": "Success",
"data": {
"merchantName": "PT Example Merchant",
"availableBalance": "5000000.00",
"pendingBalance": "200000.00"
}
}

Fields​

FieldDescription
availableBalanceWallet balance as a decimal string (IDR, not minor units). "5000000.00" = IDR 5,000,000
pendingBalanceSum of pending wallet settlement allocations not yet released

Error Responses​

MessageDescription
Invalid Client IDclientId not found or merchant inactive
Your merchant is not allowed to access this API (settlement_type).Settlement type is not WALLET
Invalid X-SIGNATURESignature verification failed
Public Key is not setNo RSA public key uploaded for this merchant