Built and tested. The public service opens with the platform launch; until then API keys are not issued to customers.
Orders API
Use this when your store (WooCommerce, Shopify, Salla, Zid, YouCan, a custom site) should send new orders to the platform so the customer can confirm, change or cancel on WhatsApp.
total_minor is the amount in the smallest unit (piasters).
Read an order
GET /v1/orders/ord_17
What happens next
The order appears in the dashboard (Orders). Ask the customer to confirm on WhatsApp either with one click in the dashboard or from your code:
POST /v1/orders/ord_17/confirmation
It sends the approved template you chose in Orders > Settings (variables: customer name, order number, total) and sets the status to awaiting_confirmation. Errors: 422 order.no_template (no template chosen or no connected number), 409 order.closed (cancelled, delivered or returned), 409 window_closed, 502 meta.*. The customer's reply is read by the platform:
Customer replies
Order status
1, confirm, yes, ok (and Arabic equivalents)
confirmed
2, change
change_requested
3, cancel
cancel_requested
A cancel request is only flagged for your team. Nothing is cancelled automatically: that decision is yours. Every status change is sent to your webhook as order.updated, so your store can follow along.
Send a cart a shopper left without ordering, and the platform can remind them on WhatsApp with a template you approved (switch it on in Abandoned carts; nothing is sent until you do).
Your cart id, up to 60 characters. Sending the same one again updates the cart while it is still open.
customer_name, items, total, currency
no
Same rules as an order
checkout_url
no
Where the shopper finishes the order. https only.
Response 201 (or 200 when the same cart_id is updated): { "id": "cart_5", "cart_id": "C-77", "status": "open", "reminders_sent": 0 }. Template variables, in order: name, items, total, checkout link. The first reminder goes out after the delay set for the platform (default 60 minutes), at most twice, never to a customer who replied STOP or is on your blacklist. When the same number orders within 7 days the cart is marked recovered.
# Orders API
Use this when your store (WooCommerce, Shopify, Salla, Zid, YouCan, a custom site) should send new orders to the platform so the customer can **confirm, change or cancel on WhatsApp**.
## Create an order
```http
POST https://app.easytawasul.com/api/v1/orders
```
```json
{ "phone": "+201000000000", "order_id": "S-1042", "customer_name": "Mona", "total": 840, "currency": "EGP", "address": "12 Tahrir St, Cairo", "items": "2 x Shirt" }
```
| Field | Required | Notes |
|---|---|---|
| `phone` | yes | Customer phone with country code |
| `order_id` | no | Your order number, up to 60 characters. **Unique per workspace**: sending the same one again returns `409 order.exists`. |
| `customer_name` | no | Up to 120 characters |
| `total` | no | Number, 0 or more |
| `currency` | no | 3 letters. Default: the workspace currency |
| `address` | no | Up to 500 characters |
| `items` | no | Free text summary, up to 2,000 characters |
Response `201`:
```json
{ "id": "ord_17", "order_id": "S-1042", "status": "new", "customer_name": "Mona", "phone": "201000000000", "total_minor": 84000, "currency": "EGP", "confirmation_sent_at": null, "answered_at": null }
```
`total_minor` is the amount in the smallest unit (piasters).
## Read an order
```http
GET /v1/orders/ord_17
```
## What happens next
The order appears in the dashboard (**Orders**). Ask the customer to confirm on WhatsApp either with one click in the dashboard or from your code:
```http
POST /v1/orders/ord_17/confirmation
```
It sends the approved template you chose in **Orders > Settings** (variables: customer name, order number, total) and sets the status to `awaiting_confirmation`. Errors: `422 order.no_template` (no template chosen or no connected number), `409 order.closed` (cancelled, delivered or returned), `409 window_closed`, `502 meta.*`. The customer's reply is read by the platform:
| Customer replies | Order status |
|---|---|
| `1`, confirm, yes, ok (and Arabic equivalents) | `confirmed` |
| `2`, change | `change_requested` |
| `3`, cancel | `cancel_requested` |
A cancel request is **only flagged** for your team. Nothing is cancelled automatically: that decision is yours. Every status change is sent to your [webhook](webhooks) as `order.updated`, so your store can follow along.
Statuses: `new`, `awaiting_confirmation`, `confirmed`, `change_requested`, `cancel_requested`, `cancelled`, `payment_pending`, `paid`, `payment_failed`, `preparing`, `awaiting_shipment`, `shipped`, `delivery_failed`, `delivered`, `return_requested`, `returning`, `returned`, `shipping_returned`.
## Abandoned carts
Send a cart a shopper left without ordering, and the platform can remind them on WhatsApp with a template you approved (switch it on in **Abandoned carts**; nothing is sent until you do).
```http
POST https://app.easytawasul.com/api/v1/carts
```
```json
{ "phone": "+201000000000", "cart_id": "C-77", "customer_name": "Mona", "items": "2 x Shirt", "total": 840, "currency": "EGP", "checkout_url": "https://shop.example/checkout/77" }
```
| Field | Required | Notes |
|---|---|---|
| `phone` | yes | Shopper phone with country code |
| `cart_id` | no | Your cart id, up to 60 characters. Sending the same one again updates the cart while it is still open. |
| `customer_name`, `items`, `total`, `currency` | no | Same rules as an order |
| `checkout_url` | no | Where the shopper finishes the order. **https only.** |
Response `201` (or `200` when the same `cart_id` is updated): `{ "id": "cart_5", "cart_id": "C-77", "status": "open", "reminders_sent": 0 }`. Template variables, in order: name, items, total, checkout link. The first reminder goes out after the delay set for the platform (default 60 minutes), at most twice, never to a customer who replied STOP or is on your blacklist. When the same number orders within 7 days the cart is marked recovered.