Skip to main content

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

Balance returned

Response Headers
    X-RateLimit-Limit

    The per-minute limit defined for this key

    X-RateLimit-Remaining

    Number of requests remaining in the current window

    X-RateLimit-Reset

    Unix epoch of the start of the next window (UTC seconds)