Balance & Banks
Get Balance
Check your merchant wallet balance (available + pending) before creating a withdrawal
GET /v1/balance
Use this to check your own merchant's wallet balance before creating a withdrawal — so you can confirm there are enough funds to cover the payout.
Every money field on the wire is a string of baht with 2 decimals, e.g.
"100.50" — not a JSON number and not satang. Always parse it as a decimal on your side; never use float to do money math.Endpoint
- Method / Path:
GET /v1/balance - Auth: must go through S2S (API key + HMAC signature), the same as every other S2S endpoint — see Authentication.
- The system derives the merchant only from the API key used to sign — it accepts no parameter identifying a merchant. You always get your own balance (own balance only).
Response fields
| Field | Type | Description |
|---|---|---|
available | string (baht) | The amount actually usable — this is what you can withdraw. |
pending | string (baht) | The amount still held (in processing / not yet usable). Not withdrawable yet. |
currency | string | Currency — currently "THB". |
available and pending are baht strings, e.g. "15000.00". Before creating a withdrawal, verify that available is greater than or equal to (the amount to withdraw + the fee).Example request
cURL
curl -X GET 'https://api.unkpay.co/v1/balance' \
-H 'X-Api-Key: unk_live_xxxxxxxxxxxx' \
-H 'X-Timestamp: 1718790000' \
-H 'X-Signature: <hex hmac-sha256 over "GET\n/v1/balance\n1718790000\nsha256(empty)">'
Example response (200 OK)
{
"available": "15000.00",
"pending": "2500.50",
"currency": "THB"
}
Errors
| HTTP | Code | When |
|---|---|---|
| 401 | UNAUTHORIZED | Missing/invalid signature, API key, or timestamp — see Authentication. |
| 403 | IP_NOT_ALLOWED | The calling IP is not on your allowlist — see IP Allowlist. |
