Tally integration

Send Tally invoices to FBR, without leaving Tally

For traders, distributors and manufacturers who keep their books in TallyPrime or Tally.ERP 9 and now need to file every sales invoice with FBR. Your accountant keeps working in Tally. The FBR work happens alongside it.

Updated

eInvoicePro API documentation: eInvoicePro receives invoices read from Tally and files them with FBR

The starting point

Why Tally needs a different approach

Cloud accounting systems can announce a new invoice the moment it is saved. Tally can’t. That one difference shapes every good way of connecting it to FBR.

Tally is a desktop program. Its company data sits in files on a PC or a server in your office. It cannot tell another system that something has changed. But it does have a built-in gateway. Switch on its client/server setting, and Tally answers requests from your local network. By default it uses port 9000, and it replies with vouchers, ledgers and stock items as XML. Any program that wants Tally’s invoices has to come and ask for them.

The second difference is what the file holds. Tally does have a place for HS codes, but it only comes with Tally’s GST tax features, which Pakistani installations don’t use. So a standard Pakistani Tally company has no field for an HS code, a sale type or an SRO reference. Those are the things FBR checks first. Tax is posted once per voucher, to a ledger under Duties & Taxes, while FBR wants the tax worked out on every line.

Put those together and a Tally-to-FBR connection has three jobs, not one:

  1. Read the invoice out of Tally (the sales voucher, its lines, the party ledger and the stock items it uses) without changing anything inside Tally.
  2. Add what Tally doesn’t hold: the HS code, sale type, rate and FBR unit for each item, and the buyer’s registration type and province. These come from a list you set up once that matches each Tally item and customer to FBR’s fields (the “mapping”).
  3. Send each invoice to FBR on its own, check the answer line by line, and save the FBR invoice number and QR code with the voucher it belongs to.

eInvoicePro does the third job. It takes invoices in FBR’s own format and can check a single invoice with FBR without submitting it. It files the rest and returns each one’s FBR number, or a clear reason for any rejection. The first two jobs are about your Tally data, so most of this guide covers them.

What “real time” means for a Tally business

FBR expects each invoice to be sent as it is created, one at a time. The only exception is offline mode: invoices issued during an outage must be uploaded within 24 hours of the service coming back. Some habits work for monthly returns, like collecting invoices in Tally all week and dealing with tax at the end. They do not fit this rule. Whichever route you choose below, ask how close to the moment of invoicing it runs.

You don’t need to replace Tally, upgrade to a new edition, or let an outside system change your company file. Other software only ever reads from Tally.

The data

What Tally holds, and what FBR still needs

Every FBR invoice has a header (who is selling, who is buying, and when) and one entry per line. Here is where each piece comes from in a standard Pakistani Tally company.

FBR invoice fields and where the data sits in Tally
What FBR asks for Where it sits in Tally What to do about it
Your NTN or CNIC Company details: many businesses type the NTN into the income-tax number field Confirm it once; send digits only, with no dashes or spaces
Buyer NTN or CNIC Party ledger: the income-tax number field, if someone filled it in Free text, so check it. An STRN typed here, with its punctuation removed, can look like a 13-digit CNIC
Buyer registration type Nowhere: Tally has no such field Look it up with FBR once per customer and save it with that customer’s FBR details
Buyer province Party ledger state field: free text, and blank for many customers; addresses have no city field Match it to one of FBR’s provinces; FBR rejects a city name such as “Karachi”
Invoice number Voucher number: unique within a voucher type, not across the whole company Use a number series FBR accepts: letters, digits and hyphens only
HS code Nowhere in a standard set-up: Tally’s HS code field only comes with its GST features, which aren’t used in Pakistan Set it once per stock item or stock group, from FBR’s own list
Sale type and rate Not on each line: tax is posted once per voucher to a Duties & Taxes ledger Set the sale type per item; the rate comes from FBR’s rate list for that sale type and date
SRO schedule and item serial Nowhere Only needed for reduced, exempt or special rates; set it with the item’s sale type
Unit of measure The stock item’s base unit, such as “Kgs” or “Nos” Change it to FBR’s wording; the units FBR accepts depend on the HS code
Quantity and value excluding tax Inventory lines on the voucher: the billed quantity, and an amount with the discount already taken off Read the billed (not actual) quantity; flip the minus sign, since Tally stores sales as credits
Sales tax on each line One tax entry for the whole voucher Split it across the lines so they still add up to the voucher total

Some Tally companies are customised with extra fields. Look at what yours holds first, then fill only the gaps.

Your options

Three ways to send Tally invoices to FBR

The right route depends mostly on two things: how many invoices you raise a day, and whether someone on your team can look after a small program on the office network.

1. Raise the FBR invoice in eInvoicePro

