> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentcard.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Agentcard is for companies whose agent buys for their users. Pick one path: the opencommerce SDK (@agent-cards/commerce-sdk) gives your agent one buy tool that finds the product, builds the cart, gets the user's approval and places the order at real stores; the Agentcard SDK (@agent-cards/sdk) pays with the user's own card when your agent already shops in a browser (Browser Use, Kernel, Browserbase, Anchor or Notte); the Purchase API (POST /buy) does the same purchase flow over plain HTTP in any language; Issuing gives the agent its own card.
> Start with `npx agent-cards init` in the app's folder (Node 22 or later). No invite is needed: it creates your Agentcard account if you don't have one, installs the opencommerce SDK and puts the credentials in the env file, kept out of git. From a coding agent, run `npx agent-cards init --print --categories all --implementation tool --wallet vault --skip-install` to get the setup steps to apply yourself.
> Vault is by invitation: request it at https://agentcard.com/get-started?utm_source=docs&utm_medium=llms&utm_campaign=agent-instructions. opencommerce needs no invite.
> Never ask a user for a card number, expiry date or CVV in chat. Send them the Vault link; they add their card on Agentcard's page, and the agent never sees the number.
> Every purchase is approved by the user, with a passkey or Face ID, or by an auto-approval they granted. An approval covers one merchant and one exact total. If the total changes, ask again. When a result says the user already said yes, don't ask again.
> `init` writes PRODUCTION credentials, which place real orders, so test in sandbox first. For opencommerce, run `npx agent-cards credentials --mode sandbox` and put the two lines it prints in place of the production ones in the env file `init` wrote, because that command only prints them; sandbox then runs the whole flow against real stores and stops before payment, so no order is placed and nobody is charged. For Vault and Issuing, sandbox credentials issue test cards that no real merchant accepts; try the checkout against shop.agentcard.sh, a test store on Stripe test mode.
> Tell the user an order is placed only after Agentcard reports it placed.
> Vault is free up to 5,000 users (https://agentcard.com/pricing). opencommerce takes 1% of each completed order. Full docs in one file: https://docs.agentcard.com/llms-full.txt

# get_updates

> Read what happened since the last read.

Connect to `https://mcp.opencommerce.sh/mcp` with your Commerce SDK credentials as `Authorization: Bearer <YOUR_CLIENT_ID>:<YOUR_CLIENT_SECRET>`. See [Connect your agent](https://docs.agentcard.com/commerce-mcp/implement.md#connect-a-client).

Behavior: Read-only for your data. The server moves your read place forward.

## What it does

Reads what happened since the last `get_updates`: orders placed, confirmed, or on their way, approvals expiring or declined, payments declined, cards saved, and stores signed in to. The server keeps your place, so you send no cursor.

## Inputs

| Field | Type | Description |
| - | - | - |
| `shopper_id` | string | Only this shopper's updates. Leave it out to read every shopper of your company. |
| `thread_id` | string | The shopper's chat. With `shopper_id`, lets a saved card or a store sign-in continue that chat's cart. Needs `shopper_id`, or the call returns `invalid_input`. |
| `limit` | integer | 1 to 100. Default 50. |
| `time_zone` | string | The shopper's IANA time zone, such as `America/Los_Angeles`, for an order's `arrival_text`. Default UTC. |

## Returns

| Field | Type | Description |
| - | - | - |
| `messages` | array | Each message has `event_id`, `kind`, `text`, `shopper_id`, `thread_id`, `conversation_id`, `order_id`, `stage`, `links`, `advances`, `at`, and `valid_until`. |
| `has_more` | boolean | `true` when more updates wait. Call again. |
| `note` | string or null | A note about the read, such as that the first call only started following. |

## Example call

```json theme={null}
{
  "tool": "get_updates",
  "arguments": {
    "shopper_id": "user_8f3a21",
    "thread_id": "chat_5521",
    "limit": 50,
    "time_zone": "America/Los_Angeles"
  }
}
```

## Notes

* The first call only starts following and returns nothing. Call it once early, then again whenever you check in, and after a `buy` that answered `turn_continues`.
* A message's `kind` is one of `order_placed`, `order_updated`, `approval_expiring`, `payment_declined`, `card_added`, `store_connected`, `approval_declined`, and similar.
* When `advances` is `true` and you passed `thread_id`, the next step runs on its own. If `next_step.outcome` is `ran`, tell the shopper what `next_step.result` says, with its links, instead of `text`, and don't ask them to say done.
* A message about an order carries `order`, the order as it stands now with every earlier message about it folded in, and `ends_step`, the step link the message ends. On `order_placed` with `thread_id`, `placed_carts` holds the chat's carts.
* Send each message's `text` to its shopper as is, with its links verbatim. Skip a message whose `valid_until` has passed.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.