Get balance
const url = 'https://api.roamex.com/v1/balance';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.roamex.com/v1/balance \ --header 'Authorization: Bearer <token>'Returns your current balance. This endpoint has its own rate limit of 100 calls a minute, so polling it does not use up the budget of the other endpoints. The request body is ignored.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”The balance.
object
object
Euro cents.
Example
{ "success": true, "balance": { "amount": 25000, "currency": "EUR", "formatted": "€250.00" }}Headers
Section titled “Headers”Calls allowed per minute for this endpoint group.
Calls left in the current minute.
When the current window ends, in Unix seconds.
AUTH_ERROR: the key is missing, malformed, unknown or revoked. The message says which, for example Missing Authorization header, Invalid Authorization header format. Use: Bearer <api_key>, Invalid API key format or Invalid API key.
object
object
Machine-readable. Branch on this.
A sentence for people. It can change.
Example
{ "success": false, "error": { "code": "AUTH_ERROR", "message": "Invalid API key" }}AUTH_ERROR: the account is suspended (Your account is suspended. Please contact support.) or rejected (Account is not approved for API access).
object
object
Machine-readable. Branch on this.
A sentence for people. It can change.
Example
{ "success": false}NOT_FOUND: the API is switched off on the platform. Every endpoint answers this before the key is checked, with the message This feature is not available.
object
object
Machine-readable. Branch on this.
A sentence for people. It can change.
Example
{ "success": false, "error": { "code": "NOT_FOUND", "message": "This feature is not available." }}PAYLOAD_TOO_LARGE: the Content-Length header is over 100 KB.
object
object
Machine-readable. Branch on this.
A sentence for people. It can change.
Example
{ "success": false}RATE_LIMITED: the account’s per-minute budget for this endpoint group is used up, or too many refused keys came from this IP address. Wait the Retry-After seconds.
object
object
Machine-readable. Branch on this.
A sentence for people. It can change.
Example
{ "success": false, "error": { "code": "RATE_LIMITED", "message": "Rate limit exceeded. Please wait 42 seconds before retrying." }}Headers
Section titled “Headers”Calls allowed per minute for this endpoint group.
Calls left in the current minute.
When the current window ends, in Unix seconds.
Seconds to wait before retrying.
INTERNAL_ERROR: an unexpected error on our side.AUTH_ERRORwith status 500: the key could not be checked because of an error on our side. Retry with backoff.
object
object
Machine-readable. Branch on this.
A sentence for people. It can change.
Example
{ "success": false}
