# Send MyInvois e-invoices from WooCommerce

> Use the e-Invoice for MyInvois LHDN plugin so customers can request an e-invoice for paid Bayarcash orders in your WooCommerce shop.
>
> Source: https://docs.bayarcash.com/myinvois-e-invoice/

The e-Invoice for MyInvois LHDN plugin lets your WooCommerce customers request an official e-invoice for an order they paid through Bayarcash. It sends the e-invoice to LHDN MyInvois through Submit eInvoice. Use it if your business must issue e-invoices.

## Before you start

You need the following:

- A WooCommerce shop that already takes payments with the [Bayarcash WooCommerce plugin](/woocommerce/). The e-invoice plugin only works with Bayarcash payment methods.
- A Submit eInvoice account. Its **API Secret Key** is different from your Bayarcash keys. You do not need a Bayarcash token or portal key for this plugin.
- Your company details, including your Tax Identification Number (TIN) and MSIC code.

## Install the plugin

The plugin is on WordPress.org as e-invoice-for-myinvois-lhdn. To install it:

1. In WordPress, go to **Plugins** and search for "e-Invoice for MyInvois LHDN", or upload the plugin zip.
2. Click **Activate**.
3. Make sure WooCommerce and the Bayarcash WooCommerce plugin are also active.

## Connect and set up your company

The setup is one page. Work down it from the top.

1. Go to **MyInvois** → **Settings**.
2. Under **API Configuration**, paste your key into **API Secret Key**. Use **Go to Profile** if you need to find it in your Submit eInvoice profile.
3. Click **Save API Key**, then **Test Connection**. A green **Ready for E-Invoice Submission** box means the connection works.
4. Fill in **Company Information**: company name, email, mobile number, identification scheme and number, **TIN**, **MSIC Code**, **Business Activity Description** and **Default Product Classification Code**. **SST Registration Number** and **Tourism Tax Registration Number** are only for businesses that have them.
5. Fill in **Company Address**.
6. Click **Save Settings**.

If a required field is empty, the page shows **Missing Required Information** and lists what is missing.

> **Tip**
> Beside **TIN**, the search button finds your TIN from your identification details. Fill in the API Secret Key and identification fields first.

## Set product classification codes

Each product needs a classification code for MyInvois. To set it:

1. Open a product in WooCommerce and go to its **E-Invoice** section.
2. Leave **Use Global Classification Code** on to use your default code, or turn it off and choose a **MyTax Classification Code** for this product.

## How your customer requests an e-invoice

After a paid order, the customer's order details page shows **E-Invoice Available** with a **Request E-Invoice** button. They fill in their buyer details and identification, then submit. You can follow each one under **MyInvois** → **Invoices**, or in the **E-Invoice Details** box on the order, where **Check Status** refreshes the result.

## Tips

- **Tell customers about the 90-hour limit.** MyTax rules give them 90 hours from the order date to request an e-invoice.
- **Turn on Enable Logging only while fixing a problem.** It records API requests, which helps support find the cause.

## Common issues

### The MyInvois settings page shows Plugin Dependencies Required. What do I do?

Install and activate both WooCommerce and the Bayarcash WooCommerce plugin, then open MyInvois → Settings again. The plugin does not work without them.

### My customer says the e-invoice link has expired.

A customer can request an e-invoice only within 90 hours (3.75 days) of the order date. After that the order page shows E-Invoice Request Expired.

### The Test Connection button fails. What should I check?

Check that you pasted the API Secret Key from your Submit eInvoice profile, not a Bayarcash key, and that all the required company fields are filled in.
