The Spanish version is the authoritative reference. View in Spanish
Invalidation of Folios
Through this event you can inform the Tax Authority that you did not use or will not use a folio or range of folios.
The parameters to send in the API are as follows:
| Invalidation of folios (request) | |||||
|---|---|---|---|---|---|
| Parameter | Parameter type | Data type | Description | Allowed values | Length |
| status | String | Numeric | Event code | 99 | 1-2 characters |
| stampNumber | Integer | Numeric | Stamp number | 8 characters | |
| estalishment | String | Alphanumeric | Establishment | Fill with leading zeros | 3 characters |
| dispatchPoint | String | Alphanumeric | Dispatch point | Fill with leading zeros | 3 characters |
| startNumberRange | String | Alphanumeric | Starting number of the document range | The maximum amount for invalidation is a range of up to 1000 DE numbers. Fill with leading zeros. | 7 characters |
| endNumberRange | String | Alphanumeric | Ending number of the document range | Fill with leading zeros | 7 characters |
| documentType | String | Numeric | Document type | 1: Electronic invoice 2: Electronic export invoice 3: Electronic import invoice 4: Electronic self-billed invoice 5: Electronic credit note 6: Electronic debit note 7: Electronic dispatch note 8: Electronic withholding receipt | 1-2 characters |
| reason | String | Alphanumeric | Reason for the event | 5-500 characters | |
| accountCode | String | Numeric | Issuer Tax ID |
Request example

Note: Remember that before using the method, you must authenticate within the Authorization tab.
For this method we use the body tab, x-ww-form-urlencoded section, in Postman.
- Select the method type. In this case, you must select POST.
- Enter the method URL.
- Enter the parameters shown in the table above with their corresponding values.
- Click Send.
Note: You can invalidate a maximum of one thousand numbers of the DE. Use zeros to complete the starting and ending numbers of the range.
Submission to the Tax Authority
If the event was generated successfully, it is sent to the Tax Authority for validation and acceptance.
Invalidation response
The API will respond to your request with one of the following codes:
| Invalidation response codes | ||
|---|---|---|
| Message | Code | Note |
| Invalid stamp number for the testing environment. | 4051 | In the testing environment, the use of a test stamp is required. |
| Stamp number does not correspond to the taxpayer. | 4052 | The stamp number does not correspond to the RUC of the electronic invoicing taxpayer. |
| Stamp number does not correspond to the generation method. | 4053 | The stamp number does not correspond to the generation method for the electronic invoice. |
| Invalid establishment code. | 4054 | The establishment code does not correspond to a stamp of the generation method for electronic invoicing. |
| The dispatch point code is invalid for the provided stamp. | 4055 | The dispatch point code does not correspond to a stamp authorized for the taxpayer. |
| Document type does not correspond to the stamp number. | 4060 | The document type does not correspond to the authorized stamp number. |
| There is a DTE in the provided range. | 4065 | For the requested range, a DTE exists in SIFEN. |
| There is an invalidated number in the requested range. | 4066 | Within the range requested for invalidation, there are DE numbers already invalidated in SIFEN |
| The number of items in the range is invalid. | 4067 | The maximum number of items in the range must be less than or equal to 1000 (GEI005 - GEI005 less than or equal to 1000) |
| Range ending number is invalid. | 4068 | The range ending number (GEI006) must be greater than the range starting number (GEI005) |
Response examples
If the result is successful, the API response is as follows:

If the submission result is not successful, the API will respond with the following error message:
