The orders, newest first
https://api.app2email.com/v1/{number}/shop/orders Scope: orders:manage. group narrows the list: open (accepted, being prepared, ready, on the way, and new ones), new (waiting for the shop to accept), waiting (not paid or not confirmed yet), done, cancelled. q finds a reference, a name or a number. Lists leave out the lines: items_text says what was ordered in one line, GET /shop/orders/{id} has the rest. Page with before set to next_before. To follow orders without polling use the order.* webhook events.
Path
-
Your app2email WhatsApp number - the number the message is sent FROM. Full number with country code, digits only.
e.g.4976659348270
Query
- group string
open, new, waiting, done or cancelled. Left out: all.
opennewwaitingdonecancelled - q string
A reference, a customer's name or number.
e.g.SO-K7M2QX - before integer
For the next page: next_before of the previous answer.
-
How many (1 to 100, default 50).
Responses
Fields
- e.g.
true - orders object[]
52 item fields
- id integer
- reference stringe.g.
SO-K7M2QX - status string
pending_payment = waits for its online payment; unconfirmed = a visitor of the order page has not confirmed on WhatsApp yet; new = waits for the shop to accept it.
pending_paymentunconfirmednewacceptedpreparingreadyout_for_deliverycompletedcancelledrejectedexpired - status_text string
- source string
webchatflowcounterapi - fulfilment string
pickupdelivery - asap boolean
- due_at string (date-time) | null
- due_label string
- slot_label string
- customer_name string
- customer_phone string
- customer_email string
- contact_identity string
The customer's WhatsApp number (digits) or business-scoped user id.
- contact_verified boolean
-
The delivery address; {} for a pickup.
- delivery_method string
- delivery_zone string
- note string
- allergy_note string
- items_count integer
- items_text stringe.g.
2 x Margherita, 1 x Cola - currency string
- subtotal integer
Whole minor units (cents): 1250 = 12.50.
- discount integer
Whole minor units (cents): 1250 = 12.50.
- discount_code string
- delivery_fee integer
Whole minor units (cents): 1250 = 12.50.
- fees integer
Whole minor units (cents): 1250 = 12.50.
- tip integer
Whole minor units (cents): 1250 = 12.50.
- tax integer
Whole minor units (cents): 1250 = 12.50.
- total integer
Whole minor units (cents): 1250 = 12.50.
- total_label stringe.g.
$30.50 - refunded integer
Whole minor units (cents): 1250 = 12.50.
- refundable integer
Whole minor units (cents): 1250 = 12.50.
- payment_state string
not_neededon_pickupon_deliverypendingauthorisedpaidpart_refundedrefundedreleasedfailed - payment_method string
- payment_id integer | null
- pickup_code string
The 4 characters the customer can say at the counter.
- order_url string
The customer's page of this order.
- actions string[]
What POST /shop/orders/{id}/action accepts for this order now.
- can_refund boolean
- late boolean
- created_at string (date-time)
- accepted_at string (date-time) | null
- ready_at string (date-time) | null
- completed_at string (date-time) | null
- cancelled_at string (date-time) | null
- cancelled_by string
- cancel_reason string
- handed_by string
- handed_method string
- lines object[]
Left out in lists.
13 item fields
- id integer
- item_id integer
- variant_id integer | null
- sku string
- name string
- variant_label string
- options array
- qty integer
- unit_price integer
Whole minor units (cents): 1250 = 12.50.
- unit_price_label string
- line_total integer
Whole minor units (cents): 1250 = 12.50.
- line_total_label string
- note string
- more boolean
- next_before integer | null
Send as before for the next page.
Errors
- 400 The request is malformed (missing or invalid fields, query parameters or times).
- 401 Missing, invalid, revoked or expired API key.
- 403 The key is valid but this call is not allowed: the key lacks the scope the call needs (insufficient_scope), the address is not allowed for the key (ip_not_allowed), the number or plan does not allow it, a recipient opted out or is not opted in, or a problem with the WhatsApp account.
- 404 The number, template, message, broadcast, webhook, delivery, opt-in, logged request, booking or Flow was not found.
- 429 A monthly plan limit, the number's own monthly cap, the key's daily cap, a WhatsApp rate limit, the API rate limit (rate_limited), or the webhook test limit (too_many_tests) was reached. Retry-After and error.retry_after_seconds say how long to wait.
- 500 Unexpected error on app2email's side.
- 503 app2email's connection to the WhatsApp account needs attention, or the request log is not available right now.