01 / Overview

What is the MySyncTax MyInvois API?

The MySyncTax API is a middleware interface for transferring invoice records from an existing business system into an e-Invoice workflow. Instead of building each integration process directly against LHDN's MyInvois SDK, your server sends JSON to a documented MySyncTax endpoint and processes the returned result.

This reference is for software developers, POS vendors, ERP teams and IT integrators working with Malaysia's MyInvois requirements. It describes the MySyncTax interface; direct LHDN API authentication, document signing and UBL requirements are covered separately by the official SDK.

Submit documents

Send sales invoices, self-billed invoices and relevant adjustment notes.

Manage counterparties

Synchronise customer and supplier records for supported ERP workflows.

Handle results

Record middleware identifiers, examine errors and reconcile with MyInvois validation.

POS / ERPInvoice and customer data
MySyncTax APIAuthentication and processing
LHDN MyInvoisSubmission and validation

The LHDN platform performs asynchronous document validation. A successful API submission or accepted-document acknowledgement is not necessarily the final Valid state.

02 / Start here

Quick start: submit your first request

  1. Prepare integration credentials

    Obtain MySyncTax credentials for the business account and store them in environment variables or a secret manager on the server. These are not the same as LHDN's ERP Client ID / Client Secret.

  2. Choose the correct workflow

    Use the receipt QR endpoint for the documented POS workflow, or /api/myinvois/invoice when your ERP supplies customer master data. Use a self-billed or note endpoint only where the underlying business transaction calls for it.

  3. Send JSON via HTTPS and save the response

    Persist your internal invoice number and transaction ID alongside the returned identifiers. Inspect the returned status and reconcile the final MyInvois result before treating an invoice as validated.

Illustrative server-side cURL request

HTTP · JSON request
curl --request POST 'https://mysynctax.com/v5/public/api/myinvois' \

  --header 'Content-Type: application/json' \

  --data '{

    "mysynctax_key": "YOUR_MYSYNCTAX_KEY",

    "mysynctax_secret": "YOUR_MYSYNCTAX_SECRET",

    "invoice_no": "DEMO-INV-001",

    "sale_id_integrate": 10001,

    "payment_note_term": "CASH",

    "items": [{

      "item_id": 1,

      "sorting_id": 1,

      "invoiced_quantity": 1,

      "unit_price": 50,

      "price_discount": 0,

      "tax_amount": 0,

      "item_description": "Sample service"

    }]

  }'

The values above are illustrative and not live credentials. Use the payload fields supported by the specific endpoint and your business's invoicing scenario. Test in a non-production setup approved by the MySyncTax team.

03 / Endpoint directory

MySyncTax API endpoints at a glance

Choose the operation that fits your integration. Paths below are shown relative to the https://mysynctax.com/v5/public base path used in the supplied source. Some MySyncTax developer pages use /v5 instead; confirm the path configured for your environment.

OperationMethodRelative pathUse
Receipt QR / POSPOST/api/myinvoisReceipt-based workflow
ERP invoice with customerPOST/api/myinvois/invoiceCustomer data in payload
Credit, debit or refund notePOST/api/myinvois/noteAdjust earlier document
Self-billed invoicePOST/api/myinvois/selfbill/invoiceQualifying self-billing cases
Self-billed notePOST/api/myinvois/selfbill/noteAdjust self-billed document
Customer master dataPOST/api/myinvois/add_customerCreate / update customers
General TIN invoicePOST/api/myinvois/invoice_generaltinScenario-specific generic TIN
General TIN notePOST/api/myinvois/invoice_generaltin/noteAdjust generic TIN invoice
General TIN self-billedPOST/api/myinvois/invoice_generaltin/selfbillCheck eligibility and TIN
General TIN self-billed notePOST/api/myinvois/invoice_generaltin/selfbill/noteAdjust self-billed general TIN
Supplier master dataPOST/api/myinvois/add_supplierCreate / update suppliers
Invoice PDF viewGET/invoice/view/{mysynctax_uuid}Rendered invoice document
Delete invoicePOST/v5/api/myinvois/delete/{mysynctax_uniqueId}Delete an invoice where its status allows
Cancel submitted documentPOST/api/v1/external/cancel-document/{unique_id}Time-limited cancellation
Send invoice emailPOST/api/invoice/send-emailEmail invoice link
Version / availability: Endpoint functionality, HTTP responses and authentication requirements should be tested with the deployed MySyncTax instance. These example paths were not verified by submitting live invoices.
04 / Authentication

MySyncTax API authentication

Most JSON submission endpoints in the provided MySyncTax reference authenticate using two fields in the request body:

JSON keyMeaningSecurity guidance
mysynctax_keyIntegration identifier issued to your accountKeep in server-side configuration
mysynctax_secretSecret paired with the integration keyNever expose in browser JavaScript, mobile apps, Git or logs
Example credential fields
{

  "mysynctax_key": "YOUR_MYSYNCTAX_KEY",

  "mysynctax_secret": "YOUR_MYSYNCTAX_SECRET"

}

For the main submission flow, missing or invalid credentials are documented as 401 Unauthorized. Individual operations may have different requirements; for example, the published invoice-email example only contains mysynctax_uuid.

Different from LHDN OAuth: Direct MyInvois API clients use an OAuth 2.0 client-credentials flow and bearer access tokens. Do not send MySyncTax credentials to LHDN's /connect/token endpoint, or assume an LHDN access token authenticates this middleware. See LHDN taxpayer authentication.
05 / Data format

The fields below describe the illustrative invoice structures from the supplied MySyncTax documentation. They are not a complete JSON Schema and do not establish which optional fields are supported by every endpoint.

JSON Structure

Header-Level Fields

  • invoice_no – The external invoice number.
  • issue_date – Date of invoice (YYYY-MM-DD HH:MM:SS).
  • sale_id_integrate – ID of the transaction in your system.
  • total_amount – Total invoice amount BEFORE item breakdown (amount_before).
  • payment_note_term – CASH / TRANSFER / CHEQUE / etc.

