Single-file tester: settings store, TLS diagnostics, official invoice model POST.
Sandbox / Production URLs + Bearer token + POS ID. Success response Code 100.
Stored in settings.local.php (auto-created). Production token POS Registration → Pos Details se copy karo. Sandbox ke liye official shared token use ho sakta hai.
https://ims.pral.com.pk/ims/sandbox/api/Live/PostData24d8fab3-f2e9-398f-ae17-b387125ec4a2https://ims.pral.com.pk/ims/production/api/Live/PostDataunexpected eof while reading = TLS handshake drop (Hostinger blockage / PRA firewall). Yeh DNS → socket → HTTPS → outbound IP check karta hai.
POST official invoice model (manual §6.4.3) with Bearer auth.
cURL: TLS 1.2 + HTTP/1.1. Success: Code: "100" + InvoiceNumber.
{
"InvoiceNumber": "",
"POSID": 201582,
"USIN": "TEST-20261012173527-613",
"DateTime": "2026-10-12 17:35:27",
"BuyerPNTN": "",
"BuyerCNIC": "",
"BuyerName": "Walk-in Tester",
"BuyerPhoneNumber": "00000000000",
"TotalBillAmount": 11.6,
"TotalQuantity": 1,
"TotalSaleValue": 10,
"TotalTaxCharged": 1.6,
"Discount": 0,
"FurtherTax": 0,
"PaymentMode": 1,
"RefUSIN": null,
"InvoiceType": 1,
"Items": [
{
"ItemCode": "TEST-01",
"ItemName": "Connection Test Service",
"Quantity": 1,
"PCTCode": "00000000",
"TaxRate": 16,
"SaleValue": 10,
"TotalAmount": 11.6,
"TaxCharged": 1.6,
"Discount": 0,
"FurtherTax": 0,
"InvoiceType": 1,
"RefUSIN": null
}
]
}
localhost:8524) Hostinger pe kaam nahi karta — woh local POS Component service hai.
Cloud testing ke liye Sandbox/Production ims.pral.com.pk URLs use karo.
Agar TLS eof aaye: Diagnostics → outbound IP → Whitelist tab se email bhejo.
Production post ke liye PRA server pe IP whitelist lazmi hai.
Email: eims@pra.punjab.gov.pk. Pehle Diagnostics chalao taake SERVER IP auto mil jaye.
Manual §6 — fields jo is tester me POST hote hain.
| Field | Status | Notes |
|---|---|---|
| InvoiceNumber | Blank | PRA fill karta hai |
| POSID | Compulsory | bigint — registration POS ID |
| USIN | Compulsory | aapki unique invoice # |
| DateTime | Compulsory | Y-m-d H:i:s |
| TotalSaleValue / TotalTaxCharged / TotalBillAmount | Compulsory | doubles |
| PaymentMode | Compulsory | 1 Cash … 6 Cheque |
| InvoiceType | Compulsory | 1 New, 2 Debit, 3 Credit |
| Items[] | Compulsory | ItemCode, ItemName, PCTCode, Qty, TaxRate, SaleValue, TaxCharged, TotalAmount… |
{
"InvoiceNumber": "90000520191112000369",
"Response": "Invoice received successfully",
"Code": "100"
}