Errors
The error format Vantage API uses (RFC 7807 problem details), what each HTTP status code means, and how to handle validation failures.
Error format
All error responses follow the RFC 7807 problem-detail format:
{
"type": "https://docs.tryterra.co/errors/not-found-error",
"title": "Resource Not Found",
"status": 404,
"detail": "resource not found",
"instance": "/api/v1/orders"
}type
A URI identifying the error category
title
Short human-readable summary
status
The HTTP status code, repeated in the body
detail
Human-readable explanation of this occurrence
instance
The request path that produced the error
Credential refusals
Most requests refused for their credentials get Content-Type: application/problem+json and a code, whatever the API version. A few, such as a scope that one operation checks for itself, keep the format above, so choose the schema by Content-Type.
{
"type": "about:blank",
"title": "unauthorized",
"instance": "/api/v1/orders?limit=10",
"detail": "The credential is missing, invalid, expired or revoked.",
"code": "unauthorized"
}code
Status
Meaning
unauthorized
401
The key or token is missing, invalid, expired or revoked
scope_missing
403
The token lacks the scope this operation needs
audience_restricted
403
The token is not granted for this dev-id
authorization_unavailable
503
The credential could not be checked; retry with backoff
The status is not repeated in the body.
Status codes
400
Malformed request: invalid JSON, missing required fields or query parameters (e.g. test_taker_id), invalid IDs or pagination parameters
401
Missing or invalid credentials - check your dev-id / API key and the auth scheme (Account setup)
403
Credentials are valid but the action is not allowed: suspended account, account without Vantage access, ordering a product disabled in your catalog or not sold in your environment's markets, or calling the simulate endpoint in production
404
Resource not found - includes orders that exist but do not belong to you
409
Conflict - e.g. activating a kit that is already activated
422
Semantically invalid - e.g. a simulate event that is not a valid transition from the current status
500
Something went wrong on Terra's side - retry with backoff, and contact support if it persists
503
An upstream supplier service is temporarily unavailable - retry with backoff
Payment and idempotency errors
402- the payment could not be authorized when creating an order. Nothing was created and nothing was charged; it is safe to retry (e.g. after the end user updates their payment details).409- anIdempotency-Keyyou already used was sent with a different request body. Generate a fresh key for a genuinely new order.
Validation errors on order creation
POST /api/v1/orders returns a problem-detail body extended with a per-field breakdown:
Surface invalid_fields[].message to fix the request; each entry names the offending field, the failed validation rule (tag), and the rejected value.
Handling errors well
Retry
5xxand503with exponential backoff; do not retry4xx(fix the request instead).Retry
POST /api/v1/orderssafely with anIdempotency-Keyheader. Send a unique key per order attempt (a UUID is fine); retrying with the same key and the same body returns the original result instead of creating a second order or charge. The same key with a different body returns409. Without the header, creation is not deduplicated - fall back to checkingGET /api/v1/ordersfor yourclient_order_reference_idbefore retrying (see Best practices).On
401/403, verify which environment you are calling: sandbox and production access are enabled separately (Account setup).
Last updated
Was this helpful?