Item-Level Fields

  • item_id – ID of each item in the invoice.
  • sorting_id – Item sorting or line order.
  • invoiced_quantity – Quantity purchased.
  • unit_price – Unit price.
  • price_discount – Discount per unit.
  • total – Total price for this item (quantity × price).
  • item_description – Item name or description.
Amounts and date formats: The vendor examples use numeric JSON values for monetary amounts and show YYYY-MM-DD HH:MM:SS for issue_date. Confirm whether a particular endpoint calculates line totals and how tax/discount rounding is applied. Avoid floating-point rounding errors in your own accounting system.

Normal Invoice with Receipt QR

This example sends a POS transaction to the MySyncTax receipt-QR workflow. The vendor documentation describes a process that may subsequently group eligible receipts for a consolidated e-Invoice if the buyer does not request an individual e-Invoice. Not scanning a QR code is not itself an LHDN rule that automatically makes every transaction eligible for consolidation. Confirm your MySyncTax configuration and the applicable current LHDN rules before using this flow.

Code example
{

  "mysynctax_key": "YOUR_MYSYNCTAX_KEY",

  "mysynctax_secret": "YOUR_MYSYNCTAX_SECRET",

  "invoice_no": "INV-9002050",

  "sale_id_integrate": 9002050,

  "payment_note_term": "CASH",

  "items": [

    {

      "item_id": 12,

      "sorting_id": 1,

      "invoiced_quantity": 2,

      "unit_price": 60.00,

      "item_description": "Premium Nasi Ayam Set",

      "price_discount": 20,

      "tax_amount": 10.00

    },

    {

      "item_id": 13,

      "sorting_id": 2,

      "invoiced_quantity": 1,

      "unit_price": 90.00,

      "item_description": "Iced Coffee Latte",

      "price_discount": 10,

      "tax_amount": 8.00

    }

  ]

}
Regulatory check: Consolidated e-Invoices are subject to timing limits, transaction restrictions and case-specific exclusions under LHDN guidance. Customers requesting individual e-Invoices require a separate workflow.

Send Data

Submit data using the following endpoint:

Code example
POST https://mysynctax.com/v5/public/api/myinvois

Key Notes

  • Duplicate JSON payloads (same hashed content) are rejected with 409.
  • All amounts must be numerical.
  • Date formats must use YYYY-MM-DD HH:MM:SS.
Idempotency: The source describes hash-based duplicate detection and HTTP 409. Do not treat a duplicated request as a new invoice, and do not assume every endpoint returns the same duplicate body. Preserve your own unique invoice reference and retry safely only after determining whether a previous request was processed.

Response Examples

Success

Code example
{

  "status": "ok",

  "mysynctax_uuid": "generated-unique-id",

  "qr_url": "https://mysynctax.com/v5/public/redirect/9QqIe39"

}

Duplicate

Code example
{

  "status": "duplicate_ignored",

  "mysynctax_uuid": "existing-unique-id"

}

Unauthorized

Code example
{

  "status": "unauthorized",

  "message": "Invalid mysynctax_key or mysynctax_secret"

}
Submission vs validation: A response containing submissionUid or acceptedDocuments is an acknowledgement of submission acceptance for processing, not proof the e-Invoice is already Valid. The official MyInvois statuses include Submitted, Valid, Invalid and Cancelled. Use the appropriate supported reconciliation method to confirm the final status.

Error Codes

HTTP CodeDescription
400Invalid or malformed JSON
401API key or secret missing/invalid
409Duplicate invoice submission
500Server processing error
Error handling: These values are copied from the MySyncTax reference, not a guarantee that all operations use the same response structure. Log a safe request correlation ID, inspect the actual HTTP status and validation payload, and avoid persisting credentials or full personal data in error logs.

ERP - Invoice (With Customer)

Code example
POST https://mysynctax.com/v5/public/api/myinvois/invoice

This API is intended for ERP / Accounting systems that manage customer master data and require direct submission to LHDN.

Request Example

Code example
{

  "mysynctax_key": "YOUR_MYSYNCTAX_KEY",

  "mysynctax_secret": "YOUR_MYSYNCTAX_SECRET",

  "isAutoToLHDN":1,

  "invoice_no": "INV-322",

  "sale_id_integrate": 3312,

  "payment_note_term": "CASH",

  "customer": {

    "tin_no": "IG25461820000",

    "registration_name": "Example Sole Proprietor",

    "identification_no": "YOUR_ID_NUMBER",

    "identification_type": "NRIC",

    "sst_registration": "SST123456",

    "phone": "YOUR_PHONE",

    "email": "buyer@example.com",

    "address_line_1": "No 10, Jalan Teknologi",

    "address_line_2": "Taman Teknologi",

    "address_line_3": "Seksyen 7",

    "city_name": "Shah Alam",

    "postal_zone": "40000",

    "state_code": "10",

    "country_code": "MYS"

  },

  "items": [

    {

      "item_id": 101,

      "sorting_id": 1,

      "item_description": "USB Keyboard",

      "invoiced_quantity": 2,

      "unit_price": 30.00,

      "price_discount":5,

      "tax_amount": 3.60

    },

    {

      "item_id": 102,

      "sorting_id": 2,

      "item_description": "USB Mouse",

      "invoiced_quantity": 1,

      "unit_price": 40.00,

       "price_discount":5,

      "tax_amount": 2.40



    }

  ]

}

Response Example

Code example
{

    "status": "ok",

    "invoice_id": 410,

    "mysynctax_uuid": "a461cd55016ece31242098e2bxxxxxx3",

    "customer_status": "updated",

    "qr_lhdn": "https://mysynctax.com/v5/public/qr_link/a461cd55016ece31242098e2bxxxxxx3",

    "customer_id": 90,

    "result": {

        "headers": {},

        "original": {

            "submissionUid": "X7T2BQBCW6A55280PYxxxxxx",

            "acceptedDocuments": [

                {

                    "uuid": "1DB9HRPJ1F1VJZ34PYsssss",

                    "invoiceCodeNumber": "INV-567-3455"

                }

            ],

            "rejectedDocuments": []

        },

        "exception": null

    }

}
Customer identity: Use a valid TIN and identification type / number combination appropriate to the customer. Any sample values or placeholder NRIC/BRN values here are illustrative and should be replaced before production submission. Confirm the requested isAutoToLHDN behavior with the MySyncTax configuration.

