Errors

Errors

API errors use standard HTTP status codes. Application-level failures also carry a stable errorCode string so you can branch on the cause programmatically instead of parsing messages.

Response format

A failed request returns the matching HTTP status (400, 401, 404) with this body:

{
  "message": "Session expired",
  "errorCode": "SESSION_EXPIRED",
  "error": "Bad Request"
}

Branch on errorCode, not message. Messages are human-readable and may be reworded; errorCode values are stable.

Session

errorCodeHTTPWhen
SESSION_NOT_FOUND404The sid doesn't exist.
SESSION_EXPIRED400The session passed its TTL. Create a new session.
SESSION_NOT_OPEN400The session was cancelled and can no longer be used.

Withdrawals

A withdrawal is approved by your approval webhook (WITHDRAW_REQUEST). To decline one, return an error with a numeric code — it maps to the errorCode the widget surfaces to the user, all as HTTP 400:

Your numeric codeerrorCodeMeaning
1WITHDRAW_DECLINEDGeneric decline (also the default if no code is given).
2INSUFFICIENT_BALANCEUser lacks the balance for this amount.
3WITHDRAW_UNAVAILABLEWithdrawals temporarily unavailable.
4USER_NOT_ELIGIBLEUser not permitted to withdraw.
5DAILY_LIMIT_EXCEEDEDUser hit their daily limit.
6WITHDRAW_AMOUNT_TOO_LOWBelow your minimum.
7WITHDRAW_AMOUNT_TOO_HIGHAbove your maximum.
8ACCOUNT_VERIFICATION_REQUIREDUser must complete verification first.
9WITHDRAW_SUSPENDEDWithdrawals suspended for this user.

The API also returns one withdrawal error on its own, as HTTP 400:

errorCodeWhen
WITHDRAW_IN_PROGRESSA withdrawal for this session is already PENDING/PROCESSING. Wait for it to finish.

Transaction limits

errorCodeHTTPWhen
AMOUNT_BELOW_MINIMUM400Amount under the configured minimum for the operation.
AMOUNT_ABOVE_MAXIMUM400Amount over the configured maximum for the operation.

Authentication

HTTPWhen
401Missing or invalid Authorization: Bearer <OPERATOR_SECRET_KEY> on an operator endpoint.