API DOCUMENTATION

Errors

One envelope everywhere: a sentence, a code, a request id.

{
  "error": "The request body has problems.",
  "code": "VALIDATION_FAILED",
  "requestId": "a36bda957b8a7631-YVR",
  "docs_url": "https://docs.taxpio.com/errors#validation-failed",
  "problems": [{ "field": "inputs.taxableTotalProfitsPence", "message": "taxableTotalProfitsPence must be a whole number of at least 0." }]
}

Branch on code, show error to a person, log requestId. Validation failures list every problem with the field that carries it. A code the route names is kept; otherwise the code is the one for the status.

CodeStatusMeaning
BAD_REQUEST400As the status says.
UNAUTHENTICATED401As the status says.
PAYMENT_REQUIRED402As the status says.
FORBIDDEN403As the status says.
NOT_FOUND404No such resource in this environment.
METHOD_NOT_ALLOWED405As the status says.
NOT_ACCEPTABLE406As the status says.
REQUEST_TIMEOUT408As the status says.
CONFLICT409The request conflicts with the current state (the message says how).
GONE410As the status says.
PAYLOAD_TOO_LARGE413The body exceeds the limit.
UNSUPPORTED_MEDIA_TYPE415Send application/json.
VALIDATION_FAILED422One or more fields are wrong; problems lists them.
LOCKED423As the status says.
PRECONDITION_REQUIRED428As the status says.
RATE_LIMITED429Over the per-minute limit; retry-after says when.
INTERNAL500Something failed on our side; quote the request id.
NOT_IMPLEMENTED501As the status says.
UNAVAILABLE503As the status says.
TIMEOUT504As the status says.
ORIGIN_REQUIRED403A browser mutation from another origin (product routes only).
PASSKEY_REQUIRED403As the status says.
PASSKEY_ENROLLMENT_REQUIRED428As the status says.
RECENT_MFA_REQUIRED428As the status says.
RECENT_AUTHENTICATION_REQUIRED403As the status says.
ACCOUNT_PASSWORD_REQUIRED428As the status says.
EMAIL_VERIFICATION_REQUIRED403As the status says.
VERIFICATION_DELIVERY_FAILED503As the status says.
RESOURCE_ROUTE_UNAVAILABLE503As the status says.
MALWARE_DETECTED422As the status says.
NONDETERMINISTIC_PROVIDER_RETRY503As the status says.
CREDITS_REQUIRED402A live operation needs more credits than the workspace holds.
API_KEY_MISSING401No bearer token was sent.
API_KEY_INVALID401The token is not a key TaxPio issued.
API_KEY_REVOKED401The key was revoked; mint a new one.
API_KEY_EXPIRED401The key passed its expiry.
WORKSPACE_SUSPENDED403The workspace is not active.
APPLICATION_ARCHIVED403The application was archived; its keys no longer act.
SCOPE_REQUIRED403The key lacks the scope the operation needs (required_scope says which).
PRODUCTION_REVIEW_REQUIRED403A live key was used before production review approved the workspace.
IDEMPOTENCY_KEY_INVALID400Idempotency-Key is not 8 to 128 characters of letters, digits, _ - . :.
IDEMPOTENCY_KEY_REUSED409The same key was sent with a different body.
IDEMPOTENCY_KEY_IN_PROGRESS409The first request with this key is still running.
BODY_INVALID400The body is not valid JSON.
UNSUPPORTED_PROGRAM422The jurisdiction, program or tax year is not offered (the message says what is).
SANDBOX_ONLY403Sandbox tooling was called with a live key.
CONNECTION_PENDING409As the status says.
CONNECTION_REVOKED409As the status says.
CONNECTION_PERMISSION_REQUIRED403As the status says.
LIVE_ONLY403A government-facing operation was called with a sandbox key.
WEBHOOK_SIGNATURE_INVALID401The sink could not verify the delivery's signature.