Credit Note / Debit Note / Refund

Code example
POST https://mysynctax.com/v5/public/api/myinvois/note

Used to submit adjustments for invoices that have already been submitted to LHDN.

Request Example

Code example
{

  "mysynctax_key": "YOUR_MYSYNCTAX_KEY",

  "mysynctax_secret": "YOUR_MYSYNCTAX_SECRET",

  "note_type": "refund",

  "mysynctax_uuid": "bfc2c97e589ceb9fe9cb4b603bb740d011cb3d53",

  "sale_id_integrate": 5643,

  "items": [

    {

      "item_id": 102,

      "qty": 1,

      "price": 50.00,

      "discount": 0.00,

      "tax": 3.00,

      "description": "Item rosak / dipulangkan"

    }

  ]

}

Response Example

Code example
{

    "status": "success",

    "note_type": "refund",

    "invoice_id": 409,

    "mysynctax_uuid": "f8259315-45bf-41ba-bd6d-ae9abb93ac32",

    "qr_lhdn": "https://mysynctax.com/v5/public/qr_link/9QJTTE3H66GCHRHB4A3PVJDK10",

    "message": "Refund Note submitted successfully",

    "result": {

        "headers": {},

        "original": {

            "submissionUid": "5PBX6XF31R26SH0J3A3PVJDK10",

            "acceptedDocuments": [

                {

                    "uuid": "9QJTTE3H66GCHRHB4A3PVJDK10",

                    "invoiceCodeNumber": "REFUND-NOTE-20251229001155"

                }

            ],

            "rejectedDocuments": []

        },

        "exception": null

    }

}
Linked documents: mysynctax_uuid references the original document in these examples. The tax value inside note items is an amount, not a percentage. Check the original document, remaining quantities and note type before posting.

Error Codes

HTTP CodeDescription
400Invalid or malformed JSON
401API key or secret missing/invalid
404Invoice UUID not found
409Duplicate submission
422Item mismatch
500Server processing error

Self-Billed Invoice

A self-billed e-Invoice is issued by the buyer on behalf of the supplier only for qualifying scenarios defined by LHDN. It is not a general fallback whenever a supplier does not issue an invoice. This MySyncTax endpoint accepts supplier details with invoice items for supported self-billing workflows.

POST https://mysynctax.com/v5/public/api/myinvois/selfbill/invoice

Request Example

Code example
{

  "mysynctax_key": "YOUR_MYSYNCTAX_KEY",

  "mysynctax_secret": "YOUR_MYSYNCTAX_SECRET",

  "isAutoToLHDN": 1,

  "invoice_no": "INV-567-8612",

  "sale_id_integrate": 8612,



  "payment_note_term": "CASH",



  "supplier": {

    "tin_no": "IG20868489010",

    "registration_name": "IMPORT SDN BHD",

    "identification_no": "YOUR_ID_NUMBER",

    "identification_type": "BRN",

    "sst_registration": "SST123456",

    "phone": "YOUR_PHONE",

    "email": "finance@abctrading.com",

    "address_line_1": "No 10, Jalan Teknologi",

    "address_line_2": "Taman Teknologi",

    "address_line_3": "Seksyen 7",

    "city_name": "Shah Alam",

    "postal_zone": "40000",

    "state_code": "10",

    "country_code": "MYS"

  },



  "items": [

    {

      "item_id": 101,

      "sorting_id": 1,

      "item_description": "USB Keyboard",

      "invoiced_quantity": 2,

      "unit_price": 30.00,

      "tax_amount": 3.60,

      "price_discount":5

    },

    {

      "item_id": 102,

      "sorting_id": 2,

      "item_description": "USB Mouse",

      "invoiced_quantity": 1,

      "unit_price": 40.00,

      "tax_amount": 2.40,

      "price_discount":5

    }

  ]

}

Response Example

Code example
{

    "status": "ok",

    "invoice_id": 406,

    "mysynctax_uuid": "173a8b67d01a40b2c2e0dd11efcc6wxxxxx",

    "customer_status": "existing",

    "qr_lhdn": "https://mysynctax.com/v5/public/qr_link/JGT0YJCDKZ5R23JMX89Fxxxxxx",

    "customer_id": 90,

    "result": {

        "headers": {},

        "original": {

            "submissionUid": "6RTRCJFS0EKWTRGTwxxxxxx",

            "acceptedDocuments": [

                {

                    "uuid": "JGT0YJCDKZ5R23JMXxxxxx",

                    "invoiceCodeNumber": "INV-567-123"

                }

            ],

            "rejectedDocuments": []

        },

        "exception": null

    }

}
Example identifiers: Replace the illustrative TIN and YOUR_ID_NUMBER with valid supplier information. Verify that the buyer has the authority and obligation to issue this self-billed document under the current guidelines.

Self-Billed Credit / Debit / Refund

This API is used to submit Credit, Debit, or Refund Notes for Self-Billed Invoices that have already been submitted to LHDN.

POST https://mysynctax.com/v5/public/api/myinvois/selfbill/note

Request Example

Code example
{

  "mysynctax_key": "YOUR_MYSYNCTAX_KEY",

  "mysynctax_secret": "YOUR_MYSYNCTAX_SECRET",

  "note_type": "refund",

  "mysynctax_uuid": "943e75230addb63b7fde84c4b2b9ce8a532ca07a",

  "sale_id_integrate": 456,

  "items": [

    {

      "item_id": 102,

      "qty": 1,

      "price": 50.00,

      "discount": 0.00,

      "tax": 3.00,

      "description": "Item rosak / dipulangkan"

    }

  ]

}

Response Example