Keep Tally for your books and create the tax invoice in eInvoicePro’s invoicing screens. They check the buyer, work out the tax on each line and return the FBR number and QR code on the spot.

Best when: you raise fewer than about twenty invoices a day and would rather not build anything.

Downside: each invoice is typed twice, once for FBR and once in Tally.

2. Prepare invoices from Tally in bulk

Export your sales register from Tally into eInvoicePro’s bulk template, where every row is checked before anything reaches FBR. Only the preparation is done in bulk: each invoice is still sent to FBR on its own.

Best when: you invoice in batches, such as a dispatch run, at fifty or more a day.

Downside: someone has to run the file each time, and it only meets the real-time rule if it runs as you invoice.

3. Connect a reader to Tally’s gateway

A small program on your network asks Tally for new sales vouchers every few minutes, adds the missing FBR details, and sends each invoice to eInvoicePro’s API. Nothing is installed inside Tally, and the FBR number is saved with the voucher it belongs to.

Best when: your volume is steady, you invoice all day, or you run several Tally companies.

Downside: it has to be set up for your Tally companies and kept running.

Where should you start?

Routes 1 and 2 need nothing built, so start there. Route 3 pays off once your volume, or the effort of re-running files, makes automation worth it. The FBR details you set up for route 2 (HS codes, sale types and units for each stock item) are exactly what route 3 needs. None of that work is lost when you switch.

Using Tally? Book a demo

See how eInvoicePro sends invoices to FBR, and bring your questions about using it alongside Tally.

The real work

Fill the gaps once, not on every invoice

Most of the gap between Tally and FBR is in your stock item and customer lists. Fill it there, and each new invoice needs nothing extra.

Stock items: HS code, sale type and unit

Every stock item on a sales invoice needs an HS code from FBR’s own list, a sale type, and FBR’s name for its unit. Tally’s stock groups and categories make this easier. If every item in a group such as “Mechanical Seals” shares an HS code and sale type, set it once on the group. Then change single items only where they differ. A new item added to that group then works on its first invoice, instead of holding up the run.

Two warnings from FBR’s side. First, the HS code must be one FBR recognises. Store it as text, exactly as FBR’s list shows it, because a number field drops the leading zero on chapters 01 to 09. Second, FBR does not check that the code really describes what you sold. So the choice of code belongs to someone who knows the product; it is not a guess for software to make. Our guide to PCT and HS codes shows where to find the official list.

Units need changing too. Tally’s “Kgs” is not FBR’s “KG”, and “Nos” is not an FBR unit at all. The units FBR accepts also depend on the HS code. So check each unit against FBR’s list for that code, rather than setting one rule for the whole company.

Customers: registration type and province

For every party ledger you invoice, FBR needs the buyer’s NTN or CNIC in digits only, whether they are a registered or unregistered buyer, and their province. You can look up the registration type from FBR using the number. The province has to be read from the address and set once. Get this right before going live, because a wrong buyer type changes the tax FBR expects on the invoice.

Voucher types: which ones count

Tally’s default sales voucher type is called “Sales”, but many companies create their own, such as “Sales – Karachi”, “Export Sales” or “Sales (Cash)”. Decide clearly which voucher types are FBR sales invoices, which are notes, and which must be left out. Leave out cancelled and optional vouchers, stock journals and branch transfers, since FBR refuses an invoice where the buyer is the seller.

Watch these

Where Tally integrations quietly go wrong

None of these shows an obvious error. Most give you an invoice that looks fine but is wrong, or no invoice at all and no reason why.

Reading the data

  • A misspelt company name can return nothing instead of an error, so it looks like “no invoices today”
  • Tally only shares data for the companies that are open in it right now
  • An open pop-up box on the Tally PC can freeze every request
  • Single-line invoices can go missing if the reader expects every voucher to have several lines

Amounts and quantities

  • Sales are stored as credits, so amounts come out negative
  • Quantities come with their unit inside the value, such as “100 Kgs”
  • Billed quantity and actual quantity differ when delivery differs from billing
  • Tax posted once per voucher must be split across lines without changing the total

IDs and what to include

  • Leading zeros disappear if an ID is stored as a number
  • Cancelled and optional vouchers must be left out
  • Your own sales voucher types are missed if only “Sales” is read
  • Names and addresses can come through with garbled characters unless the text encoding is handled

Catch them before FBR does

Each of these comes from the way Tally stores and shares its data, and each one can be checked. Before going live, run a week of real vouchers through FBR’s validation check. It checks an invoice exactly as a live submission would, without filing anything. Then compare the totals with Tally’s own sales register. If they don’t match to the rupee, something in the list above is the reason. Our technical guide to these traps shows how to handle each one.

Security

Keep Tally’s gateway on your own network

