Sale Documents

Sale endpoints cover supplier-issued invoices and their related adjustment documents.

Sale invoice

Use:

POST {api_base_url}/sale/invoice_submission

for a normal invoice issued by the merchant to a buyer. Build the payload from the Payload reference.

Credit note

Use:

POST {api_base_url}/sale/credit_note_submission

when reducing the value of an original normal e-Invoice without a return of money, subject to the merchant's accounting decision and applicable LHDN rules.

The payload follows the common sale structure and must contain an originalInvoices array. At minimum, each entry requires the original AECloud invoice document number:

"originalInvoices": [
  {
    "originalInvoiceDocumentNo": "ORIGINAL-INV-0001"
  }
]

The original invoice must be available to AECloud so that its LHDN reference can be resolved.

Debit note

Use:

POST {api_base_url}/sale/debit_note_submission

when adding charges to an original normal e-Invoice. Include originalInvoices using the same structure and provide totals and item lines representing the debit adjustment.

Refund note

Use:

POST {api_base_url}/sale/refund_note_submission

when recording a return of money to the buyer. Include the original invoice reference and refund-specific totals and lines.

For the regulatory distinction among credit notes, debit notes, and refund notes, refer to the current MyInvois document types.

Original-document rules

  • A normal adjustment document must refer to a normal invoice, not a self-billed invoice.
  • Use the original document number exactly as stored in AECloud.
  • Do not issue an adjustment against a voided or cancelled source without confirming the intended accounting treatment.
  • Store the adjustment document's own sale_guid separately from the original invoice GUID.
  • Poll the status endpoint for the adjustment's document family.

Immediate and scheduled submission

Every sale submission endpoint first validates and stores the document. When preferred_submission_on is now and lhdnSubmission is yes, AECloud attempts immediate processing. Other valid modes are stored for later processing.

Your integration must not assume that a successful upload means a Valid document. Persist the returned GUID and reconcile status.