Business Central integration

Connecting Business Central to FBR digital invoicing

For Business Central customers (online or on-premises, usually supported by a local partner) who need each posted sales invoice filed with FBR without changing the way their team posts.

Updated

eInvoicePro API documentation — the layer Business Central sends posted invoices to for FBR filing

The mechanism

What happens when a Business Central invoice is posted

Posting is the moment a Business Central invoice becomes final, and the moment FBR should hear about it.

In Business Central you build a sales invoice, or a sales order you ship and invoice, and then post it. Posting creates a posted sales invoice: a separate, read-only document with its own number from the posted-invoice number series, usually different from the number the draft carried. That posted document (its number, its lines, its VAT amounts) is what should reach FBR, because it is what your books and your customer’s copy show.

An integration hangs off that moment and does the same five things for every posted sales invoice:

  1. Notice the posting — through an event in an AL extension, a business event picked up by Power Automate, or a service that checks Business Central’s API for newly posted invoices.
  2. Add FBR’s fields — the FBR sale type for each line’s VAT set-up, the HS code and FBR unit for each item, the registration type and province for the customer.
  3. Send it for filing to eInvoicePro’s API, using the posted invoice number as the idempotency key so a retry can’t file it twice from your side.
  4. Read the result line by line — the posted invoice counts as filed only once FBR has returned its number and no line carries an error.
  5. Store it on the posted invoice — the FBR number, status and any error, in fields added to the posted invoice header, and on the printed copy with the QR code.

Why posting shouldn’t wait for FBR

It is possible to call out to FBR inside the posting routine. It is rarely wise: posting then depends on FBR’s response time, and a dropped connection leaves the user with an error in the middle of a financial transaction. The steadier pattern lets posting finish, then files the invoice from a queued background task (Business Central’s job queue exists for exactly this), so a failure is retried and reported without blocking the person who posted.

What “cancel” means afterwards

Business Central lets you correct or cancel a posted invoice, which creates a corrective credit memo. That is right for your books, but FBR is never told — there is no API call that cancels or edits a filed invoice. Correcting what FBR holds is a separate, manual job in FBR’s own system: possible for 72 hours after a genuine mistake, and only with the Commissioner’s approval once that window has closed.

Your options

Three ways to connect Business Central

All three file the same invoices. They differ in who builds them, how much volume they handle comfortably, and what they need from your environment.

AL extension

An extension subscribes to the sales posting event, queues each posted invoice, and a job queue entry sends it to eInvoicePro and writes the result back. Everything lives inside Business Central, versioned with your other extensions.

Fits when: volume is steady or high, and you have a partner or developer who maintains AL.

Power Automate

A flow reacts to newly posted invoices — Business Central publishes a sales invoice posted business event, still labelled preview, or a flow can watch its API for new records, then calls eInvoicePro and updates the invoice through the API.

Fits when: volume is modest and you want the least code.

Outside service

A small service asks Business Central’s API for posted sales invoices every few minutes, files them through eInvoicePro and writes the results back. Nothing is installed in Business Central.

Fits when: you already run an integration platform, or several systems feed FBR.

Online or on-premises?

Both work. Business Central online can call eInvoicePro directly. An on-premises installation, including one upgraded over the years from Dynamics NAV, needs to be able to make outgoing HTTPS calls; that is usually a firewall rule rather than a project. Older installations should have the posting event tested against their own version before anything is built on it.

The data

Where FBR’s data lives in Business Central

Some of what FBR needs already has a sensible home in standard Business Central. The rest is added with table extensions.

FBR invoice fields and their home in Business Central
What FBR asks for Home in Business Central What to watch
Buyer NTN or CNIC The customer’s VAT registration number field, if you use it for the NTN Bare digits; decide once which field holds the NTN and stick to it
Buyer registration type A new customer field, added by table extension Populated by looking the customer’s number up with FBR
Buyer province The customer’s address Map to FBR’s province names, not the city
Invoice number The posted sales invoice number Use the posted number, not the draft; FBR accepts letters, digits and hyphens only
Sale type and SRO Your VAT posting set-up — each business and product posting group combination Map each combination used on sales to an FBR sale type and, where needed, SRO references
HS code The item’s tariff number, used for customs and Intrastat It relates to Business Central’s tariff number list, so FBR’s codes need adding there, or use a new field
Unit of measure The item’s unit of measure Map to FBR’s unit names — the HS code decides which are allowed
Values and VAT Posted invoice lines VAT-inclusive prices must be split back into value and tax per line
FBR number, status, error New fields on the posted sales invoice header, added by table extension The place your team, reports and printed copy read from

If your set-up models registered and unregistered buyers as different VAT business posting groups, the mapping can read the buyer type straight from it.

The VAT posting set-up is the heart of the mapping

The VAT posting set-up is where the mapping starts. Business Central decides each line’s tax from a pair of posting groups (one on the customer, one on the item) so the natural unit to map is that pair: “this combination, used on sales, means this FBR sale type.” The rate itself should come from FBR’s lookup for the sale type and invoice date, not from Business Central’s VAT percentage. For the rules FBR applies to each line, see mapping tax codes to FBR sale types.