Tally’s gateway has no password. Anything that can reach it can read your whole company file. So where the connection runs really matters.

Avoid

Opening Tally to the outside

  • Forwarding port 9000 on the office router so a cloud service can reach Tally
  • Leaving the gateway reachable from guest Wi-Fi or other offices
  • Sharing one Tally PC’s login between the connection and staff
  • Any set-up that needs Tally to accept traffic from the internet
Prefer

Read inside, send out

  • The reader runs on a computer on the same network as Tally
  • It only makes outgoing connections, to eInvoicePro over HTTPS
  • Tally’s port stays closed to the internet
  • FBR credentials stay in eInvoicePro, never on the Tally PC

Going live

A realistic four-week plan

The API itself is quick to connect. The time goes on filling in the FBR details and proving them in FBR’s test system (the sandbox).

  1. Week 1

    Add what Tally doesn’t hold

    List every stock item sold in the last few months. Give each one an HS code, sale type and FBR unit, by stock group where you can. Set the registration type and province for every customer you invoice. Decide which voucher types are FBR sales invoices.

  2. Weeks 2–3

    Prove it in FBR’s test system

    FBR gives each business its own set of test cases (never all 28, at most 15). Each test case has a code that you use only while testing. Run real Tally vouchers through them. Once your test invoices pass, FBR issues your live token automatically.

  3. Week 4

    Run both side by side

    Keep invoicing in Tally as normal while FBR also checks every voucher. Compare totals with Tally’s sales register every day and fill gaps as they appear. New stock items cause most of them.

  4. Go live

    File every invoice as it is raised

    Switch to live submission. Watch the first days closely. Each failure comes back on its own invoice with FBR’s reason, and you resend just that invoice instead of re-running the whole day.

Tally operator or accountant

Keeps stock items, party ledgers and vouchers accurate, since everything else is built from them. Decides the HS code and sale type for each item.

IT or your Tally partner

Switches on Tally’s gateway for the local network only, runs the reader or the bulk file, and watches for failed invoices after going live.

eInvoicePro

Checks every invoice against FBR’s lists, files it with FBR and returns FBR’s invoice number and QR data for the Tally invoice. Our team helps you set it up.

FAQ

Frequently Asked Questions

Still have a question?

Ask our team on WhatsApp. Tell us what you sell and where, and we will point you to the right setup.

Ask on WhatsApp
Does Tally connect to FBR digital invoicing on its own?

No. Tally has no built-in FBR connection. A standard Pakistani Tally file also doesn’t hold the HS code, sale type or FBR unit that FBR checks on every line. To get invoices to FBR, you read them from Tally and add that information from FBR details you set up once. Then you send each invoice on its own through eInvoicePro.

Is there an eInvoicePro plug-in to install inside Tally?

No, and you don’t need one. Nothing is installed inside Tally. Invoices reach eInvoicePro in one of two ways: through the bulk template, or through a small reader program on your network that asks Tally’s gateway for new vouchers. The reader is set up for your Tally companies. Which one fits depends on your volume, and we can talk it through with you in a demo.

Does it work with both TallyPrime and Tally.ERP 9?

Yes. Both answer the same kind of XML request through their gateway, so the approach is the same. How your company file is set up matters more than the edition: your own voucher types, your stock groups, and whether anyone has added extra fields.

Do we have to turn on GST in Tally to store HS codes?

No. Tally’s GST features are built for a GST tax system, not Pakistan’s sales tax. Switching them on just to hold HS codes brings a lot you don’t want. Instead, keep the HS code, sale type and FBR unit with your FBR details, alongside Tally.

Can we export from Tally once a day and send everything together?

No. FBR expects each invoice to be sent as it is created, not collected and sent later. So a daily export is a compliance risk, not a shortcut. Even in bulk, eInvoicePro sends each invoice on its own. The aim is to run it as close to the moment of invoicing as your process allows.

We have several Tally companies. Does each need its own setup?

Each company needs its own FBR details, because stock items and customers differ. The filing side does not. One eInvoicePro account can hold FBR credentials for several NTNs, and a single batch can include invoices from different sellers.

What happens to the FBR invoice number?

It comes back for every accepted invoice, with the data for the QR code. Save it with the Tally voucher it belongs to. The buyer, FBR and any auditor will ask for it, and it proves the invoice was filed.

Can we correct or cancel an FBR invoice from Tally?

No. FBR’s API cannot cancel or edit an invoice, so corrections happen in FBR’s own system. A real mistake is corrected within 72 hours of the invoice. After that, it needs the Commissioner’s approval. Changing the voucher in Tally does not change FBR’s copy.

Ready to simplify your FBR digital invoicing?

Join 2000+ businesses that use eInvoicePro to make invoices and send them to FBR.

Chat with us