Skip to main content

POST /getBalance

Returns the current balance for a balance-based API key.

Request Body

{
  "clientKey": "FUN-your-api-key"
}

Parameters

FieldTypeRequiredDescription
clientKeystringYesYour API key

Response

Success (200)

{
  "errorId": 0,
  "balance": 12.50
}

Key Not Found (404)

{
  "errorId": 1,
  "errorCode": "ERROR_KEY_DOES_NOT_EXIST",
  "errorDescription": "Client key does not exist."
}

Database Unavailable (503)

{
  "errorId": 1,
  "errorCode": "ERROR_DATABASE_UNAVAILABLE",
  "errorDescription": "Database temporarily unavailable. Please try again."
}

Response Fields

FieldTypeDescription
errorIdinteger0 = success, 1 = error
balancenumberCurrent balance in USD
errorCodestringError code (only when errorId: 1)
errorDescriptionstringHuman-readable error message

Example

import requests

resp = requests.post("https://api.funbypass.com/getBalance", json={
    "clientKey": "FUN-your-api-key"
})

data = resp.json()
print(f"Balance: ${data['balance']}")
Balance reflects the most recent synced value. Pending deductions and refunds may take a moment to be reflected.