Error Codes
This page lists all error codes returned by the MagniFinance API.
Error Code Reference
| Value | Name | Description |
|---|---|---|
| 01 | AuthenticationError | Your authentication values are incorrect. Check the email and token in the header. |
| 02 | ValidationError | The error is detailed in ValidationErrors. The validation error compiles validation errors in fields, such as: field not filled in, field invalid, field oversized. (It has a detail option to aid understanding) |
| 04 | InvalidTaxId | If the tax field (Example: NIF) is not valid or this field is not present in the request, this error will be returned. |
| 06 | ElementDoesNotExist | In the DocumentGet endpoint, for example, this error is returned when a non-existent DocumentId is inserted in the query. If you have just created the document, it is recommended that you wait about 10 seconds before performing the Get. |
| 07 | TypeInvalid | Error returned when an invalid type value is entered. Possible types are "T" for Fatura/Recibo, "I" for Fatura, "S" for Fatura Simplificada, "C" for credit note and "D" for Debit Note. Example value: "T" |
| 10 | TaxExemptionDoesNotExist | This error is returned when a non-existent code is inserted when creating the document. To check the valid codes, access the Appendix. |
| 11 | CurrencyDoesNotExist | Error returned when an invalid currency value is entered. Currency to be used additionally to EUR. (List with valid values: ISO 4217) Example value: "BRL" |
| 14 | SaveFailed | Generic error which provides more details in ErrorHumanReadable and ValidationErrors. |
| 18 | SerieDataNotMatch | Error returned when an invalid series value is entered. You can consult a list of series for each type of document following the path in the system: Settings -> General -> Document series. Example value: "FR" |
| 19 | FailedToCreateNewProductUnit | Check if in "Lines", it has the Unit field (required) and is corresponding to its string(50) characteristics. |
| 22 | InvalidPercentage | Percentage fields should be between 1 and 100. |
| 38 | PartnershipNotFound | Error returned when trying to add a partner, the partnership user authentication is incorrect or permissions not configured correctly. |
| 39 | DocumentDetailClientAndSupplierCantBeTheSame | This error occurs when the supplier is also the customer. Check the Customer NIF informed in the request. The customer cannot be the supplier. |
Error Response Format
When an error occurs, the API returns a response with the following structure:
{
"RequestId": "dc5983e0-a93c-4690-a2c4-4379978382fd",
"Object": null,
"Type": 1,
"ErrorValue": {
"Value": 6,
"Name": "ElementDoesNotExist"
},
"ErrorHumanReadable": null,
"ValidationErrors": null,
"IsSuccess": false,
"IsError": true
}
Response Fields
| Field | Type | Description |
|---|---|---|
| Type | int | 0 = Success; 1 = Error |
| ErrorValue | object | Contains Value (error code number) and Name (error code name) |
| ErrorHumanReadable | string | Text that explains the error found |
| ValidationErrors | array | List of validation errors with details |
| IsError | boolean | Whether the request failed or not |
| IsSuccess | boolean | Whether the request succeeded or not |
ValidationErrors Structure
When a ValidationError occurs, the ValidationErrors array contains objects with these fields:
| Field | Description | Example |
|---|---|---|
| Type | Identifies the error with a token | "DocumentIsADuplicate" |
| Field | Name of the field in which validation failed | "DocumentDetailExternalId" |
| Value | Value which failed validation | "6" |
| ElementNumber | Identifies index of the field in which validation failed | "67204" |
| Detail | Detailed error explanation | "Duplicate Document" |