Partner Carrier API — Integration Guide
Partner Carrier API — v1
Overview
Dispatch staff at Diva Cakes offer delivery jobs to your organization. Your system:
- polls for offered jobs,
- accepts or declines each offer,
- reports progress as the delivery moves,
- marks the job delivered on completion.
Base URL: https://supportdesk.divacakes.com.ng/divatrack/api/v1/carrier
Authentication
Every request carries a bearer key issued by Diva Cakes IT — one key per carrier. Treat it like a password: server-side only, never in browsers or mobile apps.
Authorization: Bearer dtk_live_...
Required request format — important
Content-Type: application/json and a JSON body — even if empty ({}). The hosting platform's web application firewall rejects bodiless POSTs before they reach the API (HTTP 406). Always send {} when there is no payload.Endpoints
GET/jobs?state=offered|active
-
?state=offered— offers awaiting your response -
?state=active— jobs you currently hold - no parameter — everything open (both)
Recommended poll interval: 60 seconds for offered, a few minutes for active reconciliation.
curl -H "Authorization: Bearer $KEY" \
"https://supportdesk.divacakes.com.ng/divatrack/api/v1/carrier/jobs?state=offered"
GET/jobs/{job_id}
Full detail for one job. The same object shape is embedded in list results:
{
"job_id": 512,
"state": "OFFERED_TO_CARRIER",
"order_reference": "#101234",
"pickup": { "outlet": "LEKKI", "address": "12 Admiralty Way, Lekki" },
"dropoff": {
"customer_name": "Ada Lovelace",
"phone": "0803…",
"address": "Flat 4B, 5 Banana Island Rd, Ikoyi",
"area": "Ikoyi", "lga": "Eti-Osa",
"instructions": "Call when you arrive at the gate"
},
"fulfilment": { "mode": "Delivery", "date": "2026-12-01", "time_window": "2pm - 4pm", "service": "Standard" },
"item_count": 2,
"fee": 3500.00,
"offered_at": "2026-12-01 10:15:00",
"version": 4
}
Note: orders are cakes — fragile, sometimes time-critical. time_window is a customer promise.
POST/jobs/{job_id}/accept
Claim an offered job. The job becomes yours — move it through the status flow.
-
200— accepted -
409— too late: already accepted/expired/reassigned. Refresh your list.
POST/jobs/{job_id}/decline
{"reason": "no rider available in the area"}
Declined jobs leave your queue immediately and return to Diva Cakes dispatch.
POST/jobs/{job_id}/status
{"status": "picked_up", "note": "optional free-text note"}
| status | valid from | meaning |
|---|---|---|
picked_up |
after accept | rider collected the order from the outlet |
en_route |
after pick-up | on the way to the customer |
arrived |
en route / picked up | at the delivery location |
delivered |
arrived | handed to the customer |
failed |
any active state | delivery impossible — include the reason in note
|
The sequence is enforced: you cannot mark delivered without arrived first. 409 means your view of the job is stale — GET /jobs/{id} and resync.
Idempotency — important
Network retries must never double-execute. Send a unique Idempotency-Key header with every POST (e.g. your internal event id). Replays of the same key return the original response without re-executing. If you omit it, duplicate accepts/updates are still guarded by state validation, but you lose exact-once semantics.
curl -X POST \
-H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: accept-512-your-internal-id" \
-d '{}' \
"https://supportdesk.divacakes.com.ng/divatrack/api/v1/carrier/jobs/512/accept"
Errors
| code | meaning |
|---|---|
| 401 | missing/revoked API key |
| 404 | job doesn't exist or isn't yours |
| 405 | wrong HTTP method |
| 406 | missing JSON body — see required request format |
| 409 | state conflict — refresh and retry |
| 422 | malformed request body |
All error bodies are {"error": "human readable message"}.
Delivery confirmation
delivered updates are visible to us and void the partnership — only mark delivered when the goods are physically handed over.Sandbox
Ask Diva Cakes IT for a test carrier account and test jobs before going live. Test keys are dtk_test_... and only see test jobs.
Questions on this integration: Diva Cakes IT · it@divacakes.com.ng