Odoo, Accounting, Pakistan Localization

Pakistan E-Invoicing in Odoo 20: installation, FBR setup, and the IAP limitation

Umar Shahzad Umar Shahzad·Sep 2026·5 min read

Pakistan's FBR e-invoicing setup in Odoo has a few moving parts. The invoice form is only the last step. Before that, Odoo needs a company token, a whitelisted IP, properly configured products and taxes, and an FBR registration status for the customer.

This guide walks through the standard l10n_pk_edi module and explains where each setting is used.

What the standard module does

The Pakistan E-Invoicing module adds FBR fields to the company, customers, products, units of measure, and invoice lines. It also extends the normal Send & Print workflow.

When an invoice is sent, Odoo generally follows this sequence:

  1. It builds the FBR invoice JSON from the invoice and its lines.
  2. It sends the payload to Odoo's IAP service.
  3. The IAP service communicates with FBR.
  4. Odoo receives the validation response.
  5. If validation succeeds, the invoice is posted to FBR.
  6. Odoo stores the returned FBR invoice reference.

The important part is step two. The standard module does not call the FBR endpoints directly from your Odoo server.

The standard Pakistan E-Invoicing integration uses Odoo IAP. That means the standard flow requires Odoo Enterprise and an active Enterprise subscription.

Requirements

Before installing the module, prepare these items:

  • An Odoo Enterprise database with the Pakistan localization modules available.
  • A company registered for Pakistan electronic invoicing.
  • The company's FBR Business Identification Number or NTN/CNIC value.
  • A production authentication token from the FBR portal.
  • A sandbox authentication token if you want to test first.
  • Products with valid HS codes and FBR units of measure.
  • Customers with complete addresses and FBR registration information.
  • Sales taxes configured in Odoo.

Install the Pakistan E-Invoicing module

Enable developer mode if you need to inspect system parameters or technical settings.

Then install the module from the Apps menu:

  1. Open Apps.
  2. Search for Pakistan - E-invoicing or l10n_pk_edi.
  3. Install the Pakistan E-Invoicing module and its required dependencies.
  4. Make sure the company country is Pakistan.
  5. Open Accounting or Invoicing → Configuration → Settings.

The exact menu wording can vary slightly with the Odoo edition.

Configure the company

Open the accounting settings for the company that will send invoices to FBR.

Enable Electronic Invoicing under the Pakistan Electronic Invoicing section.

Check the company information before entering the token:

  • Company legal name
  • Company address
  • Province
  • Business Identification Number or NTN
  • Company email
  • Currency and accounting settings

The seller information in the FBR JSON comes from the company and its partner record. A missing or incorrectly formatted company VAT value will cause FBR validation errors.

Configure the static IP

The standard IAP-based flow uses Odoo's IAP transport, but FBR still needs the public IP associated with the integration to be whitelisted for the relevant FBR setup.

In the Pakistan E-Invoicing settings, use the static IP shown by Odoo and complete the FBR whitelisting process. Keep in mind that a local private address such as 192.168.x.x is not the public address FBR sees.

Add the production token

Paste the production token into the Production Token field in the Pakistan E-Invoicing settings.

The token belongs to the FBR account and company that will appear as the seller. Do not paste a sandbox token into the production field. Tokens should be treated like credentials and should not be committed to source control or copied into support tickets.

Save the settings after entering the token.

Set up sandbox testing

For sandbox testing, configure the sandbox token and the registered business identification number used by FBR's test scenarios.

The standard module includes sandbox scenarios. The Whitelist IP or sandbox test action checks the configured information and runs the available scenarios through the Odoo integration.

A scenario can fail because its test data is intentionally invalid. For example, FBR may reject a scenario because of an invalid sale type, a minimum notified price, a missing retail price, or a buyer and seller number that are the same. Read the actual FBR response rather than treating every failed scenario as a network problem.

The sandbox mode and scenario ID are controlled by the Pakistan EDI configuration. In a technical setup, the relevant values may be stored in system parameters such as:

l10n_pk_edi.mode
a test scenario parameter configured by the Pakistan EDI module

Use the exact parameter names shown in your installed Odoo version. Odoo releases can change the available configuration fields and typed parameter APIs.

Configure customers

Open each customer that may appear on a Pakistani invoice and complete the FBR section.

Check the following:

  • Customer name
  • Street and city
  • Province and country
  • NTN or CNIC, when applicable
  • FBR registration status

Use the customer registration check provided by the module. The status determines whether the payload is sent as a registered or unregistered buyer.

Do not mark a customer as registered only because the customer gave you a number. Confirm the status with FBR and keep the customer record consistent with the returned result.

Configure products

Open each product that will appear on an FBR invoice.

Set:

  • Product name and description
  • HS code
  • Unit of measure
  • FBR unit of measure code
  • Sale type
  • SRO schedule, when the sale type requires one
  • SRO item serial number, when required

The HS code and unit of measure must be a valid combination in FBR's reference data. A product can look correct in Odoo and still be rejected by FBR if its unit is not allowed for that HS code.

Configure taxes

The standard integration reads taxes already assigned to invoice lines. It does not invent the tax rate from the FBR response.

Configure the Odoo tax records first, then assign them to products or invoice lines. The FBR payload may include values such as:

  • Sales tax rate
  • Sales tax amount
  • Further tax
  • Withholding tax
  • Extra tax or FED-related values where the configured sale type supports them

The sale type and tax setup must agree. A reduced-rate sale with an incompatible extra tax, for example, can be rejected by FBR.

Create and send an invoice

After the company, customer, product, unit, sale type, tax, and token settings are ready:

  1. Create a customer invoice.
  2. Select a configured customer.
  3. Add products with valid FBR data.
  4. Check the taxes and invoice lines.
  5. Confirm the invoice if your workflow requires confirmation.
  6. Open Send & Print.
  7. Select the FBR electronic invoicing option.
  8. Send the invoice.

The standard flow validates the invoice before posting it. If FBR rejects the invoice, Odoo shows the validation message and the invoice should be corrected before trying again.

Common errors

You do not have an Odoo Enterprise subscription

This message comes from the IAP route. It means the standard Pakistan E-Invoicing module reached Odoo's IAP server and the subscription check failed. It is not an FBR token error.

Provided UoM is not allowed against the provided HS Code

Check the product's HS code and FBR unit of measure. Use the FBR HS_UOM reference API for the exact combination.

Buyer and Seller Registration number are same

The test payload is being interpreted as self-invoicing. Check the company NTN and the buyer number in the scenario or customer data.

Minimum notified price or retail price error

Some products and sale types require a minimum notified price or a fixed retail price. Configure the appropriate FBR fields instead of sending an empty or lower value.

Why Enterprise is required for the standard module

The standard l10n_pk_edi code uses iap.account to call an Odoo-hosted route such as the Pakistan EDI validation and posting service. That service then handles the FBR connection.

Because the transport is tied to Odoo IAP, the standard integration is not a Community-only integration. Installing the module on a database without the required Enterprise entitlement can produce the subscription error before any request reaches FBR.

Direct API alternative

The separate Pakistan E-Invoicing Community module documentation describes our direct transport extension. It keeps the existing Pakistan EDI payload and invoice workflow but sends requests from the Odoo server directly to FBR with a Bearer token.

The direct module also covers direct partner registration checks and direct sandbox scenario calls. Its current implementation depends on l10n_pk_edi, so it should be treated as an extension until the payload and field layer is made fully independent.

Working on something like this?

If this is the kind of problem you are dealing with, tell me about it.