{
  "PK-FBR": {
    "code": "PK-FBR",
    "label": "Pakistan — Federal Board of Revenue, Digital Invoicing",
    "timezone": "Asia/Karachi",
    "spec": "Technical Specification for DI API V1.12 (PRAL, 24-Jul-2025)",
    "specUrl": "https://fbr.gov.pk/di-technical-assistance/173967/173970",
    "headerFields": [
      {
        "name": "invoiceType",
        "required": true,
        "note": "Sale Invoice or Debit Note are the only document types the API accepts."
      },
      {
        "name": "invoiceDate",
        "required": true,
        "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
        "patternNote": "YYYY-MM-DD"
      },
      {
        "name": "sellerNTNCNIC",
        "required": true,
        "pattern": "^\\d{7}-\\d{1}$|^\\d{13}$|^\\d{15}$",
        "patternNote": "NTN NNNNNNN-D, or 13/15-digit CNIC"
      },
      {
        "name": "sellerBusinessName",
        "required": true
      },
      {
        "name": "sellerProvince",
        "required": true
      },
      {
        "name": "sellerAddress",
        "required": true
      },
      {
        "name": "buyerNTNCNIC",
        "required": "unlessUnregistered",
        "pattern": "^\\d{7}-\\d{1}$|^\\d{13}$|^\\d{15}$",
        "patternNote": "optional only when buyerRegistrationType is Unregistered"
      },
      {
        "name": "buyerBusinessName",
        "required": true
      },
      {
        "name": "buyerProvince",
        "required": true
      },
      {
        "name": "buyerAddress",
        "required": true
      },
      {
        "name": "buyerRegistrationType",
        "required": true
      },
      {
        "name": "invoiceRefNo",
        "required": "forDebitNote",
        "note": "For a debit note this must be FBR's own DI number: 22 characters for NTN-based, 28 for CNIC-based."
      }
    ],
    "itemFields": [
      {
        "name": "hsCode",
        "required": true,
        "pattern": "^\\d{4}\\.\\d{4}$",
        "patternNote": "dotted form, e.g. 0101.2100"
      },
      {
        "name": "productDescription",
        "required": true
      },
      {
        "name": "rate",
        "required": true
      },
      {
        "name": "uoM",
        "required": true
      },
      {
        "name": "quantity",
        "required": true
      },
      {
        "name": "totalValues",
        "required": true,
        "note": "inclusive of tax"
      },
      {
        "name": "valueSalesExcludingST",
        "required": true
      },
      {
        "name": "fixedNotifiedValueOrRetailPrice",
        "required": true
      },
      {
        "name": "salesTaxApplicable",
        "required": true
      },
      {
        "name": "salesTaxWithheldAtSource",
        "required": true
      },
      {
        "name": "sroItemSerialNo",
        "required": "ifSroScheduleNo",
        "note": "becomes mandatory whenever sroScheduleNo is filled"
      }
    ],
    "businessRules": [
      {
        "id": "note-window",
        "appliesTo": "Debit Note",
        "test": "a note may only reference an original invoice issued within the last 180 days",
        "source": "DI API V1.12 return rules"
      },
      {
        "id": "note-value",
        "appliesTo": "Debit Note",
        "test": "note value must not exceed the referenced original invoice value",
        "source": "DI API V1.12 return rules"
      },
      {
        "id": "note-once",
        "appliesTo": "Debit Note",
        "test": "only one credit/debit note per original invoice; a second returns \"Reference invoice already exist\"",
        "source": "DI API V1.12 return rules"
      },
      {
        "id": "no-self-invoicing",
        "appliesTo": "any",
        "test": "buyer identifier must not equal seller identifier; self-invoicing is rejected with error code 0058",
        "source": "DI API V1.12 / PRAL validation code 0058"
      },
      {
        "id": "note-date-order",
        "appliesTo": "Debit Note",
        "test": "note date must be on or after the original invoice date",
        "source": "DI API V1.12 return rules"
      }
    ],
    "channelRules": {
      "editWindowHours": 72,
      "editWindowSource": "STGO 01 of 2026, C.No.1(190)ST-L&P/2026/33-166, 30-Mar-2026",
      "afterWindow": "Cancellation, deletion or edit after the window requires the prior approval of the concerned Commissioner Inland Revenue. It is a legal petition, not a software change.",
      "posVsDigital": [
        {
          "when": "buyer is sales-tax registered and the two identifiers differ",
          "channel": "Digital Invoicing",
          "why": "A B2B supply to a registered buyer must carry the buyer into the authority's annexure. The POS/IMS channel does not populate the buyer, so a registered buyer filed through POS loses the input credit trail."
        },
        {
          "when": "buyer is unregistered retail",
          "channel": "POS",
          "why": "Retail sales to end consumers go through the point-of-sale channel with the fiscal component issuing the invoice number."
        },
        {
          "when": "buyer identifier equals seller identifier",
          "channel": "REJECTED",
          "why": "Self-invoicing is not allowed; the payload is rejected with code 0058."
        }
      ]
    },
    "printedInvoiceRules": [
      {
        "rule": "The FBR Digital Invoicing System logo and a QR code must be printed on every invoice.",
        "source": "DI API V1.12 section 6"
      },
      {
        "rule": "QR code version 2.0, 25x25 modules, rendered at 1.0 x 1.0 inch.",
        "source": "DI API V1.12 section 6"
      },
      {
        "rule": "The FBR/IMS invoice number must be printed on the customer receipt with its QR code.",
        "source": "PRAL POS technical document"
      },
      {
        "rule": "32 particulars are required on the printed tax invoice after SRO 1666(I)/2026, including federal tax type, rate, price per unit, amount and SRO schedule reference.",
        "source": "Sales Tax Rules 2006, r.150R(13) as amended"
      },
      {
        "rule": "FBR number format XXXXXX-DDMMYYHHMMSS-0001 and the software registration number appear on the invoice.",
        "source": "Sales Tax Rules 2006, Chapter XIV"
      },
      {
        "rule": "A signboard reading \"Integrated with FBR\" carrying the per-software registration number is required.",
        "source": "Sales Tax Rules 2006, r.150R(11)"
      }
    ],
    "operationalDuties": [
      {
        "rule": "Invoices generated while offline must be flagged offline and uploaded within 24 hours of restoration.",
        "source": "Sales Tax Rules 2006, r.150XC"
      },
      {
        "rule": "There is no automatic retry; failed uploads are resubmitted manually.",
        "source": "DI User Manual V1.5 section 5.1"
      },
      {
        "rule": "Records are retained 6 years with the ability to re-create the original transmission.",
        "source": "Sales Tax Rules 2006, r.150S/150T"
      },
      {
        "rule": "Failure or tampering of the system must be reported to the Board within 24 hours.",
        "source": "Sales Tax Rules 2006, r.150XA"
      },
      {
        "rule": "Exempt supplies also require an e-invoice.",
        "source": "Sales Tax Rules 2006, r.150R(9)"
      }
    ]
  }
}
