🍗 PCK ZRA Middleware Wiki

REST API Reference

All endpoints live under the context path /pckzra. Interactive documentation with try-it-out is available at /pckzra/swagger-ui.html (OpenAPI JSON at /pckzra/v3/api-docs).

Taxint API — /api/taxint

Used by POS terminals. Bearer JWT authentication.

MethodPathDescription
POST/api/taxint/pos/uploadSubmit an invoice, credit note or debit note for fiscal registration. See the integration guide.
GET/api/taxint/healthHealth check: service status, version, timestamp.

Health check response:

{
  "status": "UP",
  "timestamp": "2026-08-01T14:52:39",
  "version": "1.0.0",
  "service": "Taxint-Chrilan Middleware"
}

Stores API — /api/stores

Store registration management (also available via the web portal).

MethodPathDescription
GET/api/storesList all stores
POST/api/storesRegister a new store (SellerName uniqueness enforced)
GET/api/stores/{id}Get a store by ID
PUT/api/stores/{id}Update store fields
DELETE/api/stores/{id}Permanently delete a store (prefer deactivate)
GET/api/stores/activeList active stores only
GET/api/stores/by-name/{sellerName}Look up a store by exact SellerName
GET/api/stores/searchPartial name search
POST/api/stores/{id}/activateActivate a store
POST/api/stores/{id}/deactivateDeactivate (soft delete) a store
GET/api/stores/statsCounts: total / active / inactive

Store object fields

FieldDescription
sellerNamePrimary identifier — must match the POS SellerInfo.SellerName exactly
tpinStore Tax Payer Identification Number
chrilanApiKeyPer-store Chrilan API key
activeOnly active stores can submit invoices
oracleMenuPath{OrgShortName}:{LocationRef}:{RevenueCenterRef}
menuSyncEnabledInclude this store in the 60-second sync cycle
defaultDepartmentChrilan department code (default 50203301)
notificationPhone / notificationGroupIdWhatsApp alert targets

Reports API — /api/reports

Statistics and audit-trail queries. This is the only statistics surface (there is no /api/taxint/statistics).

MethodPathDescription
GET/api/reports/statisticsTotal/successful/failed counts + success rate; filter by store and date range
GET/api/reports/transactionsPaginated transaction history
GET/api/reports/transactions/{transactionId}Full request/response detail for one transaction
GET/api/reports/transactions/failedFailed transactions (default: last 7 days)
GET/api/reports/conversionsPaginated conversion log history
GET/api/reports/conversions/{id}Single conversion detail
GET/api/reports/conversions/failedFailed conversions
GET/api/reports/volume-by-storeTransaction counts per store
GET/api/reports/active-storesSimple store list for report filter UIs

Web portal routes

Server-rendered (Thymeleaf) pages; session-based after OTP sign-in.

RoutePurpose
GET/POST /loginEmail + password; triggers WhatsApp OTP
GET/POST /verify-otpOTP entry; creates the session
POST /resend-otpIssue a fresh OTP (invalidates the previous one)
GET /dashboardLanding page after sign-in
GET /stores, /stores/add, /stores/edit/{id}Store management UI
POST /stores/save, /stores/delete/{id}Store form actions
GET /reportsReports UI
GET /logoutInvalidate the session

Actuator endpoints

PathPurpose
/pckzra/actuator/healthDetailed Spring Boot health (details always shown)
/pckzra/actuator/infoApplication info
/pckzra/actuator/metricsApplication metrics
/pckzra/actuator/prometheusPrometheus-format metrics export
/pckzra/actuator/loggersRuntime log-level inspection/adjustment

Error response shape

All API errors use a structured body with a message, a details list, and (for Chrilan failures) a Smart Invoice error block:

{
  "error": "Validation failed",
  "details": ["PropertyTaxNumber is required"]
}
StatusMeaning
400Validation / conversion failure
401Missing or invalid Bearer token
403Store not registered or inactive
404 / 405 / 415Unknown route / wrong method / wrong content type
500Chrilan API failure, timeout or internal error

Testing with curl

# Health
curl https://server.zra.co.zm/pckzra/api/taxint/health

# Upload (abridged payload)
curl -X POST https://server.zra.co.zm/pckzra/api/taxint/pos/upload \
  -H "Authorization: Bearer $JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d @sample-invoice.json

# Statistics
curl "https://server.zra.co.zm/pckzra/api/reports/statistics?startDate=2026-07-01&endDate=2026-07-31"