Skip to main content

Phase 9 β€” Chef Payouts

The chef payment flow. RideNDine handles all payouts via Stripe / Bank. COOCO provides a preview and receives results via webhook.


Overview​

RideNDine (internal) β†’ COOCO (GET preview) β†’ Chef (dashboard)
RideNDine β†’ Chef (bank transfer) β†’ COOCO (webhook)
StepFromToAction
9.1RideNDineRideNDineInternal β€” calculate chef balance
9.2COOCORideNDineGET /payouts/preview?chefId={id}
9.3RideNDineChefStripe / Bank payout
9.4RideNDineCOOCOPOST /webhooks/payout-status
9.5COOCOChefInternal β€” payout dashboard

Step 9.1 β€” Calculate Chef Balance (RideNDine Internal)​

RideNDine internally calculates the amount owed to the chef from completed orders. COOCO does not send anything at this step.


Step 9.2 β€” View Payout Preview​

From: COOCO β†’ To: RideNDine

Endpoint: GET /payouts/preview

Proxied through Directus Extension: GET /ridendine/payouts/preview.

Purpose: The chef views the upcoming payment before RideNDine initiates the transfer.

Query Parameters​

ParamValue
merchant_idstores.ridendine_merchant_id
external_merchant_idstores.id (fallback)
from_dateoptional
to_dateoptional

Step 9.3 β€” RideNDine Transfers Funds to Chef​

RideNDine executes a batch payout via Stripe / Bank transfer directly to the chef. COOCO is not involved at this step.


Step 9.4 β€” Webhook: Payout Status​

From: RideNDine β†’ To: COOCO

Endpoint (COOCO expose): {DIRECTUS_URL}/ridendine/webhooks/payout-status

Method: POST

Purpose: COOCO updates the payout history for the chef to view.

Payload received​

{
"external_merchant_id": "<stores.id>",
"amount_cents": 38500,
"status": "PENDING | COMPLETED | FAILED",
"period_start": "2026-06-01",
"period_end": "2026-06-15",
"paid_at": "<ISO8601>"
}

Save to Directus​

Save to the chef_payouts collection or a JSON field on stores.


Step 9.5 β€” Payout Dashboard (Internal)​

From: COOCO β†’ To: Chef

The cookin-web chef dashboard reads data from Directus to display the payout history.

No requests are sent to RideNDine at this step.