This holds for every operation and for the answers no operation produces: a missing key, a rate
limit, a path that does not exist and a method a path does not support.
What a status means
A status means one thing, on every operation. It tells you what to do next before you read the code.Invalid requests
A path, query or body that does not fit the operation’s parameters answers400 with
VALIDATION_ERROR and issues. This is the answer to
GET /v2/beneficiaries?term=help&limit=51:
When
issues is there, message at the top says where the problem is: The path is invalid.,
The query is invalid. or The request body is invalid.
A parameter or body field the operation does not know is an error, not something the API ignores,
so a misspelled filter cannot silently return unfiltered results:
Without issues
Some requests are well formed and still wrong, because of what a value names. They answer 400
with VALIDATION_ERROR too. The body is code and message with no issues, and message is
the only place the reason is said.
Branch on
code, as for any error, and show message to the person who can fix the request.
Codes
On any operation
NOT_FOUND and ROUTE_NOT_FOUND are both 404 and mean different things: NOT_FOUND is a real
operation that found nothing for the id you sent, and ROUTE_NOT_FOUND is a path that is not an
operation.
Reading one thing
Lists
Requests with a body
Creating a config
Both name the entries at fault in
issues, each by its path in the body, such as
beneficiaries[1]. issues is absent when the refusal cannot be tied to an entry, which
happens while a change to a beneficiary is still being applied.
More than five beneficiaries, a weight that is not a positive whole number, a duplicate
beneficiary and an id that holds a control character are VALIDATION_ERROR with issues.
Beneficiaries that together would pay more than five receivers are VALIDATION_ERROR
without issues.
Campaign deposit addresses
Charity requests
Retrying
Retry429, 500 and 503, with the wait from Retry-After when it is there and backoff
otherwise. Do not retry 400, 401, 403, 404, 409 or 422 without changing the request:
the answer will be the same.
Creating a config is safe to repeat. For your project, the same beneficiaries and weights always
give the same config, so a retry after a timeout returns the config the first attempt created,
with 200 instead of 201.
Errors on v1
/api/v1 has its own body, and it keeps it:
error is the sentence and code the identifier. Its codes and some of its statuses differ from
the ones above (a missing key is 400 MISSING_API_KEY and a wrong one 403 INVALID_API_KEY), and
issues on a VALIDATION_ERROR is a list of raw validation details. The reference page of each
v1 operation lists what it can answer. Versions explains the two.