Skip to main content

Error Codes

This page lists all error codes returned by the MagniFinance API.

Error Code Reference

ValueNameDescription
01AuthenticationErrorYour authentication values are incorrect. Check the email and token in the header.
02ValidationErrorThe 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)
04InvalidTaxIdIf the tax field (Example: NIF) is not valid or this field is not present in the request, this error will be returned.
06ElementDoesNotExistIn 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.
07TypeInvalidError 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"
10TaxExemptionDoesNotExistThis error is returned when a non-existent code is inserted when creating the document. To check the valid codes, access the Appendix.
11CurrencyDoesNotExistError returned when an invalid currency value is entered. Currency to be used additionally to EUR. (List with valid values: ISO 4217) Example value: "BRL"
14SaveFailedGeneric error which provides more details in ErrorHumanReadable and ValidationErrors.
18SerieDataNotMatchError 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"
19FailedToCreateNewProductUnitCheck if in "Lines", it has the Unit field (required) and is corresponding to its string(50) characteristics.
22InvalidPercentagePercentage fields should be between 1 and 100.
38PartnershipNotFoundError returned when trying to add a partner, the partnership user authentication is incorrect or permissions not configured correctly.
39DocumentDetailClientAndSupplierCantBeTheSameThis 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

FieldTypeDescription
Typeint0 = Success; 1 = Error
ErrorValueobjectContains Value (error code number) and Name (error code name)
ErrorHumanReadablestringText that explains the error found
ValidationErrorsarrayList of validation errors with details
IsErrorbooleanWhether the request failed or not
IsSuccessbooleanWhether the request succeeded or not

ValidationErrors Structure

When a ValidationError occurs, the ValidationErrors array contains objects with these fields:

FieldDescriptionExample
TypeIdentifies the error with a token"DocumentIsADuplicate"
FieldName of the field in which validation failed"DocumentDetailExternalId"
ValueValue which failed validation"6"
ElementNumberIdentifies index of the field in which validation failed"67204"
DetailDetailed error explanation"Duplicate Document"