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 TaxId Validation it means the country isn't supported (only PT is today). 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. Create Document accepts "T", "I", "S", "C", "D", "B", "P" and "Z", in upper case; Create Waybill accepts "W" and "Y". See the document types. 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. |
| 16 | NoPartnerFoundWithTaxId | IPPN: returned by GetPartnerAccessTokens when the partner isn't linked to your IPPN account with access granted. The error is the same whether the request is still pending, was rejected or revoked, or was never made; check the state in the web interface under Config → IPPN → Partnership Management. |
| 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". You can view your series in the platform under Settings → General → Document series. |
| 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. |
| 26 | NoClientFound | Returned by Get a Client (ClientGet) when there's no company with that tax id and country in your subscription. |
| 38 | PartnershipNotFound | IPPN: returned by AddPartner and GetPartnerAccessTokens when the token you sent isn't your IPPN account's token, or your IPPN account isn't set up correctly. It doesn't mean the partner is missing; for that, see NoPartnerFoundWithTaxId. |
| 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" |
| ElementNumber | Which element failed when the field repeats (for example the line number in Lines); 0 otherwise | 0 |
| Detail | Detailed error explanation | "Duplicate Document" |