Skip to main content
Your company sends a store session it already holds for a user. Agentcard verifies it against the store, stores it encrypted for that user and your app, and returns a linked connection. The user does not open a consent page or enter a code for this import. Send every call from your server with a production org token. Agentcard must enable store connections for your app, and the user must already have connected to your app through Agentcard. See the Issuing quickstart.

1. Create the connection

Send the user, store, and complete session your company holds. Each store’s page defines its session format; see DoorDash. Agentcard refuses a dead or incomplete session before storing it. A POST /buy/v2/connections request with an incomplete session returns HTTP 400:
Response · invalid session
Retry the create request below with the complete signed-in session from your integration.
Request · create a connection
Response · 200 linked
If this user already connected DoorDash through your app’s hosted connect flow, an import for the same account replaces those credentials. A different account reference returns account_mismatch; disconnect the existing store connection first. Agentcard now stores the session for this user, app, and store. Subsequent shopping calls through your app use it without resending the cookies. Agentcard never receives the store password through this endpoint, and neither the response nor the logs include the cookies.

2. Check the connection

Request · check the connection
The status request returns the connection object above. linked means its stored session is available and has not expired; the store can still revoke a session before its recorded expiry. Only the app that created the connection can read or remove it.

3. Refresh the session

Send another POST /buy/v2/connections with the same user and store and the complete replacement session. For the same store account, Agentcard verifies and replaces the stored session, keeps the connection ID, and returns 200 linked. A failed refresh leaves the existing session in place. To switch store accounts, disconnect first and create a new connection.
Request · refresh the session

4. Disconnect

Request · disconnect
DELETE returns 204 with no body, deletes the stored session, and clears the store connection and cached cart for this user and app. If store cleanup returns a retryable error, Agentcard has already removed the credentials; retry DELETE to finish cleanup before importing another session. A subsequent GET returns disconnected. The user can also remove store access from their Agentcard Vault.

Look up fields and errors