Orders
Orders
GET/api/orders
List the team's orders
Required scope: orders.read
| Parameter | In | Required |
|---|---|---|
page | query | no |
limit | query | no |
aiAgentId | query | no |
status | query | no |
source | query | no |
sort | query | no |
search | query | no |
dateFrom | query | no |
dateTo | query | no |
bash
curl "https://api.zapyflow.com.br/api/orders" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY"Responses
200— OK400— Malformed request
POST/api/orders
Create an order by hand
Required scope: orders.write
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
aiAgentId | string | yes | min 1 |
clientName | string | yes | min 1, max 100 |
clientPhone | string | yes | min 8, max 24 |
clientEmail | string | no | max 160 |
items | object[] | yes | ≥ 1 items, ≤ 50 items |
total | number | yes | ≥ 0, ≤ 9999999 |
paymentMethod | "PIX" | "CREDIT_CARD" | "DEBIT_CARD" | "CASH" | "BOLETO" | no | — |
paymentStatus | "PENDING" | "PAID" | no | — |
address | string | no | max 200 |
deliveryFee | number | no | ≥ 0, ≤ 9999999 |
notes | string | no | max 500 |
bash
curl -X POST "https://api.zapyflow.com.br/api/orders" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{ ... }'Responses
200— OK201— Created400— Malformed request
GET/api/orders/{id}
One order in detail
Required scope: orders.read
| Parameter | In | Required |
|---|---|---|
id | path | yes |
bash
curl "https://api.zapyflow.com.br/api/orders/{id}" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY"Responses
200— OK404— Not found — also returned when the resource belongs to another workspace
PATCH/api/orders/{id}
Update an order
Required scope: orders.write
| Parameter | In | Required |
|---|---|---|
id | path | yes |
Request body
| Field | Type | Required | Constraints |
|---|---|---|---|
status | "AWAITING_PAYMENT" | "PREPARING" | "READY_FOR_PICKUP" | "OUT_FOR_DELIVERY" | "COMPLETED" | "CANCELLED" | no | — |
clientName | string | no | min 1, max 100 |
items | object[] | no | ≥ 1 items, ≤ 50 items |
total | number | no | ≥ 0, ≤ 9999999 |
paymentMethod | "PIX" | "CREDIT_CARD" | "DEBIT_CARD" | "CASH" | "BOLETO" | no | — |
paymentStatus | "PENDING" | "PAID" | no | — |
address | string | no | max 200 |
deliveryFee | number | no | ≥ 0, ≤ 9999999 |
notes | string | no | max 500 |
notifyClient | boolean | no | — |
bash
curl -X PATCH "https://api.zapyflow.com.br/api/orders/{id}" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY" \
-H "Content-Type: application/json" \
-d '{ ... }'Responses
200— OK400— Malformed request404— Not found — also returned when the resource belongs to another workspace409— Conflict with the current state
DELETE/api/orders/{id}
Delete an order
Required scope: orders.write
| Parameter | In | Required |
|---|---|---|
id | path | yes |
bash
curl -X DELETE "https://api.zapyflow.com.br/api/orders/{id}" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY"Responses
200— OK403— Forbidden, or the key lacks this scope404— Not found — also returned when the resource belongs to another workspace
GET/api/orders/overview
Order summary for the period (counts, revenue and average ticket)
Required scope: orders.read
| Parameter | In | Required |
|---|---|---|
aiAgentId | query | no |
status | query | no |
search | query | no |
dateFrom | query | no |
dateTo | query | no |
bash
curl "https://api.zapyflow.com.br/api/orders/overview" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY"Responses
200— OK400— Malformed request
GET/api/orders/stats
Order counts by status
Required scope: analytics.read
bash
curl "https://api.zapyflow.com.br/api/orders/stats" \
-H "Authorization: Bearer $ZAPYFLOW_API_KEY"Responses
200— OK