One order with lines, payment, next steps and history
https://api.app2email.com/v1/{number}/shop/orders/{id} Scope: orders:manage. By id or by reference. lines with the chosen variant and options, the money, the pickup or delivery details, actions (what POST /shop/orders/{id}/action accepts now), can_refund with refundable, and events: who did what and when, on which device, including the hand-over at the counter.
Path
-
Your app2email WhatsApp number - the number the message is sent FROM. Full number with country code, digits only.
e.g.4976659348270 -
The order's id, or its reference (SO-K7M2QX).
e.g.SO-K7M2QX
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.
- 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.