Errors
Every error has the same shape:error.code, not on the message. Messages may be reworded at any time. Each endpoint
page lists the errors it can return.
Request IDs
Responses include anX-Request-Id header, and every error includes the same ID as request_id. Log it,
and include it when you contact support so we can find your request. You can also send your own
X-Request-Id to connect Watchdog’s logs with yours.
Rate limits
Each API key can make 120 requests per minute to the current API and 500 requests per minute to the new API. Above that, the API answers429 Too Many Requests with a
Retry-After header. Wait that many seconds before you try again.
When to retry
400,401,403,404,409: fix the request first. Retrying the same request gives the same answer.429: wait forRetry-After, then retry.5xxand network errors: retry with increasing waits between attempts, and give up after a few tries.
If an upload times out, it may still have worked. In the current API, uploading the same file
again answers
409 with the ID of the invoice that already exists, so you can safely try again
and use that ID.