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.
The LHDN platform performs asynchronous document validation. A successful API submission or accepted-document acknowledgement is not necessarily the final Valid state.
Quick start: submit your first request
- 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.
- Choose the correct workflow
Use the receipt QR endpoint for the documented POS workflow, or
/api/myinvois/invoicewhen your ERP supplies customer master data. Use a self-billed or note endpoint only where the underlying business transaction calls for it. - 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
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.
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.
| Operation | Method | Relative path | Use |
|---|---|---|---|
| Receipt QR / POS | POST | /api/myinvois | Receipt-based workflow |
| ERP invoice with customer | POST | /api/myinvois/invoice | Customer data in payload |
| Credit, debit or refund note | POST | /api/myinvois/note | Adjust earlier document |
| Self-billed invoice | POST | /api/myinvois/selfbill/invoice | Qualifying self-billing cases |
| Self-billed note | POST | /api/myinvois/selfbill/note | Adjust self-billed document |
| Customer master data | POST | /api/myinvois/add_customer | Create / update customers |
| General TIN invoice | POST | /api/myinvois/invoice_generaltin | Scenario-specific generic TIN |
| General TIN note | POST | /api/myinvois/invoice_generaltin/note | Adjust generic TIN invoice |
| General TIN self-billed | POST | /api/myinvois/invoice_generaltin/selfbill | Check eligibility and TIN |
| General TIN self-billed note | POST | /api/myinvois/invoice_generaltin/selfbill/note | Adjust self-billed general TIN |
| Supplier master data | POST | /api/myinvois/add_supplier | Create / update suppliers |
| Invoice PDF view | GET | /invoice/view/{mysynctax_uuid} | Rendered invoice document |
| Delete invoice | POST | /v5/api/myinvois/delete/{mysynctax_uniqueId} | Delete an invoice where its status allows |
| Cancel submitted document | POST | /api/v1/external/cancel-document/{unique_id} | Time-limited cancellation |
| Send invoice email | POST | /api/invoice/send-email | Email invoice link |
MySyncTax API authentication
Most JSON submission endpoints in the provided MySyncTax reference authenticate using two fields in the request body:
| JSON key | Meaning | Security guidance |
|---|---|---|
mysynctax_key | Integration identifier issued to your account | Keep in server-side configuration |
mysynctax_secret | Secret paired with the integration key | Never expose in browser JavaScript, mobile apps, Git or logs |
{
"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.
/connect/token endpoint, or assume an LHDN access token authenticates this middleware. See LHDN taxpayer authentication.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.
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.
{
"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
}
]
}
Send Data
Submit data using the following endpoint:
POST https://mysynctax.com/v5/public/api/myinvoisKey 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.
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
{
"status": "ok",
"mysynctax_uuid": "generated-unique-id",
"qr_url": "https://mysynctax.com/v5/public/redirect/9QqIe39"
}
Duplicate
{
"status": "duplicate_ignored",
"mysynctax_uuid": "existing-unique-id"
}
Unauthorized
{
"status": "unauthorized",
"message": "Invalid mysynctax_key or mysynctax_secret"
}
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 Code | Description |
|---|---|
| 400 | Invalid or malformed JSON |
| 401 | API key or secret missing/invalid |
| 409 | Duplicate invoice submission |
| 500 | Server processing error |
ERP - Invoice (With Customer)
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
{
"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
{
"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
}
}isAutoToLHDN behavior with the MySyncTax configuration.Credit Note / Debit Note / Refund
POST https://mysynctax.com/v5/public/api/myinvois/note
Used to submit adjustments for invoices that have already been submitted to LHDN.
Request 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
{
"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
}
}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 Code | Description |
|---|---|
| 400 | Invalid or malformed JSON |
| 401 | API key or secret missing/invalid |
| 404 | Invoice UUID not found |
| 409 | Duplicate submission |
| 422 | Item mismatch |
| 500 | Server 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.
Request 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
{
"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
}
}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.
Request 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
{
"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
}
}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.
Request 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 |
|---|---|
| Johor | 01 |
| Kedah | 02 |
| Kelantan | 03 |
| Melaka | 04 |
| Negeri Sembilan | 05 |
| Pahang | 06 |
| Pulau Pinang | 07 |
| Perak | 08 |
| Perlis | 09 |
| Selangor | 10 |
| Terengganu | 11 |
| Sabah | 12 |
| Sarawak | 13 |
| Wilayah Persekutuan Kuala Lumpur | 14 |
| Wilayah Persekutuan Labuan | 15 |
| Wilayah Persekutuan Putrajaya | 16 |
| Not Applicable | 17 |
Response Example
{
"status": "ok",
"message": "Customers processed successfully",
"results": [
{
"tin_no": "EI00000000010",
"status": "created",
"id_customer": 93
}
]
}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
{
"identification_no": "NA",
"identification_type": "BRN"
}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
POST https://mysynctax.com/v5/public/api/myinvois/invoice_generaltin
Payload
{
"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
{
"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
}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
POST https://mysynctax.com/v5/public/api/myinvois/invoice_generaltin/note
Payload
{
"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
{
"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
}General TIN Self-Billed Invoice
POST https://mysynctax.com/v5/public/api/myinvois/invoice_generaltin/selfbill
Payload
{
"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
{
"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
}
}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
POST https://mysynctax.com/v5/public/api/myinvois/invoice_generaltin/selfbill/note
Payload
{
"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
{
"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
}
}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.
Request 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
{
"status": "ok",
"message": "Supplier processed successfully",
"results": [
{
"tin_no": "EI00000000010",
"status": "updated",
"id_customer": 93
}
]
}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
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
https://mysynctax.com/v5/public/invoice/view/5a59f5ba7a4f65b47b844ae6671c833c0d5c8b16
How to Use
- Step 1: Submit invoice via API
- Step 2: Get
mysynctax_uuidfrom response - Step 3: Open the PDF using this endpoint
Sample Usage
Open in Browser
window.open("https://mysynctax.com/v5/public/invoice/view/" + mysynctax_uuid);
Download using PHP
$pdfUrl = "https://mysynctax.com/v5/public/invoice/view/" . $mysynctax_uuid;
header("Location: " . $pdfUrl);
exit;
Download using JavaScript
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
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
| Parameter | Type | Description |
|---|---|---|
mysynctax_unique_id | String | Unique identifier of the invoice to delete, passed in the URL. |
mysynctax_key | String | Integration API key assigned to your company. |
mysynctax_secret | String | Integration 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
| Parameter | Type | Description |
|---|---|---|
success | Boolean | Indicates whether the deletion request succeeded. |
message | String | Result or reason the request was rejected. |
unique_id | String | Unique identifier of the requested invoice. |
invoice_no | String | Invoice number associated with the request. |
submission_status | String | Current LHDN submission status of the invoice. |
Important notes
- Use the
POSTmethod and include the invoice unique ID in the URL. - Both
mysynctax_keyandmysynctax_secretare 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
POST https://mysynctax.com/v5/public/api/v1/external/cancel-document/{unique_id}
Payload
{
"mysynctax_key": "YOUR_MYSYNCTAX_KEY",
"mysynctax_secret": "YOUR_MYSYNCTAX_SECRET",
"reason": "Wrong item quantity entered"
}Response (Success)
{
"success": true,
"message": "Document cancelled on LHDN via External API and status reset."
}Response (Error - Outside 72 Hours)
{
"success": false,
"message": "Failed: 72-hour cancellation window has expired."
}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
POST https://mysynctax.com/v5/public/api/invoice/send-email
Payload
{
"mysynctax_uuid": "5a59f5ba7a4f65b47b844ae6671c833c0d5c8b16"
}Note: You can pass either the LHDN UUID or the internal unique_id as the parameter.
Response (Success)
{
"success": true,
"message": "Email sent to customer@email.com ",
"link": "https://mysynctax.com/v5/public/invoice/view/5a59f5ba7a4f65b47b844ae6671c833c0d5c8b16"
}Response (Error)
{
"success": false,
"message": "Customer does not have an email address."
}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.
| Field | What it represents in the examples |
|---|---|
sale_id_integrate | Your ERP or POS transaction reference |
invoice_no | Business-facing invoice number |
mysynctax_uuid | MySyncTax identifier returned by the vendor integration |
result.original.submissionUid | LHDN submission UID, where the response exposes one |
result.original.acceptedDocuments[].uuid | MyInvois document UUID for accepted records, where exposed |
Recommended processing flow
- Check HTTP status and vendor-specific success/error response.
- Store your invoice number, internal transaction ID and returned identifiers.
- Check whether the document was accepted for further LHDN processing or rejected in the submission result.
- Reconcile the final
Submitted,Valid,InvalidorCancelledstatus by a supported vendor workflow or the official MyInvois API when authorised. - Use final validation results before telling downstream systems that an e-Invoice is valid.
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
429conservatively; 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.
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.
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)
// 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)
<?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#
// .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
' 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
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
// 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
// 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.