API Errors

HTTP status codes, error formats, and how to handle failures in the ReBattery Supplier API.

Updated 23 June 2026

Introduction

The ReBattery API uses standard HTTP status codes. Error responses include a JSON body with details. Some errors are retryable; others indicate a problem with the request.

Error Format

All error responses follow this shape:

json
{
  "error": "Short error description"
}

Validation errors (422) also include field_errors:

json
{
  "error": "Validation failed",
  "field_errors": [
    "manufacturer is required"
  ]
}

Status Code Reference

StatusErrorWhen it happensWhat to do
400Invalid JSON bodyMalformed JSON in the request bodyFix the JSON syntax and retry
401Invalid or missing API keyNo Authorization header, wrong scheme, or invalid/revoked keyCheck your API key and ensure the Authorization: Bearer <token> header is present
403API key lacks required scopeThe key does not have listings:write scopeCreate a new API key with the correct scope in Settings
409Idempotency-Key reuse with different bodySame Idempotency-Key header sent with a different request bodyUse a fresh idempotency key or send the exact same body
413Request body too largeBody exceeds 40 MBReduce request size, especially base64 image payloads
422Validation failedOne or more fields are invalid or missingReview field_errors and correct the request
425Request with this Idempotency-Key is still processingA previous request with the same idempotency key is still in flightWait briefly and retry with the same key
429Rate limit exceededMore than 100 requests in 60 seconds for this keyWait for the Retry-After interval and retry with exponential backoff
500Internal server errorUnexpected server errorRetry with exponential backoff. Contact support if persistent.
500Failed to create listingThe listing could not be created after validationRetry with exponential backoff. Contact support if persistent.

Retry Guidance

  • Retryable: 429, 500, 425 (wait then retry with same key)
  • Not retryable without changes: 400, 401, 403, 409, 413, 422
  • Recommended: exponential backoff starting at 1 second, up to 5 retries

[!TIP] Always respect the Retry-After header on 429 responses rather than guessing a delay. If the header is absent, fall back to exponential backoff.

Rate Limit Headers

On 429 responses, these headers are included:

  • Retry-After: seconds until the limit resets
  • X-RateLimit-Limit: 100
  • X-RateLimit-Remaining: 0
  • X-RateLimit-Reset: Unix timestamp of reset

Idempotency Conflicts

A 409 response means you reused an idempotency key with a different request body. A 425 response means the original request with that key is still processing. Both behaviours protect against duplicate listings.

[!NOTE] Use UUIDs or composite keys (e.g., <your-internal-id>-<timestamp>) to avoid collisions.