zr-express
Skill338 starsChanged 2 months agoApache-2.0View on GitHub
ZR Express delivery platform integration for CodFlow — all 129 public API endpoints (catalog, claims, customers, orders/parcels, delivery pricing, hubs, supplier, treasury, users, webhooks), organized per domain. Use when connecting ZR Express as a delivery company, auditing or fixing the zr_express adapter in cod-server, verifying behavior against the official API, pulling tracking/state, registering webhooks, or extending ZR Express support.
In this repository20 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- codebase-designSkill
- code-reviewSkill
- codflow-setupSkill
- codflow-updateSkill
- diagnosing-bugsSkill
- domain-modelingSkill
- ecotrackSkill
- implementSkill
- improve-codebase-architectureSkill
- meta-adsSkill
- prototypeSkill
- route-builderSkill
- storefront-vercelSkill
- tddSkill
- to-specSkill
- to-ticketsSkill
- wayfinderSkill
- whatsapp-otpSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 2 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Very specific: line 17
Start at references/ in this folder — do not guess from the raw swagger.
- Very specific: line 60
Every request also carries Accept/Content-Type application/json.
- Distinctive: line 85
All IDs (parcel, customer, address, claim, etc.) are UUIDs — any other format is an error or a legacy/alias field.
- Very specific: line 90
Create the delivery company with code: "zr_express", apiToken = ZR API key, apiUserGuid = ZR tenant Id.
- Very specific: line 92
Verify: token check → create a test parcel (POST /parcels, POST /customers/individual first) → GET /parcels/{id} returns the tracking …
- Very specific: line 101
Read the relevant references/{domain}.md + schemas/{domain}.json.
- Distinctive: line 103
Keep every header name, path, query param, and body field exactly as the reference spells them (the generated files are verbatim from …
- Very specific: line 108
Never commit ZR API keys or tenant IDs.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
ZR Express Delivery Integration
ZR Express is an Algerian cash-on-delivery delivery platform
(https://api.zrexpress.app, dashboard zrexpress.app). Its REST API covers the
full supplier flow: parcels/orders (create, bulk, exchange, refund, labels,
state updates), catalog (products, stock, receipts), customers
(individual + company, addresses, imports), claims, delivery pricing
(rates per territory), treasury (payments, payment requests, balance),
users (profile, API keys), hubs, and webhooks (programmatic
registration).
Start at references/ in this folder — do not guess from the raw swagger.
Read CONFORMANCE.md before assuming the current adapter behavior is correct —
it lists live-verified bugs (tracking 404, delete 405, address update 400, stop-desk
hub 404, geo naming) that the code comments below may not reflect.
Reference files (in this skill folder)
| File | What it holds |
endpoints-index.md | Master index — all 129 endpoints, per-domain, with auth notes |
CONFORMANCE.md | Verified audit (2026-09-10, live-tested): what works / what's broken / fix order — read before assuming current behavior is correct |
references/catalog.md | Products, stock movements, receipts, categories, catalog reports (17) |
references/claims.md | Claim categories, claims, comments, workflows (11) |
references/customers.md | Individual/company customers, addresses, imports/exports (15) |
references/orders.md | Parcels, pickup bags, modification requests, territories, labels, reports (50) |
references/delivery-pricing.md | Rates, service pricing, price lists (5) |
references/hubs.md | Hubs (2) |
references/supplier.md | Supplier profile, blocking, price-list assignments (3) |
references/treasury.md | Supplier payments, payment requests, treasury reports (15) |
references/users.md | Profile, API-key management (4) |
references/webhooks.md | Webhook endpoint CRUD (7) |
schemas/*.json | Full request/response schemas per domain (verbatim from swagger) |
Path prefix is /api/v1/… (version defaults to 1). Read the domain
reference + its schemas/{domain}.json before writing adapter code.
Codebase
cod-server/src/endpoints/delivery-companies/providers/zr_express/— the adapter (adapter.ts,types.ts,capabilities.ts) implementing theDeliveryProviderinterface used bydispatch.ts.cod-server/src/endpoints/delivery-companies/providers/registry.ts— routes company codezr_expressto the adapter;apiToken= ZR API key,apiUserGuid= ZR tenant Id.cod-server/src/endpoints/delivery-companies/webhook-handlers.ts— programmatic webhook registration (registerZrWebhook) against/api/v1/webhooks/endpoints.cod-server/src/endpoints/webhooks/zr-status-mapper.ts— maps ZR state names to CodFlow statuses.
Auth
- Headers:
X-Api-Key: {secretKey}+X-Tenant: {tenantId}(the adapter uses these consistently; the swagger also listsBearer). - Every request also carries
Accept/Content-Typeapplication/json.
Gotchas (verified against the live integration)
- No separate validation step — ZR auto-activates parcels on creation;
validateShipmentis a no-op. - Single create returns a parcel UUID; the tracking number only comes back from
GET /parcels/{id}. Bulk create (POST /parcels/bulk) returns the tracking number directly.maxBulkCreate= 100. - Territories are UUIDs (city + district), not
wilaya_id/commune strings — resolve them viaPOST /territories/searchand cache the city per wilaya. - Auth is
X-Api-Key+X-Tenant— do not switch toAuthorization: Bearerjust because examples show it; the storedapiTokenis an API key. - State names are free text (
data.state.name), not a fixed enum: only"Out for Delivery","In Transit"and"At Hub"are documented defaults. Unknown names must surface asunmapped— never guessed into a status. - Label URLs expire (~1 hour, SAS-token based) — from create you get a
deferred label token (CodFlow uses
DEFERRED_LABEL_MARKER); serve labels server-side, never expose a signed URL to the browser. - Update semantics —
PATCH /parcels/{id}/amount,/customerand/deliveryAddressapply whilecanUpdateAfterValidation: true. - Delete is unreliable (HTTP 405 in tests) —
canDeleteBeforeValidation/AfterValidationare both false; prefer state updates/refund flows. - Webhook registration is API-driven —
POST /webhooks/endpointswithX-Api-Key+X-Tenant; the registered URL is CodFlow's/webhooks/zr_express. - All IDs (parcel, customer, address, claim, etc.) are UUIDs — any other format is an error or a legacy/alias field.
Workflow A — Connect ZR Express
- Create the delivery company with
code: "zr_express",apiToken= ZR API key,apiUserGuid= ZR tenant Id. - Verify: token check → create a test parcel (
POST /parcels,POST /customers/individualfirst) →GET /parcels/{id}returns the tracking number →POST /parcels/labels/individual→ tracking pull (GET /parcels/{id}/state-history). - Register the webhook (
registerZrWebhook→POST /webhooks/endpoints) and configurewebhook_status_mappingfor any non-default state names.
Workflow B — Audit / fix the integration
- Read the relevant
references/{domain}.md+schemas/{domain}.json. - Diff
adapter.ts/types.tsendpoint-by-endpoint against the reference. - Keep every header name, path, query param, and body field exactly as the reference spells them (the generated files are verbatim from swagger).
Security
Never commit ZR API keys or tenant IDs. They live in wrangler secrets /
.dev.vars only (repo convention).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

