Error Format
All errors return a structurederror object containing three fields:
| Field | Type | Description |
|---|---|---|
error.message | string | A human-readable description of what went wrong. Use this for logs and user-facing messages. |
error.type | string | A high-level category: bad_request, auth_error, not_found, conflict, too_many_requests, server_error. |
error.code | string | A stable, machine-readable identifier. Use this field for all programmatic error handling. |
Error Codes Reference
Below is a list of commonerror.code values you may encounter, organized by category.
Authentication — 401 Unauthorized
Authentication — 401 Unauthorized
Validation & routing — 400 Bad Request / 404 Not Found
Validation & routing — 400 Bad Request / 404 Not Found
These errors occur when request parameters are invalid or a referenced resource does not exist.
| Code | HTTP | Description |
|---|---|---|
invalid_starts_at | 400 | The starts_at parameter is not a valid ISO 8601 datetime. |
invalid_expires_at | 400 | The expires_at parameter is not a valid ISO 8601 datetime. |
invalid_credit_types | 400 | The credit_types array is empty or contains invalid strings. |
customer_not_found | 404 | The requested customer_id does not exist. |
Balance & deduction — 400 Bad Request
Balance & deduction — 400 Bad Request
These errors occur when a billing operation cannot be completed due to insufficient funds or an invalid operation sequence.
| Code | Description |
|---|---|
insufficient_balance | The customer does not have enough total available credits. |
insufficient_balance_in_selected_credit_types | The customer has enough credits overall, but not within the specific credit_types requested. |
no_consumable_freeze_records | You attempted to consume a transaction that was never frozen or cannot be found. |
freeze_records_already_consumed | The frozen credits for this transaction_id have already been consumed. |
no_unfreezable_records | You attempted to unfreeze a transaction that was never frozen, or has already been consumed or unfrozen. |
actual_amount_exceeds_frozen_amount | The amount passed to consume is greater than the amount originally frozen for this transaction. |
Concurrency & consistency — 409 Conflict / 500 Internal Server Error
Concurrency & consistency — 409 Conflict / 500 Internal Server Error
These errors indicate a conflict between two requests or an unexpected internal failure.
| Code | HTTP | Description |
|---|---|---|
transaction_conflict | 409 | The transaction_id was already used for a different customer. |
customer_scope_mismatch | 409 | An operation referenced a record belonging to a different customer. |
billing_account_not_found | 500 | An internal inconsistency where an expected billing account is missing. |
server_error | 500 | An unexpected internal error occurred on the Velobase servers. |