FBR Integration — Overview & module guide

Module: FBR Integration v1.3.0

Integrate BIXCRM invoices with FBR (sandbox and production APIs via CURL).

How to use in BIXCRM (daily operations)

  1. Sign in to the admin area with a role that includes FBR Integration permissions.
  2. Open Fbr Integration (sidebar) or search for FBR Integration in the admin menu.
  3. Start on the Dashboard (if available) to see open tasks, pending approvals, and KPIs.
  4. Review Settings after upgrades — new options may need defaults for your company.
  5. Create or import master data first; most modules block transactions until masters exist.
  6. Run the main business flow (create → submit → approve → post/complete) using the screens listed in Admin menu below.
  7. Use Reports / Analytics screens to reconcile stock, finance, compliance, or SLA metrics.
  8. For integrations (API, EDI, gateways, tax), confirm credentials in Settings and monitor logs or webhook delivery screens.
  9. Train staff with role-based access — give approvers approve permissions only, operators create/edit on their area.
  10. If something fails overnight, check BIXCRM cron ran and open the module log / failed queue screen if present.

Admin menu — where to work

Open the FBR Integration section in the admin sidebar. Screens your staff may use (depending on role):

  • Bulk Submit
  • FBR Audit Log
  • FBR Report
  • Settings

Detailed guide — features, workflows, API & FAQ

Features

  • Submit invoices to FBR (manual + auto-submit)
  • Credit note submission with source invoice FBR reference
  • Simulation mode for safe testing
  • Encrypted API credentials at rest
  • Custom field mapping (HS code, sale type, buyer NTN)
  • QR codes on invoice PDF / client view
  • FBR report (CSV / PDF export)
  • Retry queue with exponential backoff (cron)
  • Test connection button (validate endpoint)
  • Audit log of submit / retry / test actions
  • Bulk submit admin UI for unsent invoices
  • Webhooks (HTTPS + HMAC) on submit success/failure
  • External REST API for third-party integrations
  • Configurable API URLs per environment
  • Urdu + Arabic language packs
  • SaaS multi-tenant hooks (nasbix_saas)

Setup

  1. Activate module: Setup → Modules → FBR Integration
  2. Open Setup → Settings → Integrations → FBR Integration
  3. Configure auto-submit, field mapping, retry, webhooks, and REST API
  4. Open FBR Integration → API settings
  5. Set mode, environment, seller NTN, API key (and optional custom URLs)
  6. Click Test connection
  7. Start in Simulation, then switch to Live

Cron (required for retries & webhooks)

Ensure BIXCRM cron runs on schedule. Failed live submissions retry when Retry failed FBR submissions is enabled. Webhook delivery also runs on cron.

Bulk submit

FBR Integration → Bulk Submit lists invoices not yet sent to FBR (excludes drafts). Select invoices and submit in batch (max 50 per request).

External REST API

Enable in settings and set an API key. Endpoints (site URL, not admin):

MethodPathDescription
---------------------------
GET/fbr_integration/fbr_restService info
GET/fbr_integration/fbr_rest/invoice_status/{id}FBR status for invoice
POST/fbr_integration/fbr_rest/invoice_submit/{id}Submit single invoice
POST/fbr_integration/fbr_rest/bulk_submitJSON body: {"invoice_ids":[1,2,3]}

Authenticate: Authorization: Bearer {api_key} or ?api_key=

Webhooks

Configure an HTTPS URL and optional signing secret. Events: submit.success, submit.failed. Payload includes event, company_id, timestamp, and data (submission context).

Field mapping

SettingSource
-----------------
HS code slugLine item CF → catalog product CF → default
Sale type slugSame as HS code
Buyer NTN slugCustomer VAT → customer CF → unregistered default

Credit notes

  1. Submit original invoice to FBR first
  2. Create credit note with applied credit to that invoice
  3. Use Send credit note to FBR on credit note preview

Hooks

HookType
------------
fbr_integration_send_payloadfilter
fbr_integration_parse_responsefilter
fbr_integration_item_hs_codefilter
fbr_integration_credit_note_source_fbr_numberfilter
fbr_integration_after_submitaction
fbr_integration_webhook_payloadfilter
fbr_integration_retry_delay_minutesfilter

Troubleshooting

IssueCheck
--------------
No settings errorAPI key saved for tenant
HTTP 401Token + FBR IP whitelist
Credit note blockedSource invoice FBR status = sent
Retries not runningCron + retry enabled
Webhooks not firingHTTPS URL + cron + subscribed events
REST API 403API enabled + valid Bearer key

Tests

php modules/fbr_integration/tests/FbrLogicTest.php

Features

Integrate BIXCRM invoices with FBR (sandbox and production APIs via CURL).

  • Submit invoices to FBR (manual + auto-submit)
  • Credit note submission with source invoice FBR reference
  • Simulation mode for safe testing
  • Encrypted API credentials at rest
  • Custom field mapping (HS code, sale type, buyer NTN)
  • QR codes on invoice PDF / client view
  • FBR report (CSV / PDF export)
  • **Retry queue** with exponential backoff (cron)
  • **Test connection** button (validate endpoint)
  • **Audit log** of submit / retry / test actions
  • **Bulk submit** admin UI for unsent invoices
  • **Webhooks** (HTTPS + HMAC) on submit success/failure
  • **External REST API** for third-party integrations
  • **Configurable API URLs** per environment
  • **Urdu + Arabic** language packs
  • SaaS multi-tenant hooks (`nasbix_saas`)

Permissions

Granular staff capabilities are registered on activation. Assign them under Setup → Staff → Roles for the FBR Integration capability group.

Typical capabilities include view, create, edit, delete, plus module-specific actions (approve, export, settings, API access).

Cron Jobs

Background tasks (if enabled) run through BIXCRM's main cron. Example crontab (every 5 minutes):

* * * * * php /path/to/bixcrm/index.php cron/index > /dev/null 2>&1

Check module settings for scheduled jobs (alerts, sync, reports, retention).

After activation — configuration checklist

  1. Go to Setup → Modules and activate FBR Integration.
  2. If prompted, click Upgrade Database or reload admin — migrations run automatically.
  3. Assign permissions under Setup → Staff → Roles.
  4. Open the module menu and configure settings.
  5. BIXCRM 3.0+
  6. PHP 7.4+ (8.1+ recommended)
  7. MySQL 5.7+ / MariaDB 10.3+ (InnoDB)
  8. PHP extensions: mysqli, json, mbstring, curl, fileinfo

One-time setup (first time only)

  1. Setup → Modules → activate FBR Integration.
  2. Setup → Staff → Roles → assign FBR Integration permissions (view, create, edit, delete, approve, export, settings as needed).
  3. Open FBR Integration → Settings and complete company defaults, prefixes, integrations, and notification options.
  4. Create master data (warehouses, products, templates, accounts, routes, etc.) before processing live transactions.
  5. Enable BIXCRM cron (php /path/to/bixcrm/index.php cron/index) for sync, retries, alerts, and scheduled jobs.
  6. Optionally enable REST API / webhooks in module settings if you integrate external systems.

BIXCRM Knowledge Base — usage guide generated from module README and documentation.

Did you find this article useful?