CS ComplyStream
Toggle menu
BOFU P1

FBR Invoice Errors: Messages, Causes and Fixes

When an FBR invoice fails, start with the literal response—not a generic “sync failed” label. These operator playbooks turn common messages into safe corrective actions.

Before fixing any error

Save the literal FBR response, request time, environment, Shopify order reference and a redacted payload. Distinguish a validation rejection from a network timeout. A clear rejection generally means the invoice was not accepted; a timeout can mean the response was lost after acceptance. Never use repeated clicking as a diagnostic tool.

FBR’s Technical Documentation for DI API V1.12 contains invoice- and item-level error codes, but messages and validation can change. The examples below use literal messages published in that documentation where available and common transport messages separately identified. Compare every response to the current FBR document and portal.

“0041 Provide invoice No.”

Cause: the invoice number field required by that request or validation context is empty, omitted or mapped to null. This can happen when software sends a Shopify display name in one branch but has no fallback for a draft, imported or manually created order.

Fix: identify which invoice-number field the current API operation requires and map a stable merchant invoice reference in the accepted format. Do not insert a random number. Revalidate the payload, preserve the merchant reference, and submit once after confirming no valid FBR invoice already exists for the order.

“0088 invoice No. is allowed. (-) should be invoice number in alphanumeric format.”

Cause: the merchant invoice reference contains unsupported characters or does not follow the current alphanumeric and hyphen format indicated by the FBR message. Shopify names can include prefixes or punctuation chosen in store settings.

Fix: apply a documented normalization rule that preserves uniqueness. Test prefixes, hyphens and maximum length against the current specification. Keep the original Shopify order name separately for search and audit; do not overwrite it merely to satisfy the API.

“Invoice number cannot be empty, please provide invoice number.”

Cause: this companion text to the published invoice-number validation means the required value reached FBR as blank. Inspect the final serialized JSON, not only the value displayed in the app, because casting and conditional payload construction can remove empty values.

Fix: populate the approved merchant reference at the source, regenerate the preview and validate again. If the order predates the integration and has no compliant reference, agree a migration convention with accounts before submitting historical data.

“Seller Registration No is not valid.”

Cause: the configured seller identifier may contain spaces or punctuation, belong to another entity, use the wrong NTN/CNIC form, or not match the token and registration context. This is especially common in groups operating several Shopify stores.

Fix: compare the seller registration value to the taxpayer profile associated with the sandbox or production token. Correct the merchant-level configuration rather than editing one order. If the portal data itself appears wrong, raise the issue through the selected integrator or FBR support route.

“Buyer Registration No is not valid.”

Cause: a buyer has been marked as registered but the supplied identifier is malformed, stale or placed in the wrong field. A company name in Shopify is not evidence of sales-tax registration.

Fix: verify the buyer status and identifier from an approved source. Normalize only formatting that the specification permits. If the buyer is genuinely unregistered, apply the adviser-approved unregistered-buyer mapping; do not simply toggle status to make the error disappear.

“HS Code is invalid.”

Cause: the product or variant has no HS mapping, the value contains an unsupported format, or the code is not valid for the selected scenario or current reference list. Free-text Shopify product types are not HS codes.

Fix: send the affected SKU to the tax-data owner, record the approved HS code in a controlled product mapping and revalidate. Apply the correction to future orders using the same product, but do not bulk-change historical invoices without an approved effective date.

“Rate is invalid.”

Cause: the rate label does not exactly match an accepted FBR value, conflicts with the selected sale type or scenario, or is no longer in the current reference data. Numeric 18, text “18%” and a rate identifier may not be interchangeable.

Fix: use the current rate list or reference API required by the matching technical version and have the adviser confirm applicability. Update rate and sale-type mappings together. Never change a rate solely because another value passes validation.

“UOM is invalid.”

Cause: Shopify’s weight unit, inventory unit or free-text product tag has been sent where FBR expects a recognized unit of measure. The correct UOM can vary by product and tax scenario.

Fix: map each product family to a current accepted UOM value, approved alongside its HS code. Validate exact spelling and code format. Avoid one global “Numbers” value unless it accurately describes every supplied item.

“Scenario ID is invalid.”

Cause: sandbox requires a scenario assigned to the taxpayer’s selected business nature and sector, but the payload uses an unrelated sample scenario, omits it or sends it to the wrong environment. Production and sandbox requirements may differ.

Fix: open the taxpayer’s sandbox details, identify the assigned scenarios and use the current sample data only as a structural guide. Do not carry a sandbox scenario field into production unless the current production specification requires it.

“Unauthorized” or HTTP 401

Cause: the token is missing, malformed, expired, copied with whitespace, sent under the wrong authorization scheme, or belongs to the other environment. It can also indicate a token was replaced while software still uses the old secret.

Fix: verify environment, endpoint and authorization header against the taxpayer’s current portal details. Replace the secret through the application’s secure configuration, never in code or logs. Send a validation request, then revoke or rotate exposed credentials through the approved process.

“Forbidden” or an IP authorization error

Cause: the request is leaving through a public IP that is not approved, the whitelist is still pending, or the integration is calling an endpoint that the token cannot access. Cloud deployments sometimes rotate egress addresses without the application team noticing.

Fix: record the actual outbound public IP observed for the request and compare it with the portal or integrator record. Stabilize egress, submit the correct whitelist details and wait for confirmed approval. Do not whitelist a developer’s temporary address as a production fix.

Timeout, 502 or 503 with no FBR result

Cause: the request may have failed before reaching FBR, or FBR may have accepted it but the gateway response did not reach the app. Unlike a validation message, this outcome is ambiguous.

Fix: mark the invoice “status unknown.” Search by available merchant reference or use the current invoice-detail/status facility through the configured route. If an FBR invoice number exists, link it instead of resubmitting. Retry only when the team has evidence that the first attempt was not accepted, using idempotency or duplicate controls available in the workflow.

A fix is complete only after reconciliation

After correction, store the new response and preserve the failed attempt. Confirm line values, tax totals, FBR invoice number, QR output and Shopify link. Then check whether the same bad mapping affects other queued or already submitted orders.

If the correction concerns a valid invoice already issued, stop treating it as a retry. STGO 01 of 2026 addresses cancel, delete or edit actions for a bona fide mistake within 72 hours and prior Commissioner approval afterward; other commercial changes may require debit or credit-note treatment under section 9 of the Sales Tax Act, 1990. Get advice before acting.

Frequently asked questions

Should I retry an FBR invoice after a timeout?

Not until you check whether FBR accepted the first request. A timeout is ambiguous and blind retries can create duplicates.

Can I change a tax rate until validation passes?

No. Validation acceptance does not determine the legally correct treatment. Use a rate approved by your tax adviser and the current FBR reference data.

What should an error log contain?

Keep time, environment, Shopify reference, redacted payload, literal response, normalized status and retry or resolution history. Never log tokens.

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