π Webhook URLs β RideNDine calls COOCO
The list of webhook endpoints that COOCO exposes for RideNDine to push events into. COOCO must fill in DIRECTUS_STAGING_URL before sending this list to RideNDine.
COOCO must fill in the actual DIRECTUS_STAGING_URL before registering these webhooks with RideNDine.
π Webhook Endpoint Listβ
| Event | Method | URL (Staging) | Purpose | Status |
|---|---|---|---|---|
| Merchant status | POST | {DIRECTUS_STAGING_URL}/ridendine/webhooks/merchant-status | Update stores.ridendine_merchant_status | β³ PENDING |
| Payment result | POST | {DIRECTUS_STAGING_URL}/ridendine/webhooks/payment-result | Set order to PAID or FAILED | β³ PENDING |
| Delivery status | POST | {DIRECTUS_STAGING_URL}/ridendine/webhooks/delivery-status | Update delivery tracking | β³ PENDING |
| Ledger entry | POST | {DIRECTUS_STAGING_URL}/ridendine/webhooks/ledger-entry | Save orders.ledger_snapshot | β³ PENDING |
| Payout status | POST | {DIRECTUS_STAGING_URL}/ridendine/webhooks/payout-status | Update chef payout history | β³ PENDING |
| Refund status | POST | {DIRECTUS_STAGING_URL}/ridendine/webhooks/refund-status | Update payment_status = REFUNDED | β³ PENDING |
π Webhook Detailsβ
merchant-status β Phase 1β
URL: {DIRECTUS_STAGING_URL}/ridendine/webhooks/merchant-status
Received when RideNDine has finished processing the merchant sync and confirms the status.
COOCO action:
- Save
stores.ridendine_merchant_id - Save
stores.ridendine_merchant_status=ACTIVE/INACTIVE/REJECTED - Verify webhook signature before processing
payment-result β Phase 3β
URL: {DIRECTUS_STAGING_URL}/ridendine/webhooks/payment-result
Received when Stripe confirms a successful or failed payment.
COOCO action (when payment.succeeded):
orders.payment_status = PAIDorders.status = PENDING_CHEF_APPROVAL- Write to
integration_eventswithevent_id(idempotency)
COOCO MUST NOT set PAID from a client callback. Only trust this webhook.
delivery-status β Phase 5 & 6β
URL: {DIRECTUS_STAGING_URL}/ridendine/webhooks/delivery-status
Receives multiple events throughout the delivery lifecycle:
| Event | COOCO action |
|---|---|
driver_assigned | Save delivery_status = DRIVER_ASSIGNED, delivery_driver_name, delivery_eta_minutes |
order_picked_up | Save delivery_status = PICKED_UP |
order_delivered | Save delivery_status = DELIVERED, orders.status = COMPLETED |
ledger-entry β Phase 6β
URL: {DIRECTUS_STAGING_URL}/ridendine/webhooks/ledger-entry
Receives the financial breakdown after an order is completed.
COOCO action:
- Save the entire payload to
orders.ledger_snapshot(JSON)
payout-status β Phase 6β
URL: {DIRECTUS_STAGING_URL}/ridendine/webhooks/payout-status
Received when RideNDine executes a payout to the chef.
COOCO action:
- Save to
chef_payoutscollection or JSON field onstores
refund-status β Phase 7β
URL: {DIRECTUS_STAGING_URL}/ridendine/webhooks/refund-status
Received when Stripe confirms a refund.
COOCO action (when REFUNDED):
orders.payment_status = REFUNDEDorders.status = CANCELLED- Directus Flow sends notification email to Customer + Chef + Admin
π Webhook Security Requirementsβ
Before processing any webhook, COOCO must:
- Read the signature header (e.g.
X-RideNDine-Signature) - Compute HMAC with the signing secret received from RideNDine (item #10 in checklist)
- Compare with the received signature β reject if they do not match
- Check
event_idinintegration_eventsβ skip if already processed (idempotency)