Buy
One conversational endpoint that places real orders. Send the user’s request as plain text in ask; thread follow-ups with conversation_id; place a shown cart by echoing its hash in confirm (or an array of hashes for several carts). Money only moves on a confirm, and only for exactly the cart the hash describes.
Authorizations
The user's connection access_token (user authentication), or an org-minted buy_token for org-owned accounts.
Body
- Option 1
- Option 2
What the user wants, in plain language. Required unless the call is a confirm.
1\SThe thread to continue. A confirm always requires it.
1A cart hash from a previous response (16 hex characters), or an array of hashes to place several carts. An array confirm cannot carry an ask in the same call.
^[0-9a-f]{16}$Response
One turn of the purchase conversation, in the fixed envelope.
The fixed response envelope. Every field is present on every response, null when empty.
Thread it back on every follow-up. Returned on the first call too.
needs_input is progress, not failure: the reply is a question or a cart waiting on confirmation.
needs_input, order_placed, partially_placed, declined The assistant's turn as prose, ready to show a human.
The same turn split into ordered bubbles for chat surfaces.
The most recently shown cart. Null when no cart is on the table.
Every open cart in the conversation, oldest first. A conversation can hold carts at several merchants.
Per-cart outcomes of a multi-cart confirm; null on every other call. Partial success is representable here.
The last product search as data, with a freshness stamp. Null when nothing fresh was searched.
Machine-readable failure code when something went wrong.

