Ordexs API v1 Get an API key

Selling cash on delivery

Customers

One record per person who ordered, with their delivery history, a reliability score, consent for WhatsApp, and the merchant's saved segments.

One customer per phone

Every order is matched to a customer by phone (or email when there is no phone). The customer record keeps the counts the merchant looks at before confirming a cash-on-delivery order: orders_count, delivered_count, returned_count, cancelled_count, total_spent.

Look one up by phone with GET /v1/customers?phone=0551234567, and list their orders with GET /v1/orders?customer_id=cus_….

Reliability

reliability is the customer's delivery score: how likely they are to accept a COD parcel. score is a percentage built from their finished orders: delivered counts for them, returned against them, cancelled half against them. Orders at other Ordexs stores count at half weight, and an order's weight halves every 180 days, so recent behaviour matters most.

tierscoreMeans
reliable75–100Usually accepts the parcel.
uncertain50–74Accepts some, refuses or returns others.
risky0–49Often refuses or returns. Worth a confirmation call before shipping.
newnullNo delivered, returned or cancelled order yet.

It is the same score the dashboard shows on customers and order cards, recalculated as orders are delivered or returned.

Blocking and follow-up

PATCH /v1/customers/{id} with status:

  • needs_followup flags the customer for the team;
  • do_not_contact blocks them, like Block on the Customers page;
  • active lifts either.

whatsapp_opt_in records whether the customer agreed to receive WhatsApp messages, and whatsapp_opt_in_at when. Set it with PATCH /v1/customers/{id} only when the customer actually agreed.

Segments

The merchant saves segments on the Customers page (reliable buyers, customers who haven't ordered in 60 days, one wilaya…). GET /v1/customer_segments lists them with their current size, and GET /v1/customer_segments/{id}/customers lists who is in one right now. A segment is a saved filter: its members change as customers do.