Import Malaysia E-Invoice
Import Malaysia E-Invoice
Import Malaysia E-Invoice
Import a Malaysia e-invoice document into a Staple Queue in JSON format. Staple will create a document (docId) and submit it to LHDN MyInvois asynchronously.
This endpoint supports all MyInvois document types, including self-billed types.
POST /v2/einvoice/malaysia/queue/{queueId}
Content-Type: application/json
Accept: application/json
docType)docType determines the business scenario. Allowed values:
A single endpoint supports all docType values above.
Paste this into Postman Body.
Some document types must reference an earlier document.
invoice)When docType is one of:
credit_note
debit_note
refund_note
reference.originalInvoiceCodeNumber is required and must point to the original invoice docNumber / code number used by your integration.
self_billed_invoice)When docType is one of:
self_billed_credit_note
self_billed_debit_note
self_billed_refund_note
reference.originalInvoiceCodeNumber is required and must point to the original self_billed_invoice docNumber / code number used by your integration.
Example:
supplier, buyer)Address Object (recommended fields): line1, city, stateCode, postcode, country
Contact Object (recommended fields): telephone
Self-billed documents: Buyer is the issuer in business terms, but this API keeps
supplierandbuyerfields consistent. Staple validates and maps parties according todocType.
lines[])totals)Tax is represented at line-level under lines[].taxes.
taxes[])taxes[].typeDo not use ambiguous values like
SST. ChooseSALES_TAXorSERVICE_TAXexplicitly.
To keep adjustments unambiguous:
credit_note: use negative amounts for lines[].amountExclTax, lines[].taxes[].amount, and totals.
refund_note: use negative amounts when reducing original invoice value and confirming money returned to Buyer.
debit_note: use positive amounts (additional charges).
Staple will validate totals consistency.
The response confirms the document was queued in Staple. Use
docIdandtrackingUrlto check ongoing status.
requestId: Request trace ID.
queueId: Queue used for import.
docId: Staple document ID created in the queue.
docType: Imported document type.
docNumber: Imported document number.
message: Human-readable processing message.
trackingUrl: Internal status endpoint for this document.
myInvois.submissionId: MyInvois submission batch ID.
myInvois.uuid: MyInvois document UUID.
myInvoisis present only when Staple already has MyInvois submission details available at response time.
If processing later fails, or MyInvois details are not ready yet, the response may still returndocIdwithoutmyInvois.
In that case, check the actual processing result via:
GET/v2/einvoice/malaysia/status/{docId}
This endpoint is asynchronous.
A successful import request can still return a normal queued response first, while the actual Malaysia e-invoice processing succeeds or fails later.
Do not assume failures will come back as HTTP errors from the import endpoint.
If processing fails after the document is queued, the response may simply not include myInvois.
When myInvois is missing, use docId to call the status endpoint and inspect the real outcome.
GET /v2/einvoice/malaysia/status/242069
Use this endpoint to check whether the document was submitted, validated, rejected, or failed during later processing.
Import response has docId + myInvois → MyInvois submission details are already available.
Import response has docId but no myInvois → do not treat it as HTTP failure; call /v2/einvoice/malaysia/status/{docId}.