Skip to content

FBR invoice validator playground

Runs in your browser: nothing you type is uploaded or stored.

Invoice JSON

Edit the invoice. The example has three problems; load a valid one to compare.

Result

3 problem(s)Invalid
  • 0005 invoiceDate

    Invoice date must be in YYYY-MM-DD format

  • 0058 buyerNTNCNIC

    Buyer and seller must be different (self-invoicing is not allowed)

  • 0104 items[0].salesTaxApplicable

    Sales tax should be 222.12 for this rate

It cannot check what needs FBR's reference APIs, such as registration status or whether an HS code is in FBR's lists. A valid result means FBR's own validation is likely to pass, not that it will.

Usage
import { validateFbrInvoice } from "pakdatakit";

validateFbrInvoice(invoice);
// → {
//   "valid": false,
//   "errors": [
//     {
//       "code": "0005",
//       "field": "invoiceDate",
//       "message": "Invoice date must be in YYYY-MM-DD format"
//     },
//     {
//       "code": "0058",
//       "field": "buyerNTNCNIC",
//       "message": "Buyer and seller must be different (self-invoicing is not allowed)"
//     },
//     {
//       "code": "0104",
//       "field": "items[0].salesTaxApplicable",
//       "message": "Sales tax should be 222.12 for this rate"
//     }
//   ]
// }