submit_invoice
Submit an ALREADY-SIGNED Malaysian e-invoice (UBL 2.1) to LHDN MyInvois — the POST /api/v1.0/documentsubmissions call. This server does NOT sign: you XAdES-sign the UBL document merchant-side, compute its SHA-256 hash, and pass { format, document(base64), documentHash, codeNumber }. MyInvois validates asynchronously, so a successful submit returns a submissionUid plus accepted_documents (each with the assigned uuid) and rejected_documents — it does NOT yet mean the invoice is Valid; call query_submission with the submissionUid to poll the validation outcome. Result: accepted=true when at least one document was accepted for processing (HTTP 202); rejected_documents lists any structurally-rejected documents with their error. Required credential headers (set once in your MCP client, per-request, never stored): x-myinvois-client-id + x-myinvois-client-secret (your ERP OAuth2 credentials from the MyTax "Register ERP" self-service). Optional header x-myinvois-mode: sandbox (default = preprod, no fiscal effect) | prod (production, real fiscal effect). Optional owner-policy headers x-agentpay-max-amount / x-agentpay-approval-above / x-agentpay-allowed-tools.
Parameters4
| document | string | required | The FULL signed UBL 2.1 document, base64-encoded. You XAdES-sign it merchant-side; this server forwards the bytes untouched. |
| documentHash | string | required | SHA-256 hash (hex) of the signed document bytes. Computed merchant-side; MyInvois re-checks it against the document. |
| codeNumber | string | required | Your internal invoice number / eInvoice code number (cbc:ID of the document), e.g. INV-2026-000123. Used to correlate accepted/rejected results. |
| format | string | optional | Document format: JSON (default) or XML — must match how you built and signed the document. |
Raw schema
{
"type": "object",
"properties": {
"document": {
"type": "string",
"description": "The FULL signed UBL 2.1 document, base64-encoded. You XAdES-sign it merchant-side; this server forwards the bytes untouched."
},
"documentHash": {
"type": "string",
"description": "SHA-256 hash (hex) of the signed document bytes. Computed merchant-side; MyInvois re-checks it against the document."
},
"codeNumber": {
"type": "string",
"description": "Your internal invoice number / eInvoice code number (cbc:ID of the document), e.g. INV-2026-000123. Used to correlate accepted/rejected results."
},
"format": {
"type": "string",
"enum": [
"JSON",
"XML"
],
"description": "Document format: JSON (default) or XML — must match how you built and signed the document."
}
},
"required": [
"document",
"documentHash",
"codeNumber"
]
}