Pakistan E-Invoicing Community

pk_edi_community
Category Accounting - Localizations - EDI
Odoo 20.0
License OPL-1
Available for purchase
$10
Get it on the Odoo Apps Store, or request it directly.
Support: Within 2 business days.
Buy on Odoo Apps Store
Licensing, refunds and support - see the FAQ →

Summary

Sends Pakistan electronic invoice requests directly to FBR without Odoo IAP while preserving the existing Pakistan EDI invoice workflow.

Features

✓
Direct FBR invoice validation without the Odoo IAP transport layer
✓
Direct FBR invoice posting after successful validation
✓
Production and sandbox endpoint configuration
✓
Sandbox scenario ID support
✓
Direct customer FBR registration status checks
✓
Direct sandbox registration and scenario test calls
✓
Existing Send & Print workflow remains available
✓
FBR invoice reference stored after a successful posting
✓
Concise handling of FBR HTTP and validation responses
✓
No automatic creation or assignment of Odoo taxes

Installation

# Copy the `pk_edi_community` directory into the Odoo addons path.
# Restart Odoo after installing or upgrading the module when Python files have changed.
# Make sure the required Pakistan EDI dependency is installed.
#Update the Apps list in Odoo.
# Install **Pakistan E-Invoicing Community** from the Apps menu.

Configuration

The module inherits the company, product, partner, and invoice structures provided by l10n_pk_edi.

Configure company production and sandbox tokens in the existing Pakistan EDI company settings.

Set the FBR mode using the existing Pakistan EDI configuration. Use test mode for sandbox requests and production mode for live invoices.

The module creates these system parameters with FBR defaults:

  • fbr.direct.sandbox_validate_url: sandbox invoice validation endpoint
  • fbr.direct.sandbox_post_url: sandbox invoice posting endpoint
  • fbr.direct.production_validate_url: production invoice validation endpoint
  • fbr.direct.production_post_url: production invoice posting endpoint
  • fbr.direct.registration_url: direct customer registration endpoint

The default customer registration endpoint is:

https://gw.fbr.gov.pk/dist/v1/Get_Reg_Type

The sandbox invoice endpoints are:

https://gw.fbr.gov.pk/di_data/v1/di/validateinvoicedata_sb
https://gw.fbr.gov.pk/di_data/v1/di/postinvoicedata_sb

The production invoice endpoints are:

https://gw.fbr.gov.pk/di_data/v1/di/validateinvoicedata
https://gw.fbr.gov.pk/di_data/v1/di/postinvoicedata

Configuration path:

Settings → Technical → Parameters → System Parameters

The direct module does not use the legacy Odoo static IP setting for its FBR requests. FBR access still depends on the network, token, and account permissions required by the selected endpoint.

Technical notes

The module overrides the existing _l10n_pk_edi_send flow so the regular invoice send action calls the direct FBR transport.

Invoice requests use the company token in this header:

Authorization: Bearer <token>
Content-Type: application/json

The invoice JSON payload is sent directly as the request body. The module validates first and posts only when the validation response reports Valid.

In sandbox mode, a numeric scenario parameter such as 002 is normalized to the FBR format SN002.

The sandbox whitelist button continues to use the existing Odoo settings action, but the underlying VAT registration, scenario validation, and scenario posting calls are overridden to use direct FBR requests.

The module does not create taxes or modify taxes on products and invoices. It reuses the tax values calculated by the existing Pakistan EDI payload builder.

Current release dependency:

'depends': ['l10n_pk_edi']

Because of that dependency, this release is an extension of the Enterprise Pakistan EDI module.

This module bypasses Odoo IAP and connects directly to FBR, the customer is responsible for obtaining and maintaining a public static IP address and completing any required FBR IP whitelisting.

Changelog

  • Added direct production and sandbox invoice validation and posting.
  • Added direct partner registration checks.
  • Added direct sandbox scenario test calls.
  • Added configurable FBR endpoint parameters.

Need this module, or one like it?

I build custom Odoo modules to fit the process rather than the other way round.