Status: specification for Public API v1. Not live yet.
Error format
Every error has the same body:
{
"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
| Status | Meaning | Retry? |
|---|---|---|
| 200, 201 | Success | |
| 400 | Malformed request, missing Idempotency-Key, key in query string | No. Fix the request. |
| 401 | Authentication failed | No. Fix the key. |
| 403 | Authenticated but not allowed (scope, plan, account setting) | No |
| 404 | Not found, or it belongs to another account | No |
| 409 | Conflict with current state, or idempotency key reused with a different body | No |
| 422 | Valid JSON but a business rule failed | No. Fix the data. |
| 423 | The record is locked, for example a closed period | No |
| 429 | Rate limit or daily quota reached | Yes, after Retry-After |
| 500, 502, 504 | Problem on our side | Yes, with backoff |
| 503 | API or writes temporarily switched off | Yes, with backoff |
A resource that exists in another account returns 404, the same as one that does not exist.
Common error codes
| Code | Status | Meaning |
|---|---|---|
invalid_key, key_revoked, key_suspended, key_expired, ip_not_allowed, account_suspended | 401 | See Authentication |
key_in_query | 400 | The key was sent in the URL query string |
insufficient_scope | 403 | details.requiredScope names what is missing |
api_not_enabled | 403 | API access is off for the account or plan |
validation_failed | 400 | details.fields lists each field and problem |
idempotency_key_required | 400 | POST without Idempotency-Key, or a key shorter than 8 or longer than 100 characters |
idempotency_key_conflict | 409 | Same key, different request body |
idempotency_in_progress | 409 | The first request with this key is still running, or its outcome is unknown. Check whether the record exists before retrying |
company_required | 400 | Key covers all companies and X-Fininvo-Company is missing |
not_found | 404 | Unknown id |
totals_mismatch | 422 | Your totals differ from the server calculation |
run_snapshot_missing | 409 | Payroll: this processed run has no stored snapshot, so its figures are not served. Contact support |
company_currency_unknown | 422 | The company has no currency configured |
plan_limit_reached | 422 | A plan limit was hit, for example invoices per month |
rate_limited | 429 | Per-minute limit |
daily_quota_exceeded | 429 | Per-day quota |
writes_paused | 503 | Read-only mode. Reads still work. |
api_disabled | 503 | API temporarily off |
internal_error | 500 | Send us the requestId |
Rate limits
Two limits apply at the same time.
| Limit | Growth | Business | Enterprise | Counted per |
|---|---|---|---|---|
| Requests per minute | 30 | 120 | 600 | API key |
| Requests per day | 1,000 | 10,000 | 50,000 to 100,000 | Account and product |
| API keys | 2 | 10 | 25 | Account and product |
| Webhook endpoints | 1 | 5 | 20 | Account and product |
| Write access | No | Yes | Yes |
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:
| Header | Meaning |
|---|---|
X-RateLimit-Limit | Requests allowed in the current minute |
X-RateLimit-Remaining | Requests left in the current minute |
X-RateLimit-Reset | Unix time when the minute window resets |
Retry-After | On 429 only: seconds to wait |
What to do with each response
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"] --> CStaying under the limits
- Use webhooks instead of polling.
- Use
updatedSinceso each sync fetches only what changed. - Use
limit=100for bulk reads so you make fewer calls. - Spread scheduled jobs. Do not start everything at the top of the hour.
- On
429, wait forRetry-After. On5xx, 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 than408) is not remembered: fix it and retry with the same key. - Successful responses are remembered for 24 hours.
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.jsonRequest 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.
