Cancel Malaysia E-Invoice

View as Markdown
# Cancel Malaysia E-Invoice Cancel a previously submitted Malaysia e-invoice document on LHDN MyInvois. You can cancel by sending either: - `docId` (Staple document ID), or - `uuid` (MyInvois document UUID) > Important: > Cancellation is subject to MyInvois/LHDN rules, such as allowed time window and document state. > If cancellation is not allowed, clients should issue a Credit Note instead. * * * ## Endpoint **POST** `/v2/einvoice/malaysia/cancel` * * * ## Request Headers | Attribute | Type | Option | Description | | --- | --- | --- | --- | | x-api-key | String | Required | A unique string | | Authorization | String | Required | Bearer token | **Content-Type:** `application/json` **Accept:** `application/json` * * * ## Request Payload (by docId) | Field | Type | Required | Description | | --- | --- | --- | --- | | reason | String | ✅ | Cancellation reason | | docId | Number | ✅ | Staple document ID | ### Sample ```json { "reason": "Wrong line item quantity", "docId": 242020 } ``` * * * ## Request Payload (by uuid) | Field | Type | Required | Description | | --- | --- | --- | --- | | reason | String | ✅ | Cancellation reason | | uuid | String | ✅ | MyInvois document UUID | ### Sample ```json { "reason": "Wrong line item quantity", "uuid": "KAQ2848KJ35CCAH3PY86FMMK10" } ``` * * * ## Response (Success) ```json { "uuid": "KAQ2848KJ35CCAH3PY86FMMK10", "status": "Cancelled" } ``` * * * ## Response Field Notes - `uuid`: MyInvois document UUID of the cancelled document - `status`: Expected success value is `Cancelled` * * * ## Error Notes If cancellation fails, clients should inspect the returned error details from this endpoint. Example request payload: ```json { "reason": "Wrong line item quantity", "docId": 242020 } ```

Authentication

x-api-keystring
API key issued by Staple.
AuthorizationBearer
JWT obtained from the login endpoint.

Request

This endpoint expects an object.
reasonstringOptional

Response

OK