Place an order for a customer
https://api.app2email.com/v1/{number}/shop/orders Scope: orders:manage. Not with a sandbox key. For a system or an agent that takes the order itself. The cart is priced from the shop's data as it is now, stock is taken in the same step, and the order appears in the dashboard and the counter app like any other (source api). You vouch for contact: the order counts as that customer's own, and they get the shop's order messages on WhatsApp (confirmation with the pickup QR code, ready, and so on) where those are switched on. pay later = at pickup or on delivery; pay online answers checkout_url: send it to the customer, the order is confirmed (and order.created sent) when it is paid. Send expected_total with the total the customer agreed to: a different total answers 409 shop_changed with the new quote in error.details.quote. 409 shop_order_problems lists what is in the way the same way. The Idempotency-Key header (or client_key) makes a retry safe: the same key answers the same order with repeated true and status 200.
Path
-
Your app2email WhatsApp number - the number the message is sent FROM. Full number with country code, digits only.
e.g.4976659348270
Headers
-
A unique value for this message or list (eg a UUID). The same request with the same key within 24 hours gets the first answer again, and nothing is sent twice. Ignored by dry runs.
e.g.order-1234-shipped
Body application/json required
-
5 item fields
- variant_id integer | null
Needed for an item with variants.
- option_ids integer[]
Choices from the item's option groups.
-
pickupdelivery -
Needed for delivery: line1 and at least one of suburb, city or postcode.
10 fields
- line1 string
Street and number.
- line2 string
- suburb string
- city string
- region string
- postcode string
- country string
- notes string
For the driver.
- lat number
Where the customer is (latitude), with lng. Only the delivery options that charge by distance read it; without it they answer code
location. - lng number
Longitude, with lat.
- delivery_method string
When the shop has several delivery options: the id of one (GET /shop/settings, config.delivery.methods).
- discount_code string
-
A tip as an amount; wins over tip_percent.
-
The customer's WhatsApp number with the country code, digits only.
- email string
- slot string
With asap false: the start of a time the quote offered, YYYY-MM-DDTHH:mm in the shop's time.
e.g.2026-11-14T18:30 - note string
- allergy_note string
-
lateronline - method string
With pay online: stripe or paypal; empty = the first connected.
- expected_total integer
The total the customer agreed to: a different total answers 409 shop_changed with the new quote.
-
Your own unique key of this order (the Idempotency-Key header does the same): the same key again answers the same order.
Responses
Fields
- e.g.
true -
An order as the staff see it. Money in minor units.
52 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 object[]
- 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
- events object[]
GET only: the history, newest last: what happened, who did it, on which device.
- notice string
After an action: something to read, eg a refund that did not go through.
- repeated boolean
POST /shop/orders: true = this key was used before and this is that order.
- checkout_url string
POST /shop/orders with pay online: where the customer pays.
- payment_id integer | null
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.
- 409 Idempotency-Key: the first request with this key is still running, or did not finish. Or a conflict: the template name exists, the webhook URL is used by another webhook, the broadcast cannot be cancelled, the booking slot is taken or the booking is already cancelled, or the Flow is not published.
- 415 The body is not JSON.
- 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.
- 502 WhatsApp (Meta) returned an error or could not be reached.
- 503 app2email's connection to the WhatsApp account needs attention, or the request log is not available right now.