SRB Integration — Overview & How to Use

Module: SRB Integration v1.0.0

What is SRB Integration?

Pakistan SRB Sindh Revenue Board POS integration for Perfex CRM (sandbox and production APIs).

This module installs into modules/srb_integration/ and adds its own admin menus, permissions, and database tables — without editing Perfex CRM core files.

Who should use this module?

  • Admins — activate the module, configure Settings, assign roles, and manage integrations.
  • Operators / day-to-day staff — create and update records (orders, attendance, shipments, messages, etc.).
  • Managers / approvers — review queues, approve workflows, and monitor dashboards/KPIs.
  • Finance / compliance / ops leads — run reports, exports, and audit trails when the module supports them.

What you can achieve

  • Keep all related work in one place inside Perfex CRM instead of spreadsheets.
  • Control who can view, create, edit, approve, or export with role permissions.
  • Use dashboards and reports to see status, bottlenecks, and history.
  • Connect to other CRM data (customers, invoices, items, staff) where the module integrates.

Recommended learning path

  1. Read How to Install and activate the module.
  2. Skim Features so you know what screens exist.
  3. Complete the Quick Start checklist on this page (Settings → masters → first sample record).
  4. Open each screen guide under Screen-by-screen guides when you need step-by-step help.
  5. Check Version & Changelog after upgrades for new options.

Tip: Train one admin first, then create a limited role for operators so they only see the screens they need.

5-minute Quick Start

Follow this short path the first time you use SRB Integration:

  1. Activate — Setup → Modules → activate SRB Integration (run Upgrade if prompted).
  2. Permissions — Setup → Staff → Roles → enable view/create/edit (and approve/settings if needed) for this module.
  3. Settings — Open SRB Integration → Settings and save company defaults, prefixes, and integrations.
  4. Master data — Create the first required masters (products, warehouses, templates, channels, accounts, routes, etc.).
  5. First transaction — Create one sample record end-to-end (save → submit/approve → complete) and confirm it appears in lists/reports.
  6. Cron — If the module uses alerts, sync, queues, or AI, confirm Perfex CRM cron is scheduled on the server.

Full how-to guide (from module package)

The steps below come from the module author's printable guide — follow them in order for best results.

SRB Integration for Perfex CRM — How to Use

Author: Nasbix Technologies | Version: 1.0.0

1. INSTALL

1. Upload the "srb_integration" folder into your Perfex CRM /modules/ directory

(FTP/SFTP or Setup → Modules → Upload Module).

  1. Go to Setup → Modules.
  2. Find "SRB Integration" and click Activate.

4. Assign staff permissions under Setup → Staff → Roles:

- view, send, settings, view_srb_report

2. CONFIGURE SETTINGS

1. Open Setup → Settings → Integrations → SRB Integration

(or SRB Integration → Settings in the sidebar).

  1. Set auto-submit (invoices / credit notes) if needed.
  2. Map custom fields: HS code, sale type, buyer SNTN.
  3. Enable retry queue, webhooks, and/or REST API as required.

3. API CREDENTIALS

  1. Open SRB Integration → API Settings.
  2. Choose Mode: Simulation (safe testing) or Live.
  3. Choose Environment: Sandbox or Production.
  4. Enter Seller SNTN, POS ID, and API key.
  5. Optionally override API URLs.
  6. Click "Test connection".

4. SEND AN INVOICE TO SRB

  1. Open any invoice preview in Perfex CRM.
  2. Use the SRB panel on the left → Send to SRB.
  3. On success, SRB invoice number + QR appear on PDF / client view.

5. CREDIT NOTES

  1. Submit the original invoice to SRB first.
  2. Create a credit note linked to that invoice.
  3. On credit note preview, click Send credit note to SRB.

6. BULK SUBMIT / REPORT / AUDIT

  • Bulk Submit: SRB Integration → Bulk Submit
  • Report: SRB Integration → SRB Report (CSV / PDF)
  • Audit Log: SRB Integration → Audit Log

7. CRON (RETRIES & WEBHOOKS)

Ensure Perfex CRM cron is scheduled (e.g. every 5 minutes).

Retries and webhook delivery run on cron when enabled in settings.

8. UNINSTALL (CLEAN)

  1. Setup → Modules → Deactivate SRB Integration.
  2. Click Uninstall.

Removes tables: srb_settings, srb_invoices, srb_audit_log, srb_webhook_queue

and all srb_integration_* options + module files.

9. DOCUMENTATION

Open documentation/index.html inside this package for full docs.

Support: via CodeCanyon (6 months) — Nasbix Technologies — https://nasbix.com

Perfex CRM is sold separately and is not included with this item.

Setup & usage notes from README

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

Module documentation index

Start here — full guides for SRB Integration:

How to use in Perfex CRM (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 Perfex CRM 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

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

Uninstall

  1. Go to Setup → Modules.
  2. Deactivate SRB Integration first.
  3. Click Uninstall.

Uninstall removes module tables (srb_settings, srb_invoices, srb_audit_log, srb_webhook_queue), all related options, and the module files.

Features

Integrate Perfex CRM 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

Permissions

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

  • view — SRB panel on invoices
  • send — Submit to SRB, bulk submit
  • settings — API config, test connection
  • view_srb_report — Report, audit log, exports

Cron Jobs

Background tasks (retries & webhooks) run through Perfex CRM's main cron. Example crontab (every 5 minutes):

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

Enable Retry failed SRB submissions and webhooks in module settings as needed.

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 Setup → Settings → Integrations → SRB Integration and configure settings.
  5. Perfex CRM 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 Perfex CRM cron (php /path/to/perfex/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.

Tips for success

  • Always configure Settings before creating live transactions.
  • Create master data (items, warehouses, templates, channels, accounts) first — most modules block incomplete records.
  • Use a test/sample record before going live with real customers or production stock.
  • Separate roles: operators create/edit; managers approve; finance/reporting get view/export only.
  • After any module upgrade, reopen Settings and confirm new options have sensible defaults.
  • If overnight jobs fail, verify Perfex CRM cron and check the module log / failed queue screen.

Common questions (FAQ)

Where do I find the module after activation?

In the admin sidebar look for SRB Integration. If missing, your role may lack view permission — fix under Setup → Staff → Roles.

Do I need to edit core Perfex CRM files?

No. Keep all custom code under modules/srb_integration/. Activate/deactivate from Setup → Modules.

What happens if I uninstall?

Deactivate keeps data. Uninstall usually removes module tables/options (see the Install article). Core customers, invoices, and items are not deleted by well-built modules.

Why can't my staff see a screen?

Almost always a permissions issue. Give the role at least view on that feature, then ask the user to log out and back in.

Reports/export buttons do nothing

Confirm the role has export (or view reports) permission, and that filters return at least one row. Try PDF/CSV from a wider date range.

FAQ from module documentation

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

Perfex CRM Knowledge Base — detailed usage guide generated from module README, HOW_TO_USE, and documentation.

Did you find this article useful?