# HSN Code Error in Purchase Import

**YouTube:** [HSN CODE DOES\`NT EXIST IN DATABASE ERROR DURING PURCHASE IMPORT](https://www.youtube.com/watch?v=88aLgFlwJ7U\&t=13s)

## HSN CODE DOES\`NT EXIST IN DATABASE ERROR DURING PURCHASE IMPORT

This tutorial covers how to troubleshoot and resolve common errors encountered while importing **purchase vouchers** from external files (e.g., Excel or CSV) into **Logic ERP**.

***

### **Issue Overview**

* **Scenario:** Importing purchase data from an external file.
* **Error:** *"Invalid Document: {Yes}"* – usually due to **missing or undefined HSN codes**.
  * **Note:** You can also read the **Invalid Remarks** to understand the reason behind the error or why the purchase import is not working.
* **Objective:** Fix the error and complete the import process successfully.

***

### **Step-by-Step Process**

**1. Begin Import Process**

* Navigate to the Utilities\Import Masters/Transactions from External Filesand click on **"Import Purchase Vouchers From External File".**

**2. Select and Load the File**

* Click **Browse** and choose your Excel or CSV file.
* Select the appropriate **sheet**.
* Click **Refresh** to load the file.

<figure><img src="/files/0uFVmn4IvAMTTGESR9bE" alt=""><figcaption></figcaption></figure>

***

### **Identifying the Import Error**

* In the **Header Details** section:
  * If the **Invalid Document** column displays "YES", there is an error.
* Go to **Item Details Grid**.
* Scroll right to locate the **Invalid Remarks** column.

**Example Error:**

* *“HSN code does not exist in database”*

<figure><img src="/files/umpFFApxrFJT1lXM3Wuj" alt=""><figcaption></figcaption></figure>

***

### **Fixing the HSN Code Issue**

**Option 1: Import HSN Codes from Excel**

* Navigate to: **Setup** and click on **Setup Items.**
* Select **Setup Harmonious Code Descriptions.**
* Click **Retrieve from Excel**
* Use the **Help** option to check required columns (first two marked with `*` are mandatory)
* Browse and select your HSN Excel file

<figure><img src="/files/S7Hka8tqZ018Qc0oSYae" alt=""><figcaption></figcaption></figure>

* Choose the sheet and click **Refresh**
* Click **Save** to import HSN codes

**Option 2: Manually Create HSN Code**

* Complete the fields as outlined below:
  * **Harmonious Serial Number**
  * **Harmonious Code**
  * **Description**

<figure><img src="/files/q1lXD07L8w4ah2LCAgb9" alt=""><figcaption></figcaption></figure>

* Click on **Save**

***

### **Re-Attempt the Purchase Import**

* Repeat import steps:
  * Browse the same file
  * Select the correct sheet
  * Click **Refresh**
* The **Invalid Document** column should now display **"No"**

<figure><img src="/files/4Qt6vsTjoeZbBttao5vR" alt=""><figcaption></figcaption></figure>

***

### Finalize the Import Process

1. Enter the **Account Name**
2. Select the **Godown** where stock will be added
3. Click **Save**
4. A confirmation message will appear – click **Yes** to proceed
5. Wait while the bill is imported
6. A summary window will show the **bill total**
7. Click **Save** to finalize

<figure><img src="/files/Fl1AhJLfaWZaRYvT1MOG" alt=""><figcaption></figcaption></figure>

***

### Validate Imported Transaction

* Navigate to: **Purchase Voucher Window**
* Use **Modify/Search** to locate the imported bill
* Review and confirm all details are correct

<figure><img src="/files/bM54KuAJO4xfiqaIPsA9" alt=""><figcaption></figcaption></figure>

***

### **Need More Help?**

If the issue persists:

* Double-check all HSN codes are correctly defined
* Ensure formatting and column headers match import requirements
* Submit a [**support ticket**](/logic-erp-installation-configuration-and-troubleshooting-solutions/troubleshooting/support-tickets.md) if further assistance is needed


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://kb.logicerp.com/logic-erp-installation-configuration-and-troubleshooting-solutions/troubleshooting/purchase/hsn-code-error-in-purchase-import.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
