buy_with_saved_card
Shop and pay with the holder's saved card
Buys from online merchants (Amazon, Walmart, Target, Best Buy, DoorDash and more) and pays with the card the account holder saved themselves (see GET /get-saved-cards). One conversation per purchase:
Send what to buy as
ask, in plain language. Passdelivery_addresson this first call when you know it.Relay
replyto the holder and send their answers back asaskwith the sameconversation_id, until acartcomes back.Show the holder the cart. Once they agree, send its
hashasconfirmwith theconversation_id. Nothing can be charged before this.The confirm answers
awaiting_approvalwith anapproval_url. Send it to your human; never open it yourself. They approve on their own device with their passkey. Then send the same confirm again to getorder_placed.
A turn runs against a live merchant and can take up to two minutes. This call waits about 45 seconds: a turn that finishes in time comes back complete (state: done); a slower one comes back as state: running with a turn_id to poll with GET /get-purchase-turn.
This route is free. The holder's own card pays the merchant, and no identity verification is needed.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "buy_with_saved_card"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ask | No | What the holder wants, in plain language. Required unless confirming. | |
| confirm | No | A cart's `hash` from an earlier turn, to place exactly that cart. | |
| conversation_id | No | The conversation to continue. Required with `confirm`. | |
| delivery_address | No | Where to ship. Send it on the call that asks for the cart (a cart is bound to the address it was shown for) and on the confirm. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cart | No | The most recently shown cart. | |
| note | No | The next step. | |
| carts | No | Every open cart in the conversation, oldest first. | |
| error | No | Present when `state` is `failed`. | |
| reply | No | The shopping assistant's turn as prose, ready to show the holder. | |
| state | No | `running` means the turn is still talking to the merchant; the fields below appear once it is `done`. One of: running, done, failed. | |
| status | No | What to do next. `needs_input`: a question or a cart waiting on a confirm. `awaiting_approval`: send `approval_url` to the holder, then repeat the same confirm. `in_progress`: the order is already being placed; read `GET /get-purchase-conversation` instead of confirming again. `order_placed`. `declined`: see `decline_code`. `conflict`: nothing ran, see `error_code` and confirm the fresh cart's hash. Never branch on `reply`. One of: needs_input, awaiting_approval, in_progress, order_placed, declined, conflict. | |
| catalog | No | The last product search. Empty on a turn that did not search again, so keep the previous one. | |
| turn_id | No | This turn's id. Poll `GET /get-purchase-turn` with it while `state` is `running`. | |
| order_id | No | Set when this turn placed an order. | |
| unmatched | No | Things asked for that did not make it into a cart, with a reason. Show these rather than guessing from `reply`. | |
| card_last4 | No | The saved card that paid, for naming it to the holder. | |
| created_at | No | Milliseconds since the epoch. | |
| error_code | No | On `conflict`: `cart_changed`, `turn_in_progress`, `delivery_address_changed`, or `delivery_address_bound_after_cart`. | |
| approval_url | No | Send to the holder when `status` is `awaiting_approval`. Never open it yourself. | |
| decline_code | No | The machine reason behind `declined`, e.g. `items_unavailable`. | |
| charge_status | No | Whether money moved: `none`, `confirming`, `settled`, or `unknown` (do not retry; read the conversation). One of: none, confirming, settled, unknown, . | |
| conversation_id | No | Send it back on every follow-up and on the confirm. |