Tally integration
Getting 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 every sales invoice filed with FBR. Your accountant keeps working in Tally; the FBR-specific work happens alongside it.

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, and that one difference shapes every sensible way of connecting it to FBR.
Tally is a desktop program. Its company data lives in files on a PC or a server in your office, and it has no way to tell another system that something has changed. What it does have is a built-in gateway: switch on its client/server setting and Tally will answer structured requests on your local network, usually on port 9000, returning vouchers, ledgers and stock items as XML. Anything that wants Tally’s invoices has to come and ask for them.
The second difference is what the file contains. 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 in a typical Pakistani Tally company there is simply no field holding an HS code, a sale type or an SRO reference — the things FBR checks first. Tax is usually posted once per voucher against 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:
- 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.
- 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, from a mapping you set up once.
- Send each invoice to FBR individually, check the answer line by line, and keep the FBR invoice number and QR code against the voucher it belongs to.
The third job is where eInvoicePro sits. It takes invoices in FBR’s own payload shape, can validate a single invoice against FBR without submitting it, files the rest and returns each one’s FBR number or a typed reason for rejection. The first two jobs are about your Tally data, which is why the rest of this guide spends most of its time there.
What “real time” means for a Tally shop
FBR expects each invoice to be transmitted as it is generated, one at a time, and treats offline mode as the only tolerance — invoices issued during an outage must be uploaded within 24 hours of service returning. A habit that works for monthly returns, such as collecting invoices in Tally all week and dealing with tax at the end of it, does not fit that rule. Whichever route you choose below, the question to ask is how close to the moment of invoicing it runs.
Nothing on this page requires you to replace Tally, upgrade to a new edition, or give an outside system write access to your company file. Tally is only ever read from.
The data
What Tally holds, and what FBR still needs
Every FBR invoice has a header (who is selling, who is buying, when) and one entry per line. This is where each piece usually comes from in a Pakistani Tally company.
| What FBR asks for | Where it usually 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 bare digits 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 stripped can look like a 13-digit CNIC |
| Buyer registration type | Nowhere — Tally has no such field | Look it up from FBR once per customer and keep it in the mapping |
| Buyer province | Party ledger state field — free text and often blank; addresses have no city field | Map to one of FBR’s provinces; a city name such as “Karachi” is rejected |
| Invoice number | Voucher number — unique within a voucher type, not across the company | Use a series FBR accepts: letters, digits and hyphens only |
| HS code | Usually nowhere — Tally’s HS code field only comes with its GST features, which aren’t used in Pakistan | Set once per stock item or stock group, from FBR’s own list |
| Sale type and rate | Nowhere per line — tax is posted once per voucher to a Duties & Taxes ledger | Set the sale type per item; the rate follows from FBR’s lookup for that sale type and date |
| SRO schedule and item serial | Nowhere | Only needed for reduced, exempt or special rates — set with the item’s sale type |
| Unit of measure | Stock item base unit, e.g. “Kgs” or “Nos” | Translate to FBR’s wording; the units FBR accepts depend on the HS code |
| Quantity and value excluding tax | Inventory lines on the voucher — billed quantity, amount already net of discount | Read billed (not actual) quantity; flip the sign, since Tally stores sales as credits |
| Sales tax on each line | One tax entry for the whole voucher | Apportion across lines so they still add up to the voucher total |
“Usually” matters here: a Tally company can be customised with extra fields, and some are. Check what yours actually holds before you design around it.
Your options
Three ways to send Tally invoices to FBR
The right route depends mostly on how many invoices you raise a day and whether anyone on your side can look after a small piece of software 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, which check the buyer, work out the tax per line and return the FBR number and QR code on the spot.
Fits when: you raise fewer than about twenty invoices a day and would rather not build anything.
Trade-off: the invoice is typed twice — once for FBR, once in Tally.
2. Prepare invoices from Tally in bulk
Pull your sales register out of Tally into eInvoicePro’s bulk template, where every row is checked before anything reaches FBR. The bulk part is the preparation, not the transmission — each invoice is still sent to FBR individually.
Fits when: you invoice in batches, such as a dispatch run, at fifty or more a day.
Trade-off: someone runs 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 mapping, and sends each invoice to eInvoicePro’s API. Nothing is installed inside Tally, and the FBR number is stored against the voucher it belongs to.
Fits when: volume is steady, invoicing happens all day, or you run several Tally companies.
Trade-off: 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 they are the natural place to begin. Route 3 earns its keep once volume, or the effort of re-running files, makes automation worth it. The mapping you build for route 2 (HS codes, sale types and units per stock item) is exactly what route 3 needs, so none of that work is lost when you switch.
Using Tally? Book a demo
See how eInvoicePro files invoices with FBR, and bring your questions about using it alongside Tally.
The real work
Doing the mapping once, not on every invoice
The gap between Tally and FBR is mostly a gap in master data. Fill it at the level of stock items and customers and each new invoice needs nothing extra.
Stock items: HS code, sale type and unit
Every stock item that appears on a sales invoice needs an HS code from FBR’s own list, a sale type, and FBR’s wording for its unit. Tally’s stock groups and categories make this manageable: if every item in a group such as “Mechanical Seals” shares an HS code and sale type, set it on the group and let individual items override only where they differ. A new item added to a mapped group then works on its first invoice rather than holding up the run.
Two cautions from FBR’s side. The HS code has to be one FBR recognises — store it as text, exactly as FBR’s list gives it, because a number field drops the leading zero on chapters 01 to 09. And FBR does not check that the code actually describes what you sold, so the classification is a decision for someone who knows the product, not a guess made by software. Our guide to PCT and HS codes covers where the authoritative list lives.
Units need translating too. Tally’s “Kgs” is not FBR’s “KG”, and “Nos” is not an FBR unit at all. Which units FBR will accept can also depend on the HS code, so the unit mapping is best checked against FBR’s lookup for each code rather than set once for the whole company.
Customers: registration type and province
For every party ledger you invoice, FBR needs the buyer’s NTN or CNIC as bare digits, whether they are a registered or unregistered buyer, and their province. The registration type can be looked up from FBR against the number; the province usually has to be read from the address and set once. Getting this right before go-live matters, 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 — “Sales – Karachi”, “Export Sales”, “Sales (Cash)”. Decide explicitly which voucher types are FBR sales invoices, which are notes, and which must be left 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 produce an obvious error. Most produce an invoice that looks fine and is wrong, or no invoice at all with nothing to say why.
Reading the data
- A misspelt company name can come back as an empty result rather than an error — it looks like “no invoices today”
- Tally only serves the companies currently open in it
- An open dialog box on the Tally PC can stall every request
- Single-line invoices can disappear if a reader expects every voucher to have several lines
Amounts and quantities
- Sales are stored as credits, so amounts arrive negative
- Quantities carry 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 the total drifting
Identity and scope
- Leading zeros vanish if an ID is treated as a number
- Cancelled and optional vouchers must be left out
- Custom sales voucher types are missed if only “Sales” is read
- Names and addresses can arrive with garbled characters unless the encoding is handled
Catch them before FBR does
Each of these comes from the way Tally stores and serves its data, and each one can be checked. Before go-live, run a week of real vouchers through FBR’s validation (which checks an invoice exactly as a live submission would, without filing anything) and 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. The technical write-up of 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 the whole company file, which makes where the connection runs a real decision.
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
- A connection that needs Tally to accept traffic from the internet
Reading locally, sending outward
- The reader runs on a machine inside the same network as Tally
- It only makes outgoing connections — to eInvoicePro over HTTPS
- Tally’s port stays closed to the internet
- FBR credentials live in the filing layer, never on the Tally PC
Going live
A realistic four-week rollout
The API itself is quick to connect. What takes the time is the mapping and proving it against FBR’s sandbox.
-
Map what Tally doesn’t hold
List every stock item sold in the last few months and give each 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.
-
Prove it in FBR’s sandbox
FBR assigns each business its own set of test scenarios (never all 28, at most 15) and the scenario ID is used only in sandbox. Run real Tally vouchers through them. Once your test invoices succeed, FBR issues the production token automatically.
-
Run in parallel
Keep invoicing in Tally as normal while every voucher is also validated against FBR. Compare totals with Tally’s sales register daily and fix mapping gaps as they surface — new stock items are the usual culprit.
-
File every invoice as it is raised
Switch to live submission. Watch the first days closely: failures come back per invoice with FBR’s reason, and a failed invoice is retried on its own rather than re-running the whole day.
Tally operator or accountant
Keeps stock items, party ledgers and vouchers accurate, since everything else is built from them, and owns the HS code and sale type decisions with the tax advisor.
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 go-live.
Tax advisor
Confirms your compliance scope, the sale types for reduced or exempt items, and whether your integration spend qualifies for the section 64D credit.
FAQ
Frequently Asked Questions
Does Tally connect to FBR digital invoicing on its own?
No. Tally has no FBR connection built in, and a typical Pakistani Tally file doesn’t hold the HS code, sale type or FBR unit FBR checks on every line. Getting invoices to FBR means reading them from Tally, adding that information from a mapping you set up once, and submitting each invoice individually through a filing layer such as 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 either through the bulk template or through a small reader program on your network, set up for your Tally companies, that asks Tally’s gateway for new vouchers. Which of those fits depends on your volume, and we can talk it through with you on a demo.
Does it work with both TallyPrime and Tally.ERP 9?
Yes. Both answer the same kind of XML request over their gateway, so the approach is the same. What matters more than the edition is how your company file is set up — custom voucher types, 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, and switching them on just to hold HS codes brings a lot you don’t want. Keep the HS code, sale type and FBR unit in the mapping alongside Tally instead.
Can we export from Tally once a day and send everything together?
FBR expects each invoice to be transmitted as it is generated, not collected and sent later, so a daily export is a compliance risk rather than a convenience. Even in bulk, eInvoicePro sends each invoice individually — 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 mapping, 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, along with the data for the QR code. Keep it against the Tally voucher it belongs to, because it is what the buyer, FBR and any auditor will ask for, and it is proof the invoice was filed.
Can we correct or cancel an FBR invoice from Tally?
No. FBR’s API has no cancel or edit method, so corrections happen in FBR’s own system — within 72 hours of the invoice for a genuine mistake, and with the Commissioner’s approval after that. Changing the voucher in Tally does not change what FBR holds.
Continue
Related guides & articles
Reading Tally data for FBR
The technical traps behind each item in the list above, for whoever builds the reader.
Read moreMapping tax codes to FBR sale types
How to turn the tax set-up in any accounting system into what FBR expects.
Read moreBulk digital invoicing
How the bulk template checks every row before a single invoice is sent.
Read moreERP + FBR guide
The same pattern across SAP, Odoo, QuickBooks, NetSuite, Business Central and Zoho.
Read morePCT and HS codes
The format FBR expects and where the authoritative list lives.
Read moreSandbox to go-live
What FBR’s test scenarios check before your production token is issued.
Read moreReady to simplify your FBR digital invoicing?
Join 2000+ businesses that use eInvoicePro to make invoices and send them to FBR.