Reseller WHMCS credit balance (APCu 60s cache)
GET/auth/balance
Returns the authenticated reseller's WHMCS credit balance. The balance is read FIRST from the read-only WHMCS DB replica (tblclients.credit); if the DB is unreachable it falls back to the WHMCS HTTP API (GetClientsDetails).
Cache: APCu 60 seconds (env: BALANCE_CACHE_TTL_SECONDS, 0 = bypass). The cached field in the response indicates a cache hit.
Currency: In Phase 1 a global BALANCE_DEFAULT_CURRENCY (default TRY). In Phase 2 per-client currency will come via a WHMCS tblcurrencies join.
Normalize: If the client is not found in WHMCS, credit=0.0 is returned (no 404 — a safer default for defensive programming on the integration side).
Responses
- 200
- 401
- 429
Balance returned
Response Headers
The per-minute limit defined for this key
Number of requests remaining in the current window
Unix epoch of the start of the next window (UTC seconds)
Authentication failed
Per-minute limit exceeded
Response Headers
Seconds to wait before retrying after a 429 (RFC 7231 §7.1.3)
The per-minute limit defined for this key
Unix epoch of the start of the next window (UTC seconds)