Architecture choice

An all-AL FBR build vs a ready layer

AL can talk to FBR directly. The question is whether your partner wants to own FBR’s specification for as long as you run Business Central.

All in AL

Business Central calling FBR directly

  • Your partner owns FBR’s payload, tokens, retries and line-level error reading in AL
  • Every FBR technical change means a new extension version, tested and published
  • Because FBR accepts a repeated invoice as a new one, every retry path must be built not to double-file
  • Looking up valid HS codes, units, rates and SRO references from FBR becomes part of your AL code
Ready layer

Business Central → eInvoicePro → FBR

  • The extension or flow translates Business Central data and makes one API call
  • FBR revisions don’t force a new extension version — eInvoicePro absorbs them
  • A lost reply is retried safely by idempotency key, one invoice at a time, with FBR’s original response kept
  • All your companies’ NTNs in one account, with a single flag between sandbox and production

Using Business Central? Book a demo

See how eInvoicePro files invoices with FBR, and bring your questions about connecting it to Business Central.

Watch these

Business Central-specific traps

Each of these is easy to miss in a test company and expensive in a live one.

Posting

  • The sales posting event also fires during preview posting — filter it out or you file invoices that don’t exist
  • The same event covers credit memos and other sales documents — check the document type
  • The posted invoice number differs from the draft number; send the posted one
  • Batch posting many orders at once produces a burst of invoices to queue, not call one by one

Documents

  • Cancelling or correcting a posted invoice creates a corrective credit memo in Business Central, not a cancellation at FBR
  • Invoices posted from sales orders and direct sales invoices both need filing
  • Discounts and VAT-inclusive prices have to be restated per line for FBR
  • Intercompany invoices need a rule, since FBR rejects an invoice addressed to the seller’s own NTN

Environment

  • Sandbox environments and copied companies must never file to FBR production
  • On-premises servers need outgoing HTTPS allowed
  • Business events for Power Automate are still in preview — plan for change
  • Every company in the database needs its own NTN and FBR credentials configured

Going live

A realistic four-week rollout

Business Central’s sandbox environments line up neatly with FBR’s, provided the two are never crossed with production.

  1. Week 1

    Map the posting set-up

    List every VAT business and product posting group combination used on sales and give each an FBR sale type. Fill HS codes and FBR units on the items you sell, and registration types on customers.

  2. Weeks 2–3

    Build and test in sandbox

    Develop the extension or flow in a Business Central sandbox environment talking to eInvoicePro’s sandbox. Each NTN has its own list of FBR test scenarios to clear, and clearing them is what releases the production token.

  3. Week 4

    Run in parallel

    Switch on validation-only mode in production: posted invoices are checked by FBR but not filed. A daily comparison with the posted sales invoice list shows which items or customers still need mapping.

  4. Go live

    File on every posting

    Switch to live filing, print the FBR number and QR code on the invoice report, and give someone ownership of failed and pending invoices.

Finance

Owns the posting-group-to-sale-type mapping with your advisor, and the daily reconciliation.

Business Central partner or IT

Builds the extension or flow, the table extensions and the report change, and manages sandbox and production.

Tax advisor

Signs off which posting-group combinations are reduced-rate or exempt, how intercompany sales are treated, and whether the build qualifies under section 64D.

FAQ

Frequently Asked Questions

Does Business Central support FBR digital invoicing out of the box?

No. Business Central is available in Pakistan through partners on Microsoft’s worldwide version, and there is no FBR connection built in. Filing is added through an AL extension, a Power Automate flow or an outside service that sends posted invoices to a filing layer such as eInvoicePro.

AL extension or Power Automate?

For modest volumes and minimal code, a Power Automate flow can be enough — noting that the “sales invoice posted” business event is still in preview. For steady or high volume, or when you want the logic versioned with your other extensions, an AL extension with a job queue is the sturdier choice. Either way, the FBR-specific work sits in eInvoicePro.

Which invoice number do we send to FBR?

The posted sales invoice number, the one on the posted document your customer receives, not the number the draft carried. FBR accepts letters, digits and hyphens only, so check your posted-invoice number series.

Does cancelling a posted invoice in Business Central cancel it at FBR?

No — it creates a corrective credit memo in your books, and FBR is not told. Changing FBR’s record is done in FBR’s system itself, inside 72 hours of the invoice for an honest mistake.

We are on an older on-premises installation. Can we still connect?

Usually, yes. The server needs to make outgoing HTTPS calls, and the posting event your extension relies on should be tested against your version first. An outside service reading Business Central’s API is an alternative if extensions are hard to deploy in your environment.

We run several companies in one Business Central. Is that several integrations?

One integration with per-company settings. Each company files under its own NTN and FBR credentials, and one eInvoicePro account can hold them all.

Do we need to replace Business Central?

No. Your team keeps posting in Business Central exactly as it does now; the integration only adds a filing step after posting and a few fields for FBR’s reply.

Ready to simplify your FBR digital invoicing?

Join 2000+ businesses using eInvoicePro for real-time FBR integration and automated tax compliance.

Chat with us