Expenses error codes
Every public API error code emitted by Expenses, with its HTTP status, its type and a page per code.
Error codes emitted by Expenses. Each code links to its own page with the cause and the action to take.
| Code | Type | HTTP | Description |
|---|---|---|---|
attachment_invalid_filename | invalid_request_error | 422 | The file name is not usable: it is empty, it carries path components, or it exceeds 200 characters. |
attachment_mime_not_allowed | invalid_request_error | 422 | The file type is outside the accepted set: PDF, PNG, JPEG, XML and HTML. |
attachment_missing | not_found_error | 404 | The expense exists but carries no attached file, so there is nothing to download. |
attachment_too_large | invalid_request_error | 422 | The file exceeds the maximum size allowed for a document attachment. |
cannot_attach_to_cancelled_purchase_invoice | invalid_request_error | 422 | The expense is cancelled, and attaching documents to a cancelled record would alter closed documentation. |
invalid_purchase_invoice_id | invalid_request_error | 400 | The expense reference received is not a valid identifier, usually because an internal value replaced the public id. |
invalid_purchase_invoice_number | invalid_request_error | 422 | The invoice number is empty or does not fit the accepted format. On a supplier invoice the number is the one the supplier printed, not one Factuarea generates. |
invalid_purchase_invoice_uuid | invalid_request_error | 400 | The expense identifier in the path or in the payload is not a valid UUID. |
operation_regime_invalid | invalid_request_error | 422 | The operation regime is outside the catalogue general, intracomunitaria, importacion_exportacion, isp. |
purchase_invoice_already_exists | conflict_error | 409 | That supplier already has an expense registered with the same number. The pair supplier plus number identifies the document uniquely and prevents recording an expense twice. |
purchase_invoice_not_deletable_in_current_state | invalid_request_error | 422 | Only draft and cancelled expenses can be deleted. A pending or paid one is part of the expense ledger. |
purchase_invoice_not_draft | invalid_request_error | 422 | The operation only applies while the expense is a draft, and this one has already been registered. |
purchase_invoice_not_editable_in_current_state | invalid_request_error | 422 | Only a draft expense can be edited. Once registered as pending, paid or cancelled, its content backs an accounting entry. |
purchase_invoice_not_found | not_found_error | 404 | The identifier does not resolve to any expense of the authenticated company. |
purchase_invoice_requires_at_least_one_line | invalid_request_error | 422 | The expense has no lines, so there is no amount nor deductible VAT to record. |
Related
Error codes by category
Find an error by the category that emits it.
Full reference table
All codes, HTTP statuses, types and descriptions in one reference.
Error model
Interpret the error envelope and handle errors by code.