> ## 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

# DoorDash

> Build a DoorDash cookie map, connect the account, and refresh its session.

DoorDash connects from a session your integration already holds. Creation, status checks, refresh, and disconnect follow the [Quickstart](https://docs.agentcard.com/commerce-sdk/connections/quickstart.md). Build the DoorDash session you send with the cookie map below.

> [!NOTE]
>
> DoorDash session imports are available to every production app in an active organization. Agentcard never receives or stores the user's DoorDash password.

## Build the session object

For DoorDash, `session` is a JSON map of the cookies that make up the user's signed-in DoorDash session, as cookie name to value. Send every cookie the signed-in session holds. Agentcard requires all three cookies below before checking the session with DoorDash:

| Cookie | What it is |
| - | - |
| `dd_cx_logged_in` | `"true"` on a signed-in session. |
| `ajs_user_id` | The user's DoorDash consumer id. Agentcard reads it as the account reference. |
| `csrf_token` | Required for cart and checkout calls. Agentcard refuses a session without it. |

Agentcard refuses a session missing any of the three cookies. A `POST /buy/v2/connections` request with an incomplete session returns HTTP `400`:

```text title="Response · invalid session" theme={null}
{"error":"session_invalid","retryable":false}
```

Retry the create request below with all cookies from the same signed-in session. Live verification checks authenticated access; it does not independently confirm the account identifier in `ajs_user_id`.

## Create a DoorDash connection

```bash title="Request · create a DoorDash connection" theme={null}
curl -X POST https://api.agentcard.sh/buy/v2/connections \
  -H "Authorization: Bearer $ORG_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "user_id":  "usr_7g8h9i",
    "merchant": "doordash",
    "session": {
      "dd_cx_logged_in": "true",
      "ajs_user_id":     "\"3e9c…\"",
      "csrf_token":      "…",
      "cf_clearance":    "…"
    }
  }'
```

```json title="Response · 200 linked" theme={null}
{
  "object": "connection",
  "connection_id": "cxn_2b4d6f",
  "merchant": "doordash",
  "status": "linked",
  "last_verified_at": "2026-11-05T00:12:00Z"
}
```

Agentcard stores the session for your user and app immediately after DoorDash accepts it. The user does not open a consent page or enter a verification code for this company-supplied session. Your app can now use the stored connection to shop. See the [Quickstart](https://docs.agentcard.com/commerce-sdk/connections/quickstart.md) for status checks, refresh, and disconnect.

## Protect and refresh cookies

You supply the session from the authorized integration your company runs against DoorDash. Agentcard validates the session against DoorDash before storing it and encrypts it at rest under a key separate from card data. Agentcard never writes the session to logs or returns it through the API. Agentcard records an expiry of two weeks for an imported session, but DoorDash can revoke it earlier. Post a fresher session to the same endpoint to refresh it in place.


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