Skip to main content
Skip to content
Fininvo

Developer docs

Errors and rate limits

The Fininvo API error format, status codes and error codes, per-minute and daily rate limits, idempotency keys and request ids.

On this page

Status: specification for Public API v1. Not live yet.

Error format

Every error has the same body:

JSON
{
  "error": {
    "code": "insufficient_scope",
    "message": "This key does not have the scope erp.invoices:write.",
    "requestId": "req_01JD90A7X2...",
    "details": { "requiredScope": "erp.invoices:write" }
  }
}

Branch on code, never on message. Messages are for people and can change.

Status codes

StatusMeaningRetry?
200, 201Success
400Malformed request, missing Idempotency-Key, key in query stringNo. Fix the request.
401Authentication failedNo. Fix the key.
403Authenticated but not allowed (scope, plan, account setting)No
404Not found, or it belongs to another accountNo
409Conflict with current state, or idempotency key reused with a different bodyNo
422Valid JSON but a business rule failedNo. Fix the data.
423The record is locked, for example a closed periodNo
429Rate limit or daily quota reachedYes, after Retry-After
500, 502, 504Problem on our sideYes, with backoff
503API or writes temporarily switched offYes, with backoff

A resource that exists in another account returns 404, the same as one that does not exist.

Common error codes

CodeStatusMeaning
invalid_key, key_revoked, key_suspended, key_expired, ip_not_allowed, account_suspended401See Authentication
key_in_query400The key was sent in the URL query string
insufficient_scope403details.requiredScope names what is missing
api_not_enabled403API access is off for the account or plan
validation_failed400details.fields lists each field and problem
idempotency_key_required400POST without Idempotency-Key, or a key shorter than 8 or longer than 100 characters
idempotency_key_conflict409Same key, different request body
idempotency_in_progress409The first request with this key is still running, or its outcome is unknown. Check whether the record exists before retrying
company_required400Key covers all companies and X-Fininvo-Company is missing
not_found404Unknown id
totals_mismatch422Your totals differ from the server calculation
run_snapshot_missing409Payroll: this processed run has no stored snapshot, so its figures are not served. Contact support
company_currency_unknown422The company has no currency configured
plan_limit_reached422A plan limit was hit, for example invoices per month
rate_limited429Per-minute limit
daily_quota_exceeded429Per-day quota
writes_paused503Read-only mode. Reads still work.
api_disabled503API temporarily off
internal_error500Send us the requestId

Rate limits

Two limits apply at the same time.

LimitGrowthBusinessEnterpriseCounted per
Requests per minute30120600API key
Requests per day1,00010,00050,000 to 100,000Account and product
API keys21025Account and product
Webhook endpoints1520Account and product
Write accessNoYesYes

These are the standard values and can change with your plan. The numbers that apply to you are always the ones on the pricing page, under Settings → Subscription, and in GET /me.

The daily quota resets at 00:00 UTC. Reaching a key or endpoint limit returns 422 plan_limit_reached. Asking for a write scope on a read-only plan returns 403 api_not_enabled.

Every response includes:

HeaderMeaning
X-RateLimit-LimitRequests allowed in the current minute
X-RateLimit-RemainingRequests left in the current minute
X-RateLimit-ResetUnix time when the minute window resets
Retry-AfterOn 429 only: seconds to wait

What to do with each response

Drawing diagram
flowchart TD
    C["Call"] --> S{"Status"}
    S -- "2xx" --> OK["Done"]
    S -- "4xx except 429" --> FIX["Do not retry. Fix it"]
    S -- "429" --> W["Wait Retry-After"] --> C
    S -- "5xx" --> B["Back off with jitter, limited retries"] --> C

Staying under the limits

  • Use webhooks instead of polling.
  • Use updatedSince so each sync fetches only what changed.
  • Use limit=100 for bulk reads so you make fewer calls.
  • Spread scheduled jobs. Do not start everything at the top of the hour.
  • On 429, wait for Retry-After. On 5xx, retry with exponential backoff and jitter (for example 1 s, 2 s, 4 s, 8 s, then give up and alert).

Idempotency

Networks fail. If a POST times out you cannot know whether it was applied. Idempotency keys make a retry safe.

  • Send Idempotency-Key: <unique value> on every POST. It is required.
  • The key is 8 to 100 printable ASCII characters, with no spaces. Anything else returns 400 idempotency_key_required.
  • Use a value tied to your own record, such as your order number, or a UUID you store before sending.
  • Repeating a request with the same key and the same body returns the original response and does not create a second record.
  • The same key with a different body returns 409 idempotency_key_conflict.
  • A retry that arrives while the first request is still running returns 409 idempotency_in_progress. The same answer comes back for up to 10 minutes when the first request ended with a server error or a timeout, because Fininvo cannot tell whether it was applied and never runs it twice. Check whether the record exists (for example list invoices by your reference) before sending again with a new key.
  • A request rejected with a 4xx (other than 408) is not remembered: fix it and retry with the same key.
  • Successful responses are remembered for 24 hours.
Shell
curl -X POST https://fininvo.com/api/v1/public/erp/invoices \
  -H "Authorization: Bearer $FININVO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: order-10458" \
  -d @invoice.json

Request ids

Every response carries X-Request-Id, and error bodies repeat it as requestId. Log it. It is the fastest way for support to find your request.