Skip to main content
The Purchase API is a turn-based loop on one endpoint. You send what the user wants as plain text in ask, follow up with the same conversation_id, and place a shown cart by echoing its hash in confirm. Money moves only on a confirm, and only for exactly the cart the hash describes. The bearer is a user token: the connection access_token or a cardholder buy_token. A platform token is rejected, because a purchase always runs as one user. Use a client timeout of at least 120 seconds.

The purchase response object

Every 200 from POST /buy carries the same envelope. Each field is always present and null when empty.

The cart object

The catalog object

Show your own product list from catalog instead of reading the results out of reply. catalog holds the last product search in the conversation, on the turn that searched and on the turns after it. Fifteen minutes after that search, catalog is null, because prices and item ids can change by then. Send a new ask to search again. Match a retail cart line to its search result: the line’s product_id and the item’s id are the same product page URL. Other merchants use their own item id. Check for priceCents before you show a price. An item leaves out a field it does not have instead of sending null, unlike the fields of the purchase response object. A restaurant reservation time slot never has a price. A retail search drops any product listed without a price, because a cart cannot hold it. An item without a picture has no image_url.
Show image_url where your app can render an image (a chat bubble, a card) and send id when the user wants the page. Both come from the merchant; never build either from the name.

Endpoints

Webhooks: order.placed, order.failed, order.confirmed. The guide is Agentcard’s Purchase API.