Skip to main content

Cek Saldo

Endpoint untuk mengecek saldo akun Anda secara real-time.

Endpoint: POST /v1/balance

info

Endpoint ini tidak memiliki parameter bisnis tambahan. canonicalBody untuk signature menggunakan string kosong "".

Parameter Request

ParameterTipeWajibKeterangan
api_idstringAPI ID dari pengaturan akun
timestampintegerUnix timestamp saat request dikirim
signaturestringHMAC-SHA256 — lihat cara membuat signature

Contoh Request

<?php
$api_id = 'your_api_id';
$api_key = 'your_api_key';
$secret_key = 'your_secret_key';
$timestamp = time();

// Tidak ada business params → canonicalBody = string kosong
$bodyHash = hash('sha256', '');
$stringToSign = implode('|', [$api_id, $api_key, $timestamp, $bodyHash]);
$signature = hash_hmac('sha256', $stringToSign, $secret_key);

$payload = [
'api_id' => $api_id,
'timestamp' => $timestamp,
'signature' => $signature,
];

$ch = curl_init('https://api.isikuota.com/v1/balance');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => json_encode($payload),
]);
$response = json_decode(curl_exec($ch), true);
curl_close($ch);

Contoh Response

{
"success": true,
"code": "SUCCESS",
"message": "Saldo berhasil didapatkan",
"data": {
"name": "John Doe",
"balance": 25490,
"currency": "IDR",
"checked_at": "2026-05-31 10:21:58"
},
"errors": null,
"meta": null
}

Field Response

FieldTipeKeterangan
namestringNama akun
balanceintegerSaldo saat ini dalam rupiah (IDR)
currencystringMata uang — selalu IDR
checked_atstringWaktu pengecekan saldo
Best Practice
  • Cek saldo sebelum transaksi untuk menghindari gagal karena saldo kurang
  • Implementasikan notifikasi otomatis jika saldo di bawah threshold tertentu
  • Cache response beberapa detik untuk mengurangi jumlah API call