API documentation
Step 9 – Cancel a delivery note
Cancel a delivery note (9.1–9.3) or a quantity receipt note (10.1–10.2) at AADE without issuing a new one.
A delivery note or a quantity receipt note that was issued by mistake, or whose goods never moved, can be cancelled at AADE without issuing a new document. AADE gives the cancellation a MARK of its own and from then on considers the note cancelled.
This works only with provider: "flexy", and only for:
| Document | AADE method Flexy calls |
|---|---|
| 9.1, 9.2, 9.3 (delivery notes) | CancelDeliveryNote |
| 10.1, 10.2 (quantity receipt notes) | CancelReceivingNote |
Any other document cannot be cancelled this way.
Send the cancellation
The request has no body: Flexy sends AADE the note's MARK and the VAT number of the business that issued
it. Send it to the id you received when you issued the note:
curl -X POST https://provider-staging.flexy.gr/api/v1/documents/<id>/cancel/ \
-H "Authorization: Bearer <token>"
Once AADE cancels the note, the API answers with HTTP 200 and the whole document, as in
step 2:
{
"document": {
"id": "bf640041-d484-49a0-9145-e3d87f628f06",
"provider": "flexy",
"status": "failed",
"mydata_mark": 400001973416999,
"cancellation_mark": 400001973417043
// … the other fields of the document
}
}
| Field | Meaning |
|---|---|
cancellation_mark | The MARK AADE gave the cancellation. It is null only when AADE answered that the note was already cancelled (e.g. when you send the request again after a lost answer), without giving the MARK again. |
mydata_mark | The MARK of the cancelled note; it does not change. |
status | failed: the note no longer counts. |
If you send the cancellation of a note that is already cancelled, the API answers HTTP 200 with the
document as it stands, and AADE receives nothing.
Something is wrong
| HTTP | code | Cause | What to do |
|---|---|---|---|
400 | cancellation_not_supported | The document is not a 9.1–9.3 or 10.1–10.2, or it was not issued with provider: "flexy". | Nothing: only these documents are cancelled this way. |
400 | document_not_issued | AADE has not registered the note yet (it has no MARK), e.g. because AADE was not answering when it was issued (step 7). | Cancel it once it has a MARK. |
400 | aade_rejected | AADE refused the cancellation; detail carries its code and message. | Fix what detail mentions. |
403 | onboarding_not_approved | Your registration has not been approved yet. | Email us at [email protected]. |
404 | not_found | There is no document with this id in your account. | Check the id. |
503 | aade_retry_later | AADE cannot cancel the note yet: for a few seconds after a note is registered AADE does not find its MARK, or AADE did not answer, or another request is cancelling the same note at that moment. This request did not change the note. | Send the same request again after the seconds in the Retry-After header. |
For 401 errors see step 1.