Pakistan E-Invoicing Community
Summary
Sends Pakistan electronic invoice requests directly to FBR without Odoo IAP while preserving the existing Pakistan EDI invoice workflow.
Features
Installation
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 endpointfbr.direct.sandbox_post_url: sandbox invoice posting endpointfbr.direct.production_validate_url: production invoice validation endpointfbr.direct.production_post_url: production invoice posting endpointfbr.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.