SRB Integration — Overview & module guide

Module: SRB Integration v1.3.0

Integrate BIXCRM invoices with SRB Sindh Revenue Board POS (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 SRB Integration permissions.
  2. Open Srb Integration (sidebar) or search for SRB 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 SRB Integration section in the admin sidebar. Screens your staff may use (depending on role):

  • API Settings
  • Bulk Submit
  • Settings
  • SRB Audit Log
  • SRB Report

Detailed guide — features, workflows, API & FAQ

Features

  • Submit invoices to SRB (manual + auto-submit)
  • Credit note submission with source invoice SRB reference
  • Simulation mode for safe testing
  • Encrypted API credentials at rest
  • Custom field mapping (HS code, sale type, buyer SNTN)
  • QR codes on invoice PDF / client view / public verify page
  • SRB 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 → SRB Integration
  2. Open Setup → Settings → Integrations → SRB Integration
  3. Configure auto-submit, field mapping, retry, webhooks, and REST API
  4. Open SRB Integration → API Settings (or click Open SRB API settings on the settings tab)
  5. Set mode, environment, seller SNTN, POS ID, 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 SRB submissions is enabled. Webhook delivery also runs on cron.

Admin navigation

Menu itemPermissionURL
----------------------------
Settingssettingsadmin/settings?group=srb_integration
API Settingssettingsadmin/srb_integration
Bulk Submitsendadmin/srb_integration/srb/bulk_submit
SRB Reportview_srb_reportadmin/srb_integration/srb/report
Audit Logview_srb_reportadmin/srb_integration/srb/audit_log

Bulk submit

SRB Integration → Bulk Submit lists invoices not yet sent to SRB (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/srb_integration/srb_restService info
GET/srb_integration/srb_rest/invoice_status/{id}SRB status for invoice
POST/srb_integration/srb_rest/invoice_submit/{id}Submit single invoice
POST/srb_integration/srb_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). Header: X-SRB-Integration-Signature (HMAC-SHA256).

Field mapping

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

Credit notes

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

Auto-submit for credit notes supports cron/system-created documents (same as invoices).

SaaS multi-tenant

When nasbix_saas is active, tenant isolation is enforced via filters on:

  • srb_integration_company_id
  • srb_integration_settings_company_id
  • srb_integration_send_company_id
  • srb_integration_send_credit_note_company_id
  • srb_integration_report_company_id
  • srb_integration_verify_company_id
  • srb_integration_invoice_panel_company_id
  • srb_integration_client_invoice_company_id
  • srb_integration_invoice_pdf_company_id
  • srb_integration_credit_note_panel_company_id

Hooks

HookTypePurpose
---------------------
srb_integration_company_idfilterDefault tenant ID
srb_integration_settings_company_idfilterSettings page tenant
srb_integration_send_company_idfilterInvoice submit tenant
srb_integration_send_credit_note_company_idfilterCredit note submit tenant
srb_integration_report_company_idfilterReport / export tenant
srb_integration_verify_company_idfilterPublic verify page tenant
srb_integration_send_payloadfilterFinal payload before POST
srb_integration_invoice_payloadfilterInvoice payload
srb_integration_di_payloadfilterRaw DI payload builder
srb_integration_credit_note_payloadfilterCredit note payload
srb_integration_parse_responsefilterParse API response
srb_integration_di_post_urlfilterOverride POST URL
srb_integration_di_validate_urlfilterOverride validate URL
srb_integration_item_hs_codefilterLine item HS code
srb_integration_credit_note_source_srb_numberfilterSource invoice SRB number
srb_integration_after_submitactionFires after submit (webhooks)
srb_integration_webhook_payloadfilterOutbound webhook body
srb_integration_retry_delay_minutesfilterRetry backoff schedule
srb_integration_simulation_invoice_numberfilterSimulated SRB invoice number
srb_integration_qr_verification_urlfilterQR verification URL
srb_integration_before_invoice_addedfilterPre-create invoice hook

API configuration

Default gateway URLs (override in API Settings):

EnvironmentPOST URL
-----------------------
Sandboxhttps://pos.srb.gos.pk/di_data/v1/di/postinvoicedata_sb
Productionhttps://pos.srb.gos.pk/di_data/v1/di/postinvoicedata

Obtain production URLs and credentials from the [SRB POS portal](https://pos.srb.gos.pk/PoSRegistration/) after registering your POS stations.

Troubleshooting

IssueCheck
--------------
No settings errorAPI key saved for tenant
HTTP 401Token + SRB credentials
Invalid endpointCustom URL must start with https://
Credit note blockedSource invoice SRB status = sent
Retries not runningCron + retry enabled
Webhooks not firingHTTPS URL + cron + subscribed events
REST API 403API enabled + valid Bearer key
Verify page shows raw keysModule lang loads automatically

Tests

php modules/srb_integration/tests/SrbLogicTest.php

Permissions

CapabilityKeyUsed for
---------------------------
ViewviewSRB panel on invoices
SendsendSubmit to SRB, bulk submit
SettingssettingsAPI config, test connection
View Reportview_srb_reportReport, audit log, exports

Features

Integrate BIXCRM invoices with SRB Sindh Revenue Board POS (sandbox and production APIs via CURL).

  • Submit invoices to SRB (manual + auto-submit)
  • Credit note submission with source invoice SRB reference
  • Simulation mode for safe testing
  • Encrypted API credentials at rest
  • Custom field mapping (HS code, sale type, buyer SNTN)
  • QR codes on invoice PDF / client view / public verify page
  • SRB 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 SRB 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 SRB 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 SRB Integration.
  2. Setup → Staff → Roles → assign SRB Integration permissions (view, create, edit, delete, approve, export, settings as needed).
  3. Open SRB 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?