Skip to content
← LHDN e-invoice rejection codes: what they mean and how to fix them

LHDN error CV317: state code 17 used on a Malaysian address

Updated 18 October 2026

Short answer

CV317 means a Malaysian address on the document uses state code 17 (Not applicable). LHDN reserves code 17 for foreign addresses and consolidated e-invoices. Pick the real state, codes 01 to 16, on the buyer or shipping address and submit again.

What LHDN's message says

CV317 (Code validator): “State Code 17 should be used for Consolidated e-Invoice and non-Malaysian address only - {0}” Read LHDN's guidance for CV317

What it means

Every address on an e-invoice carries a code from LHDN's state code list. Codes 01 to 16 are the Malaysian states and federal territories, for example 10 for Selangor and 14 for Wilayah Persekutuan Kuala Lumpur. Code 17 means Not applicable: it is for an address outside Malaysia, or for the general public buyer on a consolidated e-invoice.

Why it happens

It can appear when a buyer's state was left blank and a system filled in 17 as a default, or when a placeholder address from a consolidated document was reused for a named buyer.

LHDN lists these causes:

  • State Code 17 is reserved for non-Malaysian addresses and consolidated e-Invoice scenarios.
  • The submitted document uses State Code 17 in an unsupported scenario.

How to fix it

  1. Open the rejected document and check the buyer address and, if there is one, the shipping address.
  2. For a Malaysian address, pick the real state (codes 01 to 16).
  3. Keep code 17 only for a foreign address or a consolidated e-invoice.
  4. Submit the corrected document as a new e-invoice.

LHDN's recommended resolution:

  • Verify whether the transaction is a consolidated e-Invoice.
  • For Malaysian addresses, use State Codes 01-16 as applicable.
  • Use State Code 17 only for foreign addresses or approved consolidated invoice scenarios.

How envoice handles it

When LHDN rejects a document, envoice shows a Rejection reason box on it. Each line names the field at fault, explains the cause in plain language, gives the fix where envoice knows it, and quotes LHDN's own sentence with a link to LHDN's guidance for that code. The explanation is shown in English or Bahasa Melayu.

For this code, envoice's rejection reason reads: State code 17 (Not applicable) was used on a Malaysian address. It is only for a consolidated e-Invoice or a foreign address. Pick the real state on the buyer or shipping address, then resubmit.

Click Fix & resubmit to open the invoice form prefilled from the rejected document, correct the field, and submit it as a new e-invoice. The shop owner also gets one email when a document is rejected, so a rejection is not discovered weeks later. See Why was my document rejected?

Related codes

Try envoice free, no credit card

Frequently asked questions

What does LHDN error CV317 mean?

CV317 means a Malaysian address on the document uses state code 17 (Not applicable). LHDN reserves code 17 for foreign addresses and consolidated e-invoices. Pick the real state, codes 01 to 16, on the buyer or shipping address and submit again.

When can I use state code 17?

Only for an address outside Malaysia, or for a consolidated e-invoice. LHDN rejects code 17 on any Malaysian address.

Which address does CV317 point to?

LHDN's error includes the path of the field at fault. In envoice the rejection reason names it, for example Buyer state code or Shipping state code.

Sources