# World ID verified checkout for agents > Read product information, request World ID authorization, and prepare a Shopify checkout for the buyer. This does not place an order or authorize payment. MCP server: https://studios-shopify-gate-staging.vercel.app/mcp Transport: Streamable HTTP (POST). Connect using an MCP-capable client. Reading this guide does not connect a client automatically. Protected resource metadata: https://studios-shopify-gate-staging.vercel.app/.well-known/oauth-protected-resource/mcp OAuth authorization server metadata: https://studios-shopify-gate-staging.vercel.app/.well-known/oauth-authorization-server ## Product context Replace these placeholders with the buyer's store, product and ISO 3166-1 alpha-2 country code. ```json { "merchant": "YOUR_STORE.myshopify.com", "product_id": "PRODUCT_ID", "country": "COUNTRY_CODE" } ``` This guide does not assert that the product is available or supports agent checkout. The live MCP response is authoritative. ## Read before authorization Initialize MCP and call tools/list to discover current tool schemas. No sign-in is required to discover tools or call get_gated_product and find_offer. Call get_gated_product with: ```json { "merchant": "YOUR_STORE.myshopify.com", "product_id": "PRODUCT_ID", "country": "COUNTRY_CODE" } ``` Read its current variants, prices, credential requirements, quantity limit and policy_version. Use variant IDs returned by the server; do not invent them. Availability is not personal eligibility. If the product is unavailable or unsupported, explain that and use the storefront flow. ## Connect the buyer's World ID Use the advertised OAuth metadata and Authorization Code flow with PKCE S256. Set resource to https://studios-shopify-gate-staging.vercel.app/mcp. Automatic client enrollment is supported: use the advertised registration_endpoint with your client name and exact callback URI. Public clients use token_endpoint_auth_method "none". Request gates:read and gates:checkout. For a combined World ID discount, also request offers:claim. Let the buyer complete World ID verification and consent in their browser. Do not ask for their password, passkey, proof or access token in chat. Authorization is short-lived; reconnect when required. Shopify customer sign-in and customer linking are not required for this cart-based flow. Support depends on the merchant's product policy and your client's OAuth capabilities. ## Prepare and recover checkout 1. Confirm the chosen variants and quantities. Call check_gated_checkout with merchant, product_id, country and lines (variant_id and quantity). 2. If eligible, call prepare_gated_checkout with that same selection, expected_policy_version from the current response, and a new idempotency_key of 8–128 letters, digits, underscores or hyphens. Preserve this key for retries; do not reuse it for a different selection. 3. If pending, call get_gated_checkout with operation_id. When ready, give the buyer the returned checkout_url. Reuse the same active cart for a matching World ID, store and selection, including one started on the web. Shopify may refresh the URL's private key. 4. Use the returned URL as-is. A normal cart permalink, Add to cart, or a reconstructed cart does not carry this permission. Keep checkout links private unless the buyer chooses to share them; they are transferable. 5. To revoke an unpaid link, call cancel_gated_checkout with operation_id and wait for confirmed cancelled status. This does not cancel an order. Operations with order_created, paid, cancelled, or unavailable status must not be revived; start a new purchase only when the buyer requests it. If an existing order or missing cart is returned, direct the buyer to order_recovery_url or their confirmation email. Set new_purchase=true with a fresh idempotency key only after they explicitly choose another purchase. For replacement_pending, retry prepare_gated_checkout with the same input/key; do not switch to get_gated_checkout. Read repeat_purchases from the product. When false, the same World ID has one purchase allowance across agents and the website, independent of the paying Shopify account. Recover the active cart; its authorized selection cannot be replaced. An existing order blocks another checkout, including after cancellation or refund. Cancelling an authorized cart or losing it does not release the reservation automatically. Handle already_purchased as terminal. A checkout_reserved error includes operation_id: use get_gated_checkout with that reference under the same World ID, or share just the reference with the merchant for support. Do not share access tokens or checkout URLs with support. Neither new_purchase=true nor a fresh client or idempotency key overrides the limit. One purchase can contain multiple units; the product's max_per_order is a separate quantity limit. Handle authorization_required by reconnecting, terms_changed by fetching the current policy, and request_conflict by checking whether the idempotency key was reused with different input. Do not repeatedly mint new carts to work around an error. Preparing checkout never grants payment permission. The buyer reviews checkout and separately authorizes any order. If this agent cannot connect to MCP, the buyer can use Unlock access on the product page instead.