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. APOST /buy/v2/connections request with an incomplete session returns HTTP 400:
Response · invalid session
Request · create a connection
Response · 200 linked
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
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 anotherPOST /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.