Skip to main content

πŸ“‘ 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.

important

All requests from COOCO go through the Directus Extension on the backend β€” never called directly from the browser/client.


πŸ“‹ Endpoint List​

PhaseMethodPathTrigger / Use CaseStatusNotes
Phase 1POST/merchants/syncChef approved + store ready⏳ PENDINGConfirm path or provide correct endpoint
Phase 2POST/checkout/quoteCustomer checkout β€” before displaying total⏳ PENDINGConfirm path or provide correct endpoint
Phase 3POST/orders/createCustomer confirms order⏳ PENDINGConfirm path or provide correct endpoint
Phase 4POST/payment/processInitiate payment⏳ PENDINGConfirm path or provide correct endpoint
Phase 5PATCH/orders/statusChef updates preparation status⏳ PENDINGConfirm path or provide correct endpoint
Phase 8GET/orders/{id}/ledgerAdmin financial reconciliation⏳ PENDINGOptional if ledger webhook is configured
Phase 9GET/payouts/preview?chefId={id}Chef views payout preview⏳ PENDINGConfirm path or provide correct endpoint
Phase 10POST/refunds/createRequest a refund⏳ PENDINGConfirm 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.