# Tally XML Ledger Import Generator

> Source: https://netray.co/tools/tally-xml-ledger-import-generator
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: Free Tools

## Short answer

Build the Import Data XML that creates a customer or supplier ledger in Tally Prime with GST details.

## Category

developer

## Erp

Tally Prime

## Region

India

## Audience

- Tally developer
- Accountant
- ERP implementer

## Tool

**Kind:** template

**Output:** code

**Language:** xml

**Fields:**

#### Company name

**Key:** company

**Type:** text

**Default:** Sharma Engineering Works

#### Ledger name

**Key:** ledger

**Type:** text

**Default:** Kaveri Auto Components Pvt Ltd

#### Under group

**Key:** parent

**Type:** select

**Options:**

- Sundry Debtors
- Sundry Creditors

**Default:** Sundry Debtors

#### Address line

**Key:** address

**Type:** text

**Default:** Plot 14, Peenya Industrial Area

#### State

**Key:** state

**Type:** text

**Default:** Karnataka

#### Pincode

**Key:** pincode

**Type:** text

**Default:** 560058

#### GSTIN

**Key:** gstin

**Type:** text

**Default:** 29AABCK1234F1Z5

**Blocks:**

#### Import request

**Body:** <ENVELOPE>
  <HEADER>
    <TALLYREQUEST>Import Data</TALLYREQUEST>
  </HEADER>
  <BODY>
    <IMPORTDATA>
      <REQUESTDESC>
        <REPORTNAME>All Masters</REPORTNAME>
        <STATICVARIABLES>
          <SVCURRENTCOMPANY>{{company}}</SVCURRENTCOMPANY>
        </STATICVARIABLES>
      </REQUESTDESC>
      <REQUESTDATA>
        <TALLYMESSAGE xmlns:UDF="TallyUDF">
          <LEDGER NAME="{{ledger}}" ACTION="Create">
            <NAME>{{ledger}}</NAME>
            <PARENT>{{parent}}</PARENT>
            <ISBILLWISEON>Yes</ISBILLWISEON>
            <COUNTRYOFRESIDENCE>India</COUNTRYOFRESIDENCE>
            <LEDSTATENAME>{{state}}</LEDSTATENAME>
            <PINCODE>{{pincode}}</PINCODE>
            <PARTYGSTIN>{{gstin}}</PARTYGSTIN>
            <ADDRESS.LIST>
              <ADDRESS>{{address}}</ADDRESS>
            </ADDRESS.LIST>
          </LEDGER>
        </TALLYMESSAGE>
      </REQUESTDATA>
    </IMPORTDATA>
  </BODY>
</ENVELOPE>

**Notes:** Tag names and GST fields differ between Tally releases. Export an existing ledger with the export request generator and compare the tags before a bulk run. Always import into a test company first and take a backup.

## Content

**Intro:** When a business moves customers or vendors into Tally from Excel, creating ledgers one by one is slow. An XML import lets you create masters in bulk. This generator shows the structure for one party ledger, which you can repeat for every row.

**Sections:**

#### How to use it

**Body:** Fill the fields for one party and copy the XML. Post it to the Tally HTTP port, or save it as a file and use the Import option for masters in Tally. For a bulk load, repeat the LEDGER block inside TALLYMESSAGE for each row of your spreadsheet, using a short script or Excel formulas to build the text.

#### Structure explained

**Body:** The TALLYREQUEST value Import Data and the REPORTNAME All Masters tell Tally you are loading masters. Each LEDGER needs a name and a parent group. For GST the party GSTIN and state fill the registration details. ISBILLWISEON controls whether bill by bill outstanding is tracked, which is usually Yes for debtors and creditors.

**Bullets:**

- Parent group names must already exist in the company.
- Check the GSTIN with the validator tool before importing.
- State names must match the Tally state list.

#### Testing and rollback

**Body:** Take a data backup, import into a test company and compare ledger counts against your source. Tally replies with counts of created, altered and errored objects, and the error list tells you which names failed. Duplicate names are a common reason for failure.

#### Common mistakes

**Body:** Unescaped ampersands in party names, missing parent groups, extra spaces in names that create near duplicates, and invalid GSTINs that fail validation in a later e-invoice step.

**Cta:** For larger migrations from Tally to a full ERP, we can help assess data quality and plan the cutover with your implementation partner.

**Faq:**

#### Can I import ledgers from Excel into Tally?

**Answer:** Yes. Build the XML from your sheet rows with a script or formulas and import it, or use Tally's own import options for masters. Always test in a copy of the company first.

#### What does ACTION Create do?

**Answer:** It tells Tally to add a new ledger. If the name already exists the import reports an error, so use Alter only when you intend to change an existing master.

#### Do I need to escape special characters?

**Answer:** Yes. An ampersand in a party name must be written as &amp; and less-than signs as &lt; or the XML will be rejected.

#### Will this work for stock items?

**Answer:** Stock items use a STOCKITEM block with different tags such as a base unit and opening balance. Export an existing stock item first to see the exact tags for your release.

## Search terms

tally import ledger xml, create ledger in tally using xml, tally bulk ledger import, tally xml master import, tally party ledger gstin xml, tally import excel to xml, tally prime import masters, tally gst ledger xml

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
