Skip to main content

Errors

Waysdrop returns a consistent error envelope for HTTP exceptions (via the global exception filter).

Error envelope

All errors use this structure:
Field meanings
  • statusCode: HTTP status code
  • method: HTTP method
  • timestamp: ISO timestamp when the error was generated
  • path: request path without query string
  • url: full request URL (includes query string)
  • message: human-readable error message
  • environment: server environment label

API key auth errors

Missing API key

Status: 401 Unauthorized
Message: API key is required

Invalid API key format

API keys must match: wsp_(live|staging)_[a-f0-9]{64} Status: 401 Unauthorized
Message: Invalid API key format

Invalid or inactive API key

Status: 401 Unauthorized
Message: Invalid API key

Rate limits / quota

API quota exceeded

Status: 429 Too Many Requests
Message: API quota exceeded

Business errors

Insufficient balance

Returned when wallet debit fails (e.g., creating a delivery request). Status: 422 Unprocessable Entity
Message: Insufficient balance

Payment required

Returned when wallet debit fails for api usage Status: 402 Payment Required
Message: Insufficient wallet balance for API usage

Validation errors

Request validation errors are returned as 400 Bad Request and the message contains a semi-colon separated list.

Success responses

Most successful API responses use:
Some endpoints respond with 204 No Content (no JSON body).