CS ComplyStream
Toggle menu
MOFU P1

FBR Sandbox Testing: A Practical Guide for Digital Invoicing

Sandbox is not just a connectivity test. It is where a merchant proves the scenario and data combinations that its production invoices will use.

What sandbox proves

The FBR digital invoicing sandbox lets a taxpayer and its integration team submit test payloads without treating them as live production invoices. It proves that authentication, network access, payload shape, reference codes and assigned business scenarios can work together. It does not prove that every production tax decision is correct.

S.R.O. 69(I)/2025 provides the Chapter XIV integration framework, while rollout instruments such as S.R.O. 1852(I)/2025 identify registration, testing and issuance milestones. FBR’s Digital Invoicing User Manual then describes the practical flow: technical details, business nature and sector, IP whitelisting, sandbox token, scenario invoices and production access.

Prepare the portal data first

Nominate a real technical contact who can receive and act on support messages. Enter the actual ERP or system provider, cloud or on-premises model and software version. Select business nature and sector with the tax and operations teams because these choices influence assigned test scenarios. Do not choose the easiest category merely to make testing pass.

Record who controls the IRIS and Digital Invoicing portal accounts. Credentials and tokens should not be pasted into tickets, spreadsheets or chat. The merchant should be able to replace a vendor without losing access to its own registration history and production evidence.

Complete IP whitelisting deliberately

The user manual asks for hosting-company details, hosting country and IP addresses. Later versions describe at least one and up to three addresses in the standard entry flow, with a file option for multiple IPs. FBR material has evolved, so use the limits and format displayed in the current portal.

For cloud software, whitelist the stable outbound address used for FBR calls—not an employee laptop, a private container address or a domain name. Confirm sandbox and production egress architecture with the provider. If outbound addresses can rotate during deployment, solve that before testing or an apparently successful setup may fail later.

Build a scenario test pack

List every assigned FBR scenario and map it to a representative commercial case. For Shopify this can include a registered buyer, unregistered consumer, standard-rated item, any genuinely applicable reduced or zero-rated line, discount, shipping charge, prepaid payment and COD. Only test treatments your adviser has approved; sandbox is not a place to experiment with tax positions.

For each case preserve the Shopify-like input, expected mapping, request JSON, response JSON, FBR invoice number or validation result and tester sign-off. Mask personal data in shared evidence. Use distinctive test references so results can be found without confusing them with production.

Use the portal’s current endpoints and token

FBR technical PDFs across different versions show different endpoint names and models. That history is a warning against copying a URL from an old tutorial. Use the sandbox API and token currently shown for the taxpayer in the portal, and use the matching technical-document version.

Treat validation and posting as different actions where the current API exposes both. Validation helps diagnose a payload; posting creates the sandbox invoice result. Never send a production token to sandbox or commit any token to source control. Logs should identify the credential by environment without printing its value.

Test failures, not only successes

Intentionally omit a required field in a controlled case, send an invalid buyer identifier and use a bad reference code. Confirm that the software displays FBR’s literal message and points an operator toward the affected order or line. Then restore valid data and prove a safe retry.

Also simulate a timeout after submission. The expected result is an uncertain state, not an automatic duplicate. Confirm how invoice details or available status mechanisms are checked and how the team decides whether to retry. This is one of the most valuable production-readiness tests.

Know when sandbox is complete

Portal status is necessary, but internal sign-off should be stricter. Every assigned scenario should pass; representative Shopify mappings should reconcile; FBR numbers should be stored; invoice rendering should include the required QR and identification treatment; errors should be visible; and no secrets should appear in logs.

Ask the adviser to review payload meaning, not code. Ask operations to run an order through the workflow without developer help. Ask accounts to reconcile a test batch by count and value. Production is ready only when all three groups can perform their part.

Move to production carefully

Production uses separate credentials and may use different network authorization and endpoints. Make that boundary explicit in configuration. Start with a controlled live invoice selected by the merchant, verify the response and customer document, and confirm it appears in the relevant FBR view before expanding.

Keep the sandbox pack as regression evidence. Re-run representative cases when FBR changes documentation, when the merchant adds a tax treatment, or when the integration changes mappings. Passing once is a milestone; staying correct is the control.

Keep test and live data visibly separate

Use unmistakable environment labels in screens, exports and support tickets. Restrict production credentials to the production service and make any manual test action auditable. This prevents a copied sandbox token, endpoint or scenario from becoming a live incident.

Frequently asked questions

Does passing sandbox prove my tax treatment is correct?

No. It proves the tested payload satisfies sandbox rules. A tax adviser must still approve classifications, rates and timing.

Can I use an endpoint from an old FBR PDF?

Use the endpoint and token currently shown in the taxpayer’s portal with the matching technical documentation, because published API examples have changed over time.

What evidence should I keep?

Keep scenario inputs, mappings, request and response data, statuses, returned invoice numbers and tax, operations and technical sign-off.

Last updated: 2026-08-04

Not tax advice. Confirm registration scope, rates, deadlines, and filing obligations with a Pakistani tax practitioner against current FBR SROs and the Sales Tax Act. ComplyStream is not affiliated with FBR or PRAL.

Ready to connect Shopify to your invoice workflow?

Install ComplyStream, review the current product capabilities and follow the setup steps with your approved tax configuration.

Related guides