VALIDATION_ERROR
The request is well-formed but its values are not acceptable. details lists every problem at once, each with a JSON Pointer to the field (or ?name for a query parameter).
Typical cause
Money sent as a JSON number instead of a decimal string, a missing required field, an enum value the reference does not list, or a field the schema does not have.
Fix
- Fix the fields
detailspoints at. - Unknown fields and unknown enum values are refused here too, never ignored.
Where it comes from
Any operation can answer it (HTTP 400).
Related
{
"error": {
"code": "VALIDATION_ERROR",
"message": "…",
"details": [
{
"code": "REQUIRED",
"message": "Field required",
"pointer": "/data/date"
}
],
"request_id": "req_01JB4Z0K3Q7V8W9X0Y1Z2A3B4C",
"doc_url": "https://developers.tracken.ee/errors/VALIDATION_ERROR"
}
}code, never on message, which is developer-facing English and may change. Field problems are in details, each with a JSON Pointer; the figures for your own text are in context. Quote request_id when you contact support.tracken transactions create …
# exits 9 and prints the code, the message, each field problem and the request idimport { isApiError } from "@tracken/sdk";
try {
await tracken.transactions.create(…);
} catch (error) {
if (!isApiError(error, "VALIDATION_ERROR")) throw error;
// Fix the fields details points at.
}