🍗 PCK ZRA Middleware Wiki

Field Mappings & VAT Categories

The definitive field-by-field reference for every translation the middleware performs: Taxint → Chrilan invoices, Chrilan → Taxint responses, and Oracle → Chrilan products.

Taxint → Chrilan invoice

Taxint fieldChrilan fieldNotes
BuyerInfo.BuyerTINtpinBuyer/customer TPIN; empty string when not provided
FolioHeaderInfo.InvoiceCurrencyCodecurrencye.g. ZMW
FolioHeaderInfo.InvoiceCurrencyRaterateExchange rate
FolioHeaderInfo.CashierNumberauditNumberUnique transaction identifier
SellerInfo.SellerContactDetails.NumbercellContact phone
(hardcoded "system")userAPI user identifier
(generated UUID)localidUnique local identifier
FolioHeaderInfo.FolioTyperefundtrue when a credit note
(lookup in fiscal_invoices)refundNumberOriginal ZRA receipt number
(lookup in fiscal_invoices)refundReceiptSDCOriginal SDC ID
(hardcoded "06")refundResCodeRefund reason code
BuyerInfo.BuyerLpolpoLPO number
BuyerInfo.BuyerLpo != nullisLpoBoolean flag
TPIN direction The Chrilan tpin is the buyer's TPIN (from BuyerInfo.BuyerTIN), not the seller's. The seller's TPIN comes from DocumentInfo.PropertyTaxNumber and is used for store resolution and records.

Taxint postings → Chrilan lines

Taxint fieldChrilan fieldNotes
Postings[].TrxCodelines[].pluProduct code
Postings[].Productlines[].descriptionProduct name
abs(Postings[].Quantity)lines[].qtyAbsolute value (handles credit notes)
abs(Postings[].GrossAmount)lines[].lineTotalAbsolute value
Postings[].UnitPricelines[].recommendedRetailUnit price
(mapped from TrxInfo)lines[].vatCatSee VAT mapping below

VAT category mapping (invoices)

Taxint FiscalTrxCodeTypeChrilan vatCatDescription
ASTANDARD_RATEDStandard VAT rate (16%)
DZERO_RATED_BY_NATUREZero-rated (excluded)
EEXEMPTVAT exempt
TSTANDARD_RATEDTourism levy, treated as standard

This mapping is configurable under conversion.fiscal-code-mapping in the application configuration.

Chrilan response → Taxint response

Chrilan fieldTaxint outputDescription
response.rcptNofiscalFolioNo (top level)ZRA receipt number
response.sdcId"sdcId"Smart Device Controller ID
response.mrcNo"mrcNo"MRC number
response.qrCodeUrl"QR_CODE_URL"QR code URL
(fetched QR image → base64)"QR_CODE" / BASE64_TO_IMAGEQR code image for printing
response.rcptSign"rcptSign"Digital receipt signature
response.taxData"COLL_TAX1" / "taxData"JSON tax breakdown
response.intrlData"intrlData"Internal data
response.vsdcRcptPbctDate"vsdcRcptPbctDate"VSDC receipt publication date
(pass-through from BuyerInfo)"BuyerHouseNo", "BuyerStreet", "BuyerProvince"Buyer address for POS check printing

Oracle menu → Chrilan product

Oracle fieldChrilan fieldNotes
menuItemIdpluProduct code (string)
name (resolved)nameProduct name
definitions[].prices[priceSequence=1].pricesellingInclDine-in/standard price
(hardcoded)type = singleItemProduct type
definitions[0].taxClassRef → tax mapvatCatResolved from live Oracle tax definitions; fallback STANDARD_RATED
store.defaultDepartmentdepartmentDefault 50203301
(hardcoded)countryOfOrigin = ZMZambia
(hardcoded)user = AUTOMATEDSync user
(hardcoded)qty = 0Stock quantity
(hardcoded)archive = falseNot archived

Oracle tax → Chrilan vatCat (menu sync)

Oracle taxTypePercentageChrilan vatCat
disabledanyEXEMPT
includedPercent, addonPercent, addonBreakpoint, surcharge= 0ZERO_RATED_BY_NATURE
same types> 0STANDARD_RATED
(no active rates)EXEMPT
(lookup miss / fetch failure)STANDARD_RATED fallback

Full resolution logic: Platform: Menu Synchronization.