ErrorsSpecific
HTTP 400Specific
EXCHANGE_RATE_OVERRIDE_INVALID
The Tracken Accounts app shows a person this for it:
This rate cannot be used: a rate must be above zero, a euro document always has rate 1, a credit note uses the rate of the invoice it corrects, and a rate typed for a billing run is only for a currency the European Central Bank publishes no rate for.
Where it comes from
These 7 operations name it:
- POSTCreate a transactioncreateTransaction
- PATCHUpdate a transactionupdateTransaction
- POSTCreate a sales invoicecreateSalesInvoice
- POSTCreate a billing runcreateBillingRun
- POSTCreate a purchase invoicecreatePurchaseInvoice
- PATCHUpdate a purchase invoiceupdatePurchaseInvoice
- PUTReplace the opening statereplaceOpeningState
400The envelope
{
"error": {
"code": "EXCHANGE_RATE_OVERRIDE_INVALID",
"message": "…",
"request_id": "req_01JB4Z0K3Q7V8W9X0Y1Z2A3B4C",
"doc_url": "https://developers.tracken.ee/errors/EXCHANGE_RATE_OVERRIDE_INVALID"
}
}Switch on
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.Handle it
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, "EXCHANGE_RATE_OVERRIDE_INVALID")) throw error;
// error.code, error.details, error.context and error.requestId are typed
}Install the SDK with npm i @tracken/sdk (0.2.0, MIT, beta), Node.js 22 or later.