Malaysia v2: Cancel Document API

Cancel a document by its document ID, with a reason, in the Malaysia LHDN API v2 (legacy): endpoint, headers, request, responses and code examples.

This endpoint may no longer be available. Contact support@complyance.io before you rely on it. To cancel a Malaysian document within LHDN’s 72-hour window, you can cancel it in the MyInvois portal; see the life of a Malaysian e-invoice.

The Cancel Document API cancels a document by its documentId. You must give a reason for the cancellation.

Endpoint

EnvironmentHost
Sandboxhttps://malaysia-sandbox.complyance.io
Productionhttps://malaysia-prod.complyance.io
Cancel a documenthttp
POST https://malaysia-sandbox.complyance.io/cancelDocument
POST https://malaysia-prod.complyance.io/cancelDocument

Headers

HeaderTypeDescriptionExampleConditionality
x-api-keystringYour API keyyour-api-keyMandatory
Content-TypestringSet as application/jsonapplication/jsonMandatory

Request body

The request body is JSON.

ParameterTypeDescriptionExample value
documentIdstringDocument reference number the supplier uses for internal tracking.E-INV-01
reasonstringThe reason for cancelling the document.Testing Cancellation
Request bodyjson
{
  "documentId": "E-INV-01",
  "reason": "Testing Cancellation"
}

Response

Success response

HTTP status 200 OK:

Responsejson
{
  "uuid": "ABCDEFGHJK0123456789CANC10",
  "status": "Cancelled",
  "error": null
}

Error responses

HTTP status codeError codeDescription
400BAD_REQUESTThe input is invalid or fields are missing.
401UNAUTHORIZEDThe API key is missing or invalid.
500SERVER_ERRORAn internal server error occurred.
Error responsejson
{
  "errorMessage": "Please check the field documentId"
}

Code examples

bash
curl --location 'https://malaysia-prod.complyance.io/cancelDocument' \
--header 'Content-Type: application/json' \
--header 'x-api-key: your-api-key' \
--data '{
  "documentId": "E-INV-01",
  "reason": "Testing Cancellation"
}'

Notes

  • The x-api-key header must contain a valid API key.
  • The reason parameter is required. Give a clear explanation for the cancellation.
  • Use the sandbox host for testing.
  • Format the request body and headers correctly to avoid errors.

Last updated