Skip to content
UnknownPay
ไทย
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

FieldTypeDescription
availablestring (baht)The amount actually usable — this is what you can withdraw.
pendingstring (baht)The amount still held (in processing / not yet usable). Not withdrawable yet.
currencystringCurrency — 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

HTTPCodeWhen
401UNAUTHORIZEDMissing/invalid signature, API key, or timestamp — see Authentication.
403IP_NOT_ALLOWEDThe calling IP is not on your allowlist — see IP Allowlist.