Build
Errors
Every error has the same shape: a stable code to act on, and a message for your logs.
{ "error": { "code": "...", "message": "..." } }Codes
| Code | Status | What to do |
|---|---|---|
INVALID_CREDENTIALS | 401 | Unknown or revoked key, or the signature does not match. Check the string you sign. |
TIMESTAMP_OUT_OF_RANGE | 401 | Check your server clock. |
INVALID_NONCENONCE_REUSED | 401 | Use a fresh nonce for every request, including retries. |
IP_NOT_ALLOWED | 403 | The call came from a server address that is not registered for you. |
INVALID_SCOPEINVALID_REDIRECT_URIINVALID_STATEINVALID_CODE_CHALLENGE | 400 | Fix the link request. |
INVALID_GRANT | 400 | The code or refresh token is wrong, expired or already used. Start a new link. |
INVALID_TOKEN | 401 | Refresh the access token. |
LINK_REMOVEDLINK_EXPIRED | 401 | Show the account as not linked and offer to link again. |
SCOPE_NOT_GRANTED | 403 | The user did not allow that data for this link. |
LINK_PAUSED | 403 | The user's account is temporarily paused. Try again later. |
BALANCE_UNAVAILABLEHOLDINGS_UNAVAILABLEUNAVAILABLE | 503 | Try again shortly. Do not show a zero in the meantime. |
RATE_LIMITED | 429 | Slow down and retry later. |
After linking: what can change
Real users change things over time. Your app should handle each of these calmly.
| You receive | It means | Show the user |
|---|---|---|
401 LINK_REMOVED | The user removed your app in NEDApay, or closed their account. | Not linked. Offer Link NEDApay again. Delete their tokens. |
401 LINK_EXPIRED | 12 months have passed. | Ask them to link again. |
403 LINK_PAUSED | Their NEDApay account is temporarily paused. | Keep the last data, say it may be out of date, retry later. |
403 SCOPE_NOT_GRANTED | You asked for data this link does not include. | Hide that section. |
503 …_UNAVAILABLE | The data could not be read just now. | Keep the last data. Never show zero. |
400 INVALID_GRANT on refresh | The refresh token was used twice, so the link was ended for safety. | Ask them to link again. Check that you store each new refresh token. |