Code example
{

    "status": "ok",

    "invoice_id": 404,

    "note_type": "refund",

    "mysynctax_uuid": "57f15d7c-b432-4c69-bd66-cadxxxxxx",

    "qr_lhdn": "https://mysynctax.com/v5/public/qr_link/xaasxxxxxx",

    "result": {

        "headers": {},

        "original": {

            "submissionUid": "X6BEP9R6MN4xxxxxx",

            "acceptedDocuments": [

                {

                    "uuid": "F440ZCK2EXZBxxxxx",

                    "invoiceCodeNumber": "REFUND-NOTE-20251229000704"

                }

            ],

            "rejectedDocuments": []

        },

        "exception": null

    }

}
Validation: Send notes only against the eligible original self-billed invoice. The note item field names here (qty, price, tax) differ from regular invoice-item field names; preserve the endpoint-specific schema.

Add New Customer

This API is used to create or update customer master data in MySyncTax. It supports bulk customer submission and is commonly used by ERP or POS systems before invoice or self-billed submission.

POST https://mysynctax.com/v5/public/api/myinvois/add_customer

Request Example

Code example
{

  "mysynctax_key": "YOUR_MYSYNCTAX_KEY",

  "mysynctax_secret": "YOUR_MYSYNCTAX_SECRET",

  "customers": [

    {

      "tin_no": "EI00000000010",

      "registration_name": "AHMAD1 BIN ALI",

      "identification_type": "NRIC",

      "identification_no": "YOUR_ID_NUMBER",

      "sst_registration": null,

      "phone": "YOUR_PHONE",

      "email": "ahmad.ali@gmail.com",

      "city_name": "Kota Bharu",

      "postal_zone": "15000",

      "state_code": "03",

      "country_code": "MYS",

      "address_line_1": "Lot 123, Kampung Pantai",

      "address_line_2": "Mukim Badang",

      "address_line_3": "Kelantan"

    }

  ]

}

LHDN State Code Reference

Use the following state_code values when submitting customer or supplier address information to MySyncTax. These codes follow the official LHDN lookup.

State Name State Code
Johor01
Kedah02
Kelantan03
Melaka04
Negeri Sembilan05
Pahang06
Pulau Pinang07
Perak08
Perlis09
Selangor10
Terengganu11
Sabah12
Sarawak13
Wilayah Persekutuan Kuala Lumpur14
Wilayah Persekutuan Labuan15
Wilayah Persekutuan Putrajaya16
Not Applicable17

Response Example

Code example
{

  "status": "ok",

  "message": "Customers processed successfully",

  "results": [

    {

      "tin_no": "EI00000000010",

      "status": "created",

      "id_customer": 93

    }

  ]

}
Bulk operation: The example uses a customers array. Record per-entry processing results; do not assume an HTTP success means every supplied customer record was created or updated.

General TIN Types (LHDN Standard)

LHDN defines several general TIN values for specific allowed transaction scenarios. They are not substitutes for a customer's or supplier's actual TIN whenever one is available, and their use is not interchangeable across invoice types.

Scenario TIN Description
Walk-in / B2C EI00000000010 Consolidate - POS / ERP
Foreign Export EI00000000020 Invoice to overseas customer
Foreign Import (Self-Billed) EI00000000030 Import supplier (self-billed)
Government EI00000000040 Government related entity

Illustrative identification fields

Code example
{

"identification_no": "NA",

"identification_type": "BRN"

}
Important: identification_no: "NA" with identification_type: "BRN" is a sample pairing from the vendor reference, not a universally mandatory rule for every general TIN. Verify the exact combination permitted for your scenario using official LHDN documentation.

For current combination restrictions see the official MyInvois taxpayer validation errors (notably rules for general TIN 010, 020 and 030).

General TIN Invoice

Code example
POST https://mysynctax.com/v5/public/api/myinvois/invoice_generaltin

Payload

Code example
{

  "mysynctax_key": "YOUR_MYSYNCTAX_KEY",

  "mysynctax_secret": "YOUR_MYSYNCTAX_SECRET",

  "isAutoToLHDN":1,

  "invoice_no": "INV-32224",

  "sale_id_integrate": 32224,

  "payment_note_term": "CASH",

  "customer": {

    "tin_no": "EI00000000010",

    "identification_type":"BRN",

    "identification_no":"NA",

    "registration_name": "General Public",

    "sst_registration": "SST123456",

    "phone": "YOUR_PHONE",

    "email": "buyer@example.com",

    "address_line_1": "No 10, Jalan Teknologi",

    "address_line_2": "Taman Teknologi",

    "address_line_3": "Seksyen 7",

    "city_name": "Shah Alam",

    "postal_zone": "40000",

    "state_code": "10",

    "country_code": "MYS"

  },

  "items": [

    {

      "item_id": 101,

      "sorting_id": 1,

      "item_description": "USB Keyboard",

      "invoiced_quantity": 2,

      "unit_price": 30.00,

      "price_discount":3,

      "tax_amount": 3

    },

    {

      "item_id": 102,

      "sorting_id": 2,

      "item_description": "USB Mouse",

      "invoiced_quantity": 1,

      "unit_price": 40.00,

       "price_discount":5,

      "tax_amount": 2



    }

  ]

}

Response

Code example
{

    "headers": {},

    "original": {

        "status": "ok",

        "invoice_id": 809,

        "mysynctax_uuid": "6f91236366130791c506ccede35a0b8f48094d66",

        "customer_status": "updated",

        "customer_id": 93,

        "qr_lhdn": "https://mysynctax.com/v5/qr_link/6f91236366130791c506ccede35a0b8f48094d66",

        "result": {

            "headers": {},

            "original": {

                "submissionUid": "YSS2VJXZW9KYHSV4AP0MMKMK10",

                "acceptedDocuments": [

                    {

                        "uuid": "XMJ9T0GQ79R7VGBKAP0MMKMK10",

                        "invoiceCodeNumber": "INV-32224"

                    }

                ],

                "rejectedDocuments": []

            },

            "exception": null

        }

    },

    "exception": null

}
Scenario-specific: Confirm the general TIN, document classification, supplier/buyer role and identification-field requirements with the current LHDN SDK before live submission. Illustrative values may be unsuitable for an actual business transaction.
Validation limitation: The EI00000000010 + BRN: NA sample is not valid for arbitrary individual invoices. The official validator restricts combinations by classification and scenario, including rules for consolidated invoices.

General TIN Credit / Debit / Refund

Code example
POST https://mysynctax.com/v5/public/api/myinvois/invoice_generaltin/note

Payload

Code example
{

  "mysynctax_key": "YOUR_MYSYNCTAX_KEY",

  "mysynctax_secret": "YOUR_MYSYNCTAX_SECRET",

  "note_type": "credit",

  "mysynctax_uuid":"xxxxxxxxx",

  "sale_id_integrate": 32223,

  "items": [

    {

      "item_id": 102,

      "qty": 1,

      "price": 50.00,

      "discount": 0.00,

      "tax": 3.00,

      "description": "Item rosak / dipulangkan"

    }

  ]

}

Response

Code example
{

    "headers": {},

    "original": {

        "status": "ok",

        "note_type": "credit",

        "invoice_id": 1233,

        "mysynctax_uuid": "xxxx",

        "qr_lhdn": "https://mysynctax.com/v5/qr_link/xxxx",

        "result": {

            "headers": {},

            "original": {

                "submissionUid": "ssss",

                "acceptedDocuments": [

                    {

                        "uuid": "ccc",

                        "invoiceCodeNumber": "CREDIT-NOTE-20260301162121"

                    }

                ],

                "rejectedDocuments": []

            },

            "exception": null

        }

    },

    "exception": null

}
Scenario-specific: Confirm the general TIN, document classification, supplier/buyer role and identification-field requirements with the current LHDN SDK before live submission. Illustrative values may be unsuitable for an actual business transaction.

General TIN Self-Billed Invoice

Code example
POST https://mysynctax.com/v5/public/api/myinvois/invoice_generaltin/selfbill

Payload

Code example
{

  "mysynctax_key": "YOUR_MYSYNCTAX_KEY",

  "mysynctax_secret": "YOUR_MYSYNCTAX_SECRET",

  "isAutoToLHDN":1,

  "invoice_no": "INV-323574",

  "sale_id_integrate": 323574,

  "payment_note_term": "CASH",

  "supplier": {

    "tin_no": "EI00000000030",

    "registration_name": "Example Overseas Supplier",

    "sst_registration": "SST123456",

    "identification_type": "BRN",

    "phone": "YOUR_PHONE",

    "email": "finance@abctrading.com",

    "address_line_1": "Sample Road",

    "address_line_2": "Business District",

    "address_line_3": "Singapore",

    "city_name": "Singapore",

    "postal_zone": "000000",

    "state_code": "17",

    "country_code": "SGP"

  },

  "items": [

    {

      "item_id": 101,

      "sorting_id": 1,

      "item_description": "USB Keyboard",

      "invoiced_quantity": 2,

      "unit_price": 30.00,

      "price_discount":3,

      "tax_amount": 3

    },

    {

      "item_id": 102,

      "sorting_id": 2,

      "item_description": "USB Mouse",

      "invoiced_quantity": 1,

      "unit_price": 40.00,

       "price_discount":5,

      "tax_amount": 2



    }

  ]

}

Response

Code example
{

    "status": "ok",

    "invoice_id": 1235,

    "mysynctax_uuid": "xxx",

    "customer_status": "created",

    "qr_lhdn": "https://mysynctax.com/v5/qr_link/xxxx",

    "customer_id": 349,

    "result": {

        "headers": {},

        "original": {

            "submissionUid": "xxxc",

            "acceptedDocuments": [

                {

                    "uuid": "ccc",

                    "invoiceCodeNumber": "INV-323574"

                }

            ],

            "rejectedDocuments": []

        },

        "exception": null

    }

}
Scenario-specific: Confirm the general TIN, document classification, supplier/buyer role and identification-field requirements with the current LHDN SDK before live submission. Illustrative values may be unsuitable for an actual business transaction.
Specific example: This illustrative sample shows the foreign-supplier general TIN EI00000000030. Supply genuine foreign supplier details and satisfy the applicable LHDN validation rules; it is not a ready-to-submit real invoice.

General TIN Self-Billed Note

Code example
POST https://mysynctax.com/v5/public/api/myinvois/invoice_generaltin/selfbill/note

Payload

Code example
{

  "mysynctax_key": "YOUR_MYSYNCTAX_KEY",

  "mysynctax_secret": "YOUR_MYSYNCTAX_SECRET",

  "note_type": "credit",

  "mysynctax_uuid":"xxxxxxx",

  "sale_id_integrate": 32223,

  "items": [

    {

      "item_id": 102,

      "qty": 1,

      "price": 50.00,

      "discount": 0.00,

      "tax": 3.00,

      "description": "Item rosak / dipulangkan"

    }

  ]

}

Response

Code example
{

    "status": "ok",

    "note_type": "credit",

    "invoice_id": 1236,

    "mysynctax_uuid": "xxxxxxx",

    "qr_lhdn": "https://mysynctax.com/v5/qr_link/xxxxxx2",

    "result": {

        "headers": {},

        "original": {

            "submissionUid": "dfdsf",

            "acceptedDocuments": [

                {

                    "uuid": "qwewqe",

                    "invoiceCodeNumber": "CREDIT-NOTE-20260301162227"

                }

            ],

            "rejectedDocuments": []

        },

        "exception": null

    }

}
Scenario-specific: Confirm the general TIN, document classification, supplier/buyer role and identification-field requirements with the current LHDN SDK before live submission. Illustrative values may be unsuitable for an actual business transaction.

Add / Update Supplier

This API is used to create or update supplier master data in MySyncTax. It is commonly required for Self-Billed Invoice and ERP-based invoice submissions.

POST https://mysynctax.com/v5/public/api/myinvois/add_supplier

Request Example

Code example
{

  "mysynctax_key": "YOUR_MYSYNCTAX_KEY",

  "mysynctax_secret": "YOUR_MYSYNCTAX_SECRET",

  "supplier": [

    {

      "tin_no": "YOUR_VALID_SUPPLIER_TIN",

      "registration_name": "AHMAD1 BIN ALI",

      "identification_type": "NRIC",

      "identification_no": "YOUR_ID_NUMBER",

      "sst_registration": null,

      "phone": "YOUR_PHONE",

      "email": "ahmad.ali@gmail.com",

      "city_name": "Kota Bharu",

      "postal_zone": "15000",

      "state_code": "03",

      "country_code": "MYS",

      "address_line_1": "Lot 123, Kampung Pantai",

      "address_line_2": "Mukim Badang",

      "address_line_3": "Kelantan"

    }

  ]

}

Response Example

Code example
{

  "status": "ok",

  "message": "Supplier processed successfully",

  "results": [

    {

      "tin_no": "EI00000000010",

      "status": "updated",

      "id_customer": 93

    }

  ]

}
Response naming: The vendor sample uses id_customer in a supplier result. This could be a reused internal field or a documentation inconsistency. Confirm the real response schema before mapping this value into an ERP supplier record.

Generate PDF e-Invoice

This MySyncTax route is documented as displaying or returning a rendered invoice PDF using a previously returned mysynctax_uuid. A PDF or QR link is not, by itself, proof of final LHDN validation; check the document status.

Endpoint

Code example
GET https://mysynctax.com/v5/public/invoice/view/{mysynctax_uuid}

Description

  • Returns a rendered PDF invoice
  • Based on mysynctax_uuid from API response
  • Used for download, preview, or printing

Example

Code example
https://mysynctax.com/v5/public/invoice/view/5a59f5ba7a4f65b47b844ae6671c833c0d5c8b16

How to Use

  • Step 1: Submit invoice via API
  • Step 2: Get mysynctax_uuid from response
  • Step 3: Open the PDF using this endpoint

Sample Usage

Open in Browser

Code example
window.open("https://mysynctax.com/v5/public/invoice/view/" + mysynctax_uuid);

Download using PHP

Code example
$pdfUrl = "https://mysynctax.com/v5/public/invoice/view/" . $mysynctax_uuid;

header("Location: " . $pdfUrl);

exit;

Download using JavaScript

Code example
fetch("https://mysynctax.com/v5/public/invoice/view/" + mysynctax_uuid)

  .then(res => res.blob())

  .then(blob => {

    const url = window.URL.createObjectURL(blob);

    const a = document.createElement("a");

    a.href = url;

    a.download = "invoice.pdf";

    a.click();

  });

Notes

  • The vendor reference describes access via UUID. Confirm URL access controls and do not treat an unguessable identifier as a complete authorization mechanism.
  • Ensure UUID is valid
  • PDF includes QR code and LHDN validation details
Browser considerations: The sample JavaScript download depends on cross-origin (CORS) policy and PDF content type. If blocked, use a server-side download or an authorized browser navigation rather than exposing integration credentials in client code.

Delete Invoice

Use this API to request deletion of an invoice from MySyncTax by its unique ID. The API validates your integration credentials and checks the invoice submission status before processing the request.

Endpoint

POST https://mysynctax.com/v5/api/myinvois/delete/{mysynctax_uniqueId}

Request parameters

ParameterTypeDescription
mysynctax_unique_idStringUnique identifier of the invoice to delete, passed in the URL.
mysynctax_keyStringIntegration API key assigned to your company.
mysynctax_secretStringIntegration API secret assigned to your company.

Request example

Send the integration credentials in the JSON request body.

{

  "mysynctax_key": "YOUR_MYSYNCTAX_KEY",

  "mysynctax_secret": "YOUR_MYSYNCTAX_SECRET"

}

cURL example

This language-neutral example can be adapted to any server-side HTTP client. Keep credentials on the server and replace the URL placeholder with the invoice's unique ID.

curl --request POST "https://mysynctax.com/v5/api/myinvois/delete/{mysynctax_uniqueId}" \

  --header "Content-Type: application/json" \

  --data '{

    "mysynctax_key": "YOUR_MYSYNCTAX_KEY",

    "mysynctax_secret": "YOUR_MYSYNCTAX_SECRET"

  }'

Response example

This response indicates that deletion was rejected because the invoice has already been submitted to LHDN.

{

  "success": false,

  "message": "Invoice cannot be deleted because it has already been submitted.",

  "unique_id": "50dc9929XXXXXXXXXXXXXXXXXXXXXXXXXX",

  "invoice_no": "MZXXX-XXXXXXXX",

  "submission_status": "Submitted"

}

Response parameters

ParameterTypeDescription
successBooleanIndicates whether the deletion request succeeded.
messageStringResult or reason the request was rejected.
unique_idStringUnique identifier of the requested invoice.
invoice_noStringInvoice number associated with the request.
submission_statusStringCurrent LHDN submission status of the invoice.

Important notes

  • Use the POST method and include the invoice unique ID in the URL.
  • Both mysynctax_key and mysynctax_secret are required in the JSON body.
  • The API checks the invoice submission status before allowing deletion. An invoice already submitted to LHDN cannot be deleted through this API.
  • The supplied URL contains /dev/; confirm that this is the correct base path for the environment you are calling.

Cancel Document API

Cancel a previously validated e-Invoice when permitted by its status and LHDN's cancellation workflow. The standard cancellation period is 72 hours from the time the document became Valid (not necessarily from invoice creation or upload). After the window, corrective notes may be needed instead.

Endpoint

Code example
POST https://mysynctax.com/v5/public/api/v1/external/cancel-document/{unique_id}

Payload

Code example
{

  "mysynctax_key": "YOUR_MYSYNCTAX_KEY",

  "mysynctax_secret": "YOUR_MYSYNCTAX_SECRET",

  "reason": "Wrong item quantity entered"

}

Response (Success)

Code example
{

  "success": true,

  "message": "Document cancelled on LHDN via External API and status reset."

}

Response (Error - Outside 72 Hours)

Code example
{

  "success": false,

  "message": "Failed: 72-hour cancellation window has expired."

}
Cancellation restrictions: LHDN may also reject a cancellation where the document is in an incompatible state or is referenced by another document. This path is the MySyncTax wrapper, not LHDN's direct cancel API.

Send Invoice Email API

This endpoint triggers the system to send an email notification containing the PDF e-Invoice link directly to the customer's registered email address, with BCC/CC routing to administrators.

Endpoint

Code example
POST https://mysynctax.com/v5/public/api/invoice/send-email

Payload

Code example
{

  "mysynctax_uuid": "5a59f5ba7a4f65b47b844ae6671c833c0d5c8b16"

}

Note: You can pass either the LHDN UUID or the internal unique_id as the parameter.

Response (Success)

Code example
{

  "success": true,

  "message": "Email sent to customer@email.com ",

  "link": "https://mysynctax.com/v5/public/invoice/view/5a59f5ba7a4f65b47b844ae6671c833c0d5c8b16"

}

Response (Error)

Code example
{

  "success": false,

  "message": "Customer does not have an email address."

}
Security: This example payload contains only an invoice identifier; it is not evidence that every deployment exposes this endpoint without authentication. Apply authorization, recipient validation and rate limits to any email-sending integration.
Operational guidance

Understand IDs and document status

Responses in this reference include different identifiers. Store the original invoice reference together with the returned values, but do not assume all IDs are equivalent.

FieldWhat it represents in the examples
sale_id_integrateYour ERP or POS transaction reference
invoice_noBusiness-facing invoice number
mysynctax_uuidMySyncTax identifier returned by the vendor integration
result.original.submissionUidLHDN submission UID, where the response exposes one
result.original.acceptedDocuments[].uuidMyInvois document UUID for accepted records, where exposed

Recommended processing flow

  1. Check HTTP status and vendor-specific success/error response.
  2. Store your invoice number, internal transaction ID and returned identifiers.
  3. Check whether the document was accepted for further LHDN processing or rejected in the submission result.
  4. Reconcile the final Submitted, Valid, Invalid or Cancelled status by a supported vendor workflow or the official MyInvois API when authorised.
  5. Use final validation results before telling downstream systems that an e-Invoice is valid.
No undocumented status route assumed: The supplied MySyncTax page does not specify a standalone polling or status endpoint. Ask the vendor which supported status retrieval mechanism is available rather than guessing a URL. The official Get Submission API recommends a 3–5 second polling interval for authorised direct integrations.
Production readiness

Security, retries and compliance checklist

  • Secrets: Keep all API keys and secrets on the server, rotate exposed credentials, and never send them to the browser.
  • Environment: Verify your MySyncTax API base URL, sandbox availability and LHDN production credentials separately.
  • Transport: Use HTTPS with certificate verification and appropriate request timeouts.
  • Privacy: Avoid logging customer TINs, NRIC / BRN details, full payloads or credentials unnecessarily.
  • Retries: Handle network failures, temporary server errors and HTTP 429 conservatively; reconcile possible previous submission before retrying.
  • Reconciliation: Match final validation to the correct invoice number and document ID, and investigate rejected documents.
  • Accounting accuracy: Calculate tax and discounts consistently with the application's accepted decimal and rounding rules.
  • Legal applicability: Confirm consolidated invoice, general TIN and self-billing eligibility for the actual business case.

For direct LHDN API implementations, follow its integration practices, including token reuse and rate limits. Those official limits should not automatically be attributed to MySyncTax's own endpoints.

Developer FAQ

Frequently asked questions

Is this the official LHDN MyInvois API documentation?

No. This page documents the MySyncTax middleware interface for integrating with MyInvois. Direct LHDN integration has separate OAuth authentication, document schemas and system URLs in the official SDK.

Which MySyncTax endpoint should I choose for an ERP invoice?

Use the documented /api/myinvois/invoice route when the ERP submits customer details with the invoice. Confirm your production base path and required fields with the vendor.

Does a successful response mean the invoice is Valid in MyInvois?

Not necessarily. A successful submission may mean the record was accepted for subsequent validation. Reconcile the final status before marking it as valid.

What should I do about duplicate invoice errors?

Check the existing invoice by your own immutable reference and the identifiers you saved. Do not create a second invoice automatically after an HTTP 409 or a timeout.

Can general TIN values be used for any customer?

No. These values are for specific permitted cases; check the LHDN rules, especially for consolidated invoices and self-billed transactions.

What is the difference between a MySyncTax key and the LHDN Client ID?

The MySyncTax key and secret authenticate supported MySyncTax requests. LHDN's Client ID and Client Secret are separate credentials used with the official OAuth token service.

Can I call the MySyncTax invoice API directly from a website?

Use a trusted backend, because requests include a secret. A browser may call your own authenticated server endpoint, which then sends the protected request to MySyncTax.

Further reading

Official references and language guides

Use the vendor reference to confirm MySyncTax field names and endpoint behavior. Use the LHDN SDK to verify platform requirements and current document rules.

Last content revision: 9 October 2026. Verify vendor and LHDN documentation for changes before production rollout.

The following are starting points for server-side integration. They demonstrate JSON submission, request timeouts and error handling. Use your application's configuration to supply credentials; never hardcode production secrets in source control. The jQuery example calls your own backend, not the MySyncTax API directly.

Language Samples

JavaScript (jQuery)

Code example
// Browser example: send only to your OWN authenticated backend.

// Your backend adds MySyncTax credentials and calls the vendor API.

$.ajax({

  url: "/internal/invoices/submit",

  method: "POST",

  contentType: "application/json",

  data: JSON.stringify(invoiceData),

  success: function (data) { console.log(data); },

  error: function (xhr) { console.error("Submission failed", xhr.status); }

});

PHP (cURL)

Code example
<?php

$payload = [

  'mysynctax_key' => getenv('MYSYNCTAX_KEY'),

  'mysynctax_secret' => getenv('MYSYNCTAX_SECRET'),

  'invoice_no' => 'DEMO-INV-001',

  'sale_id_integrate' => 10001,

  'payment_note_term' => 'CASH',

  'items' => [[

    'item_id' => 1, 'sorting_id' => 1, 'invoiced_quantity' => 1,

    'unit_price' => 50, 'price_discount' => 0, 'tax_amount' => 0,

    'item_description' => 'Sample service'

  ]]

];

$ch = curl_init('https://mysynctax.com/v5/public/api/myinvois');

curl_setopt_array($ch, [

  CURLOPT_POST => true,

  CURLOPT_RETURNTRANSFER => true,

  CURLOPT_CONNECTTIMEOUT => 10,

  CURLOPT_TIMEOUT => 30,

  CURLOPT_HTTPHEADER => ['Content-Type: application/json'],

  CURLOPT_POSTFIELDS => json_encode($payload, JSON_THROW_ON_ERROR)

]);

$body = curl_exec($ch);

$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);

if ($body === false) { throw new RuntimeException(curl_error($ch)); }

curl_close($ch);

if ($status < 200 || $status >= 300) { throw new RuntimeException('HTTP ' . $status); }

$response = json_decode($body, true, 512, JSON_THROW_ON_ERROR);

// Save the safe identifiers and reconcile the final invoice status.

.NET C#

Code example
// .NET 6+ example: reuse HttpClient through dependency injection in production.

using System.Net.Http.Json;



using var client = new HttpClient { Timeout = TimeSpan.FromSeconds(30) };

var payload = new {

    mysynctax_key = Environment.GetEnvironmentVariable("MYSYNCTAX_KEY"),

    mysynctax_secret = Environment.GetEnvironmentVariable("MYSYNCTAX_SECRET"),

    invoice_no = "DEMO-INV-001",

    sale_id_integrate = 10001,

    payment_note_term = "CASH",

    items = new[] { new {

        item_id = 1, sorting_id = 1, invoiced_quantity = 1,

        unit_price = 50, price_discount = 0, tax_amount = 0,

        item_description = "Sample service"

    }}

};

using var response = await client.PostAsJsonAsync(

    "https://mysynctax.com/v5/public/api/myinvois", payload);

var body = await response.Content.ReadAsStringAsync();

response.EnsureSuccessStatusCode();

Console.WriteLine(body); // Redact sensitive invoice data in production logs.

VB.NET

Code example
' VB.NET / .NET 6+: use this inside an Async Function.

Using client As New HttpClient()

    client.Timeout = TimeSpan.FromSeconds(30)

    Dim payload = New With {

        .mysynctax_key = Environment.GetEnvironmentVariable("MYSYNCTAX_KEY"),

        .mysynctax_secret = Environment.GetEnvironmentVariable("MYSYNCTAX_SECRET"),

        .invoice_no = "DEMO-INV-001",

        .sale_id_integrate = 10001,

        .payment_note_term = "CASH",

        .items = {New With {

            .item_id = 1, .sorting_id = 1, .invoiced_quantity = 1,

            .unit_price = 50, .price_discount = 0, .tax_amount = 0,

            .item_description = "Sample service"

        }}

    }

    Dim response = Await client.PostAsJsonAsync(

        "https://mysynctax.com/v5/public/api/myinvois", payload)

    Dim body = Await response.Content.ReadAsStringAsync()

    response.EnsureSuccessStatusCode()

End Using

' Requires Imports System.Net.Http and System.Net.Http.Json.

Python

Code example
import os

import requests



payload = {

    "mysynctax_key": os.environ["MYSYNCTAX_KEY"],

    "mysynctax_secret": os.environ["MYSYNCTAX_SECRET"],

    "invoice_no": "DEMO-INV-001",

    "sale_id_integrate": 10001,

    "payment_note_term": "CASH",

    "items": [{

        "item_id": 1, "sorting_id": 1, "invoiced_quantity": 1,

        "unit_price": 50, "price_discount": 0, "tax_amount": 0,

        "item_description": "Sample service"

    }]

}

response = requests.post(

    "https://mysynctax.com/v5/public/api/myinvois",

    json=payload,

    timeout=(10, 30)

)

response.raise_for_status()

result = response.json()

# Persist returned document identifiers; check validation separately.

Java

Code example
// Java 11+ : jsonPayload must contain your server-side invoice JSON.

HttpClient client = HttpClient.newHttpClient();

HttpRequest request = HttpRequest.newBuilder()

    .uri(URI.create("https://mysynctax.com/v5/public/api/myinvois"))

    .header("Content-Type", "application/json")

    .timeout(Duration.ofSeconds(30))

    .POST(HttpRequest.BodyPublishers.ofString(jsonPayload))

    .build();

HttpResponse<String> response = client.send(

    request, HttpResponse.BodyHandlers.ofString());

if (response.statusCode() < 200 || response.statusCode() >= 300) {

    throw new IllegalStateException("HTTP " + response.statusCode());

}

System.out.println(response.body());

// Requires standard java.net.http, java.net.URI and java.time imports.

Node.js

Code example
// Node.js 18+ server-side only. Never bundle credentials into browser code.

const payload = {

  mysynctax_key: process.env.MYSYNCTAX_KEY,

  mysynctax_secret: process.env.MYSYNCTAX_SECRET,

  invoice_no: "DEMO-INV-001",

  sale_id_integrate: 10001,

  payment_note_term: "CASH",

  items: [{

    item_id: 1, sorting_id: 1, invoiced_quantity: 1,

    unit_price: 50, price_discount: 0, tax_amount: 0,

    item_description: "Sample service"

  }]

};

const response = await fetch(

  "https://mysynctax.com/v5/public/api/myinvois",

  { method: "POST", headers: { "Content-Type": "application/json" },

    body: JSON.stringify(payload), signal: AbortSignal.timeout(30000) }

);

if (!response.ok) throw new Error(`MySyncTax returned HTTP ${response.status}`);

const result = await response.json();

// Record identifiers; check final MyInvois validation separately.