Overview
Document cancellation is a way to correct submission errors that were noticed right away. Ideally cancellation is done even before the document is fully validated and recipient is notified. Therefore cancellation can be done only within limited time period since submission of the document on the eInvoicing system. This time limit is specific to document type and is returned by calling Get Document Type API and checking workflow parameters.
Cancelling period is configurable value, that is controlled by ETA & this is configured according to the law, please refer to the law for more information.
If cancellation time has passed, taxpayers can revert previously issued incorrect invoice trough submission of a credit note based on the previous invoice, for example.
Note! when you are logged in as intermediary, permissions that are granted by the taxpayer will be applied on your profile and this will control the functionalities that you'll be able to executed on behalf of the taxpayer you are representing.
ETA released regulations: https://www.incometax.gov.eg/law-altax.asp
Signature
API is REST based API that receives the document ID through the URL parameter and state to be changed in request body.
Signature:
PUT /api/v1.0/documents/state/{UUID}/state
Inputs
This API accepts standard eInvoicing API header parameters for authenticated call.
URL parameter | Type | Description | Value example |
---|---|---|---|
uuid | String | Unique ID of existing document | F9D425P6DS7D8IU |
Body of the request contains a single object that contains these fields:
Input parameter | Type | Description | Value example |
---|---|---|---|
status | String | Desired status for the document. Must be cancelled to cancel previously issued document. |
cancelled |
reason | String | Reason for cancelling the document. | Customer cancelled the order. Reasons to be used as follows “Wrong buyer details” or “Wrong invoice details” |
Outputs
Successful Response
On a successful submission API returns 200
status code.
Error Response
Error situations are reported back by this API through the standard error response.
Additional specialized error messages can be returned as a result of validation of state of the document and caller:
HTTP Status Code | Error Code | Description |
---|---|---|
400 | OperationPeriodOver | Returned when user is trying to cancel document when the limit of cancellation has already run out. |
400 | IncorrectState | Returned when caller is trying to cancel the document that might already be rejected or invalid. State transition in this case is not allowed. |
400 | ActiveReferencingDocuments | Returned when caller is trying to cancel the document that is being referenced by other documents, e.g., credit note referencing invoice. The action to take is to cancel first the referencing document and only then this one. |
400 | TryingToCancelFreezedDocument | Returned when caller is trying to cancel the document that is being marked as Freezed |
403 | Forbidden | Returned when valid taxpayer system is trying to perform operation on a document not issued by them. |
403 | Forbidden | Returned when caller of the endpoint is trying to perform operation on a document while caller profile has ‘B2B Deny ERP Cancellation/Rejection’ tag assigned to it by ETA Admin. |
Additional considerations
No additional considerations.