π‘ Expected API β COOCO calls RideNDine
The list of API endpoints COOCO will call on RideNDine per phase. All paths below are COOCO's proposals β RideNDine needs to confirm or provide the correct paths.
All requests from COOCO go through the Directus Extension on the backend β never called directly from the browser/client.
π Endpoint Listβ
| Phase | Method | Path | Trigger / Use Case | Status | Notes |
|---|---|---|---|---|---|
| Phase 1 | POST | /merchants/sync | Chef approved + store ready | β³ PENDING | Confirm path or provide correct endpoint |
| Phase 2 | POST | /checkout/quote | Customer checkout β before displaying total | β³ PENDING | Confirm path or provide correct endpoint |
| Phase 3 | POST | /orders/create | Customer confirms order | β³ PENDING | Confirm path or provide correct endpoint |
| Phase 4 | POST | /payment/process | Initiate payment | β³ PENDING | Confirm path or provide correct endpoint |
| Phase 5 | PATCH | /orders/status | Chef updates preparation status | β³ PENDING | Confirm path or provide correct endpoint |
| Phase 8 | GET | /orders/{id}/ledger | Admin financial reconciliation | β³ PENDING | Optional if ledger webhook is configured |
| Phase 9 | GET | /payouts/preview?chefId={id} | Chef views payout preview | β³ PENDING | Confirm path or provide correct endpoint |
| Phase 10 | POST | /refunds/create | Request a refund | β³ PENDING | Confirm path or provide correct endpoint |
π Endpoint Detailsβ
POST /merchants/sync β Phase 1β
Synchronize merchant information from COOCO to RideNDine when a chef is approved and the store is ready.
Header: Idempotency-Key: merchant_sync_{store_id}
POST /checkout/quote β Phase 2β
Fetch a quote from RideNDine (delivery fee, service fee, tax, tip) before displaying the total to the customer.
POST /orders/create β Phase 3β
Create an order on RideNDine after the customer confirms checkout.
Header: Idempotency-Key: cooco_order_{orders.id}
POST /payment/process β Phase 4β
Initiate a payment session β receive client_secret or checkout_url to embed the Stripe UI.
PATCH /orders/status β Phase 5β
Update the chef's preparation status (PREPARING / READY / CANCELLED) so RideNDine can coordinate the driver.
GET /orders/{id}/ledger β Phase 8β
Retrieve the financial breakdown of an order when an admin opens the details. Only used if the ledger webhook is not configured.
GET /payouts/preview?chefId={id} β Phase 9β
View the list of upcoming payouts to be transferred to the chef.
POST /refunds/create β Phase 10β
Submit a refund request for RideNDine to process via Stripe.