MyInvoice Sync
Automated invoice submission to LHDN MyInvois system for Malaysian businesses.
Install in
MyInvoice Sync automatically generates and submits invoices to the LHDN (Lembaga Hasil Dalam Negeri) MyInvois system in compliance with Malaysian e‑invoicing regulations. It integrates with WooCommerce to submit invoices, validate customer TINs, and manage credit/refund notes.
Key features:
- Automatic invoice submission based on WooCommerce order status (completed, processing, or delayed “after X days”)
- UBL 1.0/1.1 invoice generation, with optional digital signatures (PEM) for UBL 1.1
- TIN capture and validation in user profile and WooCommerce “My Account”
- Background cron jobs for retries, delayed submissions, and status sync
- Credit note and refund note creation linked to original invoices
External Services
This plugin connects to third‑party external services operated by LHDN (Lembaga Hasil Dalam Negeri / Malaysian Inland Revenue Board). Users should be aware of this before use.
What the service is and what it is used for
The plugin uses the LHDN MyInvois API (official Malaysian government service) to:
- Submit invoices generated from WooCommerce orders
- Validate Tax Identification Numbers (TIN) for customers
- Retrieve invoice statuses and document details
- Cancel documents and submit credit/refund notes
Domains (where the service is hosted)
API and portal domains are selected based on environment:
- Sandbox (Pre‑Production)
- API:
https://preprod-api.myinvois.hasil.gov.my - Portal:
https://preprod.myinvois.hasil.gov.my
- API:
- Production
- API:
https://api.myinvois.hasil.gov.my - Portal:
https://myinvois.hasil.gov.my
- API:
What data is sent and when
- Invoice data — When an order reaches the configured status (completed/processing or after the chosen delay), the plugin sends:
- Invoice number, date, and monetary amounts
- Buyer information (name, TIN, ID type, ID value, address, contact details)
- Seller information (TIN, SST/TTX numbers, address, contact details)
- Line items (products, quantities, prices, descriptions)
- Tax information and industry classification codes
- TIN validation — When a user submits or updates their TIN in their profile/My Account, the plugin sends:
- Tax Identification Number (TIN)
- ID Type (e.g. NRIC, Passport, BRN)
- ID Value
- Status and document requests — Cron jobs and admin actions request invoice status and document details from the API.
- OAuth authentication — Client ID and secret are sent to the token endpoint to obtain and refresh OAuth access tokens.
Data is sent only when:
- Orders are submitted to LHDN (automatically or manually)
- Users explicitly validate their TIN details
- The plugin syncs invoice statuses or documents (via cron or on‑demand)
All communication with LHDN endpoints uses HTTPS and OAuth 2.0.
Service provider and policies
- Provider: Lembaga Hasil Dalam Negeri (LHDN / Malaysian Inland Revenue Board)
- Terms of use: https://myinvois.hasil.gov.my/terms
- Privacy policy: https://myinvois.hasil.gov.my/privacy
Written by Joobi from the project's own listing. See the source page
2.1.4
- New setting “Use WooCommerce Order Billing Details as Buyer Information”: buyer name, address, phone and email are taken from the order Billing details (profile only as fallback) and the Shipping address is never used as the buyer. Useful for agent/dropship stores. Off by default.
- Buyer TIN/ID continues to use the customer’s validated profile TIN.
- Invoices, credit notes, refund notes and resubmissions now share one buyer-details routine.
2.1.3
- Map WooCommerce Malaysian state codes (e.g. SGR, JHR, KUL) to the correct LHDN state codes; previously buyer states fell back to the seller state.
- Enforce TIN verification on the WooCommerce Checkout block and show the TIN status badge there.
- Declare compatibility with WooCommerce High-Performance Order Storage (HPOS) and Cart/Checkout blocks.
- Fix activation/deactivation hooks so scheduled cron events are cleared on deactivation.
- Use HPOS-aware order edit links and show the LHDN column on the legacy orders screen.
- Tested up to WordPress 7.1 and WooCommerce 11.3.
2.1.2
- Keep foreign buyers on normal e-commerce invoice flow (TIN EI00000000020) instead of consolidated mode.
- Use country-aware buyer state mapping to avoid sending Malaysian state codes for non-Malaysian countries (prevents CV316).
2.1.1
- Fix MyInvois CV317: buyer state code 17 (Not Applicable) is only sent for consolidated invoices; e-commerce and other types fall back to the configured seller state when the WooCommerce state is unknown.
2.1.0
- Improved nonce validation in user profile TIN save handler based on WordPress.org review feedback.
- Documented external LHDN API/portal services and domains in readme files.
2.0.12
- Maintenance and compatibility updates.
Follow this listing's changes (Atom feed)