Skip to main content
POST

Authorizations

Authorization
string
header
required

The user's connection access_token (user authentication), or an org-minted buy_token for org-owned accounts.

Body

application/json
ask
string
required

What the user wants, in plain language. Required unless the call is a confirm.

Minimum string length: 1
Pattern: \S
conversation_id
string

The thread to continue. A confirm always requires it.

Minimum string length: 1
confirm

A 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.

Pattern: ^[0-9a-f]{16}$
payment_source
enum<string>

Pay the confirmed cart(s) with the user's own vaulted card, whatever the user's wording: the confirm pauses with decline_code vault_approval_required and an approval_url, the user approves on their device, and the same confirm places the order. Confirm-only. Omit it and the loop keeps its default source.

Available options:
vault
delivery_address
object

The delivery address for this conversation, when your app manages the user's addresses. The agent ships to exactly these values, never asks the user to confirm or correct them, and does not read or update the wallet's saved default address for the conversation. Send it on any turn (the first is fine); it holds for the whole conversation, and a later turn's value replaces it. A malformed address is refused with 400 invalid_delivery_address before any turn runs.

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.

conversation_id
string
required

Thread it back on every follow-up. Returned on the first call too.

status
enum<string>
required

needs_input is progress, not failure: the reply is a question or a cart waiting on confirmation.

Available options:
needs_input,
order_placed,
partially_placed,
declined
reply
string
required

The assistant's turn as prose, ready to show a human.

messages
string[]
required

The same turn split into ordered bubbles for chat surfaces.

message_id
string
required
cart
object | null
required

The most recently shown cart. Null when no cart is on the table.

carts
object[]
required

Every open cart in the conversation, oldest first. A conversation can hold carts at several merchants.

placements
object[] | null
required

Per-cart outcomes of a multi-cart confirm; null on every other call. Partial success is representable here.

catalog
object | null
required

The last product search as data, with a freshness stamp. Null when nothing fresh was searched.

error_code
string | null
required

Machine-readable failure code when something went wrong.

order_id
string | null
required

Set when this call placed an order: the merchant's order id, or Agentcard's when the merchant returns none. The same key as order.orderId in GET /cards/transactions/by-payment-method and order_id on order.placed. Null on a multi-cart confirm (see placements).

payment_source
object | null
required

What paid, or what would have paid. brand and last4 are the user's own card for added_card, vault and stored_payment_method; null for balance and company_balance, where no card of theirs is in the flow. Null when no checkout ran or it refused before resolving the source.

decline_code
string | null
required

The machine code behind a declined: a gate reason (byoc_approval_required, vault_approval_required, sandbox_mode, per_txn_max_exceeded, card_limit_reached, ...) or a merchant code (items_unavailable, pos_cart_validation). in_progress means another attempt holds this checkout (Agentcard places a vault order itself when the approval lands): wait and read GET /buy/conversations/{id} instead of confirming again. Null on success and on recoverable errors.

approval_url
string | null
required

The link to send the user when the attempt paused for their bank's or Vault's approval. Send the same confirm again once they approve.

charge_status
enum<string> | null
required

Whether money moved on this call's checkout: none (nothing charged, nothing pending: every decline, approval pause and refusal answered before money moved), confirming (placed, charge still confirming), settled, or unknown (the attempt may have moved money and Agentcard cannot yet say; do not retry, read the conversation's orders, then support). Null when no checkout ran.

Available options:
none,
confirming,
settled,
unknown,
null
merchant_total_cents
integer | null
required

For a cart the merchant priced outside US dollars: the merchant's own total in that currency's smallest unit, the same figure order.placed and order.failed carry. Null for a US dollar cart and when no checkout ran.

merchant_currency
string | null
required

The merchant's currency as a lower-case ISO code (cad) when the cart was priced outside US dollars. Null for a US dollar cart and when no checkout ran.

unmatched
object[]
required

Asks that did not make it into a cart, cumulative for the conversation, with machine-derived reasons and the moment each happened. An entry leaves only when the same line later lands in a cart; placing an order does not clear it. Never inferred from the reply. Always an array.