Skip to main content

πŸ”” 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.

caution

COOCO must fill in the actual DIRECTUS_STAGING_URL before registering these webhooks with RideNDine.


πŸ“‹ Webhook Endpoint List​

EventMethodURL (Staging)PurposeStatus
Merchant statusPOST{DIRECTUS_STAGING_URL}/ridendine/webhooks/merchant-statusUpdate stores.ridendine_merchant_status⏳ PENDING
Payment resultPOST{DIRECTUS_STAGING_URL}/ridendine/webhooks/payment-resultSet order to PAID or FAILED⏳ PENDING
Delivery statusPOST{DIRECTUS_STAGING_URL}/ridendine/webhooks/delivery-statusUpdate delivery tracking⏳ PENDING
Ledger entryPOST{DIRECTUS_STAGING_URL}/ridendine/webhooks/ledger-entrySave orders.ledger_snapshot⏳ PENDING
Payout statusPOST{DIRECTUS_STAGING_URL}/ridendine/webhooks/payout-statusUpdate chef payout history⏳ PENDING
Refund statusPOST{DIRECTUS_STAGING_URL}/ridendine/webhooks/refund-statusUpdate 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 = PAID
  • orders.status = PENDING_CHEF_APPROVAL
  • Write to integration_events with event_id (idempotency)
danger

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:

EventCOOCO action
driver_assignedSave delivery_status = DRIVER_ASSIGNED, delivery_driver_name, delivery_eta_minutes
order_picked_upSave delivery_status = PICKED_UP
order_deliveredSave 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_payouts collection or JSON field on stores

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 = REFUNDED
  • orders.status = CANCELLED
  • Directus Flow sends notification email to Customer + Chef + Admin

πŸ” Webhook Security Requirements​

Before processing any webhook, COOCO must:

  1. Read the signature header (e.g. X-RideNDine-Signature)
  2. Compute HMAC with the signing secret received from RideNDine (item #10 in checklist)
  3. Compare with the received signature β€” reject if they do not match
  4. Check event_id in integration_events β€” skip if already processed (idempotency)