Voiding and Cancellation
Voiding and cancellation are different operations.
- Void stops an AECloud record before it becomes a valid or in-progress LHDN document.
- Cancellation asks LHDN to cancel a previously submitted document and records the result in AECloud.
Choose the operation from the current document status, not merely from the user's wording.
Void by sale GUID
curl --request POST "{api_base_url}/sale/invoice_void/by_sale_guid" \
--header "Authorization: Bearer {access_token}" \
--header "Content-Type: application/json" \
--data '{"SALE_GUID":"{sale_guid}"}'
Use the corresponding document-family path. A successful void marks the record Voided, disables LHDN submission, and locks the record.
Void is denied when the document is Valid, InProgress, already locked, or part of consolidated processing.
Void by business key
When the AECloud sale GUID is unavailable, use the matching document-family endpoint with all business-key fields:
{
"COMPANY_CODE": "{company_code}",
"OUTLET_NAME": "TEST OUTLET",
"TERMINAL_NAME": "POS-01",
"SHIFT_CODE": "SHIFT-001",
"SALE_CODE": "TEST-INV-20260826-0001"
}
Send this body to, for example:
POST {api_base_url}/sale/invoice_void/by_sale_code
All five properties are uppercase in this operation. Values must match the stored record.
Cancel a submitted document
curl --request POST "{api_base_url}/sale/invoice_cancellation" \
--header "Authorization: Bearer {access_token}" \
--header "Content-Type: application/json" \
--data '{"SALE_GUID":"{sale_guid}","REASON":"Wrong buyer details"}'
The AECloud endpoint currently accepts a reason of up to 200 characters. Give a specific business reason and never include secrets or unnecessary personal data.
The implementation does not allow cancellation of consolidated e-Invoices through these endpoints. Cancellation can also fail when the document is not in a cancellable state, the permitted time has passed, or another active document refers to it.
Current MyInvois guidance states that cancellation is permitted within 72 hours from the date and time a document becomes valid. Confirm the latest rule in the official Cancel Document documentation.
Decision sequence
- Retrieve the current AECloud status.
- If the record has not entered LHDN processing and is not locked, use void.
- If it is a validated, individually submitted document within the permitted period, use cancellation.
- If cancellation is no longer allowed, use the appropriate credit, debit, or refund-note business process rather than forcing a state change.
- Retrieve status again and store the outcome.
Do not automatically fall back from cancellation to void. The operations have different accounting and regulatory effects.