Purchase Invoices error codes
Every public API error code emitted by Purchase Invoices, with its HTTP status, its type and a page per code.
Error codes emitted by Purchase Invoices. 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 purchase invoice 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 invoice is cancelled, and attaching documents to a cancelled record would alter closed documentation. |
invalid_purchase_invoice_id | invalid_request_error | 400 | The purchase invoice 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 purchase invoice the number is the one the supplier printed, not one Factuarea generates. |
invalid_purchase_invoice_uuid | invalid_request_error | 400 | The purchase invoice 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 a purchase invoice 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 purchase invoices 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 purchase invoice is a draft, and this one has already been registered. |
purchase_invoice_not_editable_in_current_state | invalid_request_error | 422 | Only a draft purchase invoice 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 purchase invoice of the authenticated company. |
purchase_invoice_requires_at_least_one_line | invalid_request_error | 422 | The purchase invoice has no lines, so there is no expense nor deductible VAT to record. |