SRV-34 — V2 — Carrier API & WhatsApp Business integrations
Shipment creation and tracking webhooks with the selected carrier(s); WhatsApp Business templates for confirmations and reminders.
| Field | Details |
|---|---|
| Task code | SRV-34 |
| Phase | P4 — V2 evolutions |
| Product scope | V2 |
| Status | Planned |
| Start | Tue 2 Feb 2027 |
| Due | Sun 7 Feb 2027 |
| Responsible | Anis — Full-stack developer |
| Co-responsible | — |
| Effort | 3 person-day(s) planned · 6 from scratch · size M |
| Area · app | Server · server |
| Depends on | SRV-32 |
| Unblocks | SRV-37 |
| Milestones | — |
Summary
Shipment creation and tracking webhooks with the selected carrier(s); WhatsApp Business templates for confirmations and reminders.
Description
Carrier API integration and the WhatsApp Business API are V2 (cahier §11, §14.2; DLV-05, NOT-08). In V1, carriers are assigned manually with a tracking number and WhatsApp is only a share link and the regional support button. This task adds a carrier adapter interface (create shipment, label, cancel, tracking webhooks with signature checks) implemented for the carrier(s) HOCO selects, maps carrier statuses to DeliveryStatus, and adds a WHATSAPP channel adapter to the notification service using approved WhatsApp Business templates for order confirmations, status updates and payment reminders, with opt-in tracking and per-conversation cost monitoring. Out of scope: changes to the regional support routing (V1, SRV-24).
Subtasks
| # | Subtask | Owner |
|---|---|---|
| 1 | Carrier adapter interface (createShipment, getLabel, cancel, parseWebhook) and registry per Carrier with API credentials in env groups | Anis |
| 2 | Implementation for the selected carrier(s): shipment creation on READY, label PDF, tracking number stored on Delivery | Anis |
| 3 | Tracking webhook endpoint with signature verification, idempotent processing and status mapping to DeliveryStatus/OrderStatus | Anis |
| 4 | Fallback to manual mode when the carrier API fails, with alert to the delivery manager | Anis |
| 5 | WhatsApp Business API account setup, template submission and approval (fr/ar) | Anis |
| 6 | WHATSAPP channel adapter in the notification service with opt-in records and delivery statuses | Anis |
| 7 | Rules for WhatsApp messages: order confirmed, shipped, delivered, payment reminder; cost dashboard | Anis |
Deliverables
- apps/server/src/modules/integrations/carriers/{adapter.ts,<carrier>.ts,webhooks.router.ts}
- apps/server/src/modules/notifications/adapters/whatsapp.ts
- Approved WhatsApp template list and carrier integration notes in /docs/srs/integrations
Acceptance criteria
- Marking an order READY with an API carrier creates the shipment and stores the tracking number automatically (DLV-05)
- A carrier delivered webhook moves the delivery and the order to DELIVERED once, even if sent twice (DLV-05)
- A reseller who opted in receives the WhatsApp template when the order is confirmed; one who did not receives none (NOT-08)
- A carrier API outage switches the delivery to manual mode and alerts the delivery manager
Requirements covered
| Requirement | Title | Release |
|---|---|---|
| DLV-05 | Carrier API integration (shipment creation, tracking webhooks) | V2 |
| NOT-08 | WhatsApp Business API automated messages | V2 |
API surface
| Endpoint group | Operations |
|---|---|
| Orders & delivery | 21 |
Test measures
- Contract tests against the carrier sandbox
- Webhook replay and signature tests
- WhatsApp sandbox test with template messages
Risks
- Carrier APIs and WhatsApp template approvals take time and cost per message — start provider onboarding at the start of P4 and keep manual modes available
KPI
- Delivered by Sun 7 Feb 2027 within 3 person-day(s).
- Every acceptance criterion above demonstrated before hand-off; linked requirements' acceptance criteria pass.
- Zero open critical defects, permission gaps or data-integrity regressions at sign-off.
Generated from content/plan/tasks.json by scripts/generate-team-tasks.mjs. Dates are computed by the scheduler (Sunday–Thursday weeks, holidays excluded) — change the plan, not this page.
SRV-32 — V2 — Detailed credit, reminders, credit notes, accounting export
Payment terms and due dates, blocking/approval policy, automatic reminders, credit notes and receipts, accounting export formats.
SRV-37 — V2 — Tour optimisation & stock-system sync
Routing-engine based visit ordering with time windows; API synchronisation with HOCO's stock system.