Checkout MCP
The Checkout MCP server enables AI agents to create and manage checkout sessions, allowing buyers to complete purchases through a trusted UI after product discovery.
Anchor to How it worksHow it works
The Checkout MCP server lets your AI agent facilitate purchases on behalf of buyers:
- Create checkout sessions with line items, buyer information, and fulfillment details.
- Retrieve and update checkout state as buyers make selections.
- Complete orders through a trusted UI handoff for payment collection.
- Cancel sessions that are no longer needed.
For usage guidelines, see About Checkout. For the full UCP specification, see Checkout capability and MCP binding.
Anchor to AuthenticateAuthenticate
Obtain your client credentials (client ID and secret) from the Catalog section of Dev Dashboard.
Then use those credentials to retrieve a token for subsequent requests.
All requests require the Authorization: Bearer {token} header.
https://api.shopify.com/auth/access_token
The response contains:
access_token: A JWT access token that can be used to interact with the MCP server.scope: The list of access scopes that were granted to your API key.expires_in: The number of seconds until the access token expires.
JWT tokens created from Dev Dashboard credentials have a 60-minute TTL. You can use a JWT decoder tool like jwt.io to investigate more details related to how Shopify issues this token.
{} Response
Learn more about building agentic commerce experiences.
https://{shop-domain}/api/ucp/mcp
Anchor to Available toolsAvailable tools
Checkout MCP provides tools for managing the checkout lifecycle:
create_checkout: Create a new checkout session with line items and buyer information.get_checkout: Retrieve the current state of a checkout session.update_checkout: Update a checkout session with new information.complete_checkout: Submit payment and place the order.cancel_checkout: Cancel an active checkout session.
Anchor to [object Object]create_checkout
create_checkoutCreate a new checkout session with line items, buyer information, and fulfillment preferences.
Use this tool when a buyer is ready to purchase items and you need to initiate the checkout process. The response includes a continue_url for handing off to a trusted UI.
When to use:
- Buyer says "I want to buy this item"
- Agent has collected enough information to start checkout
- Buyer confirms their cart and wants to proceed
Anchor to ParametersParameters
Metadata object containing ucp.profile, the URI to your agent's UCP profile for version compatibility.
The checkout object containing all checkout data. Includes the following fields:
currency(required): ISO 4217 currency code (for example,USD,EUR,GBP).line_items(required): Array of items to purchase. Each item must includequantityand anitemobject with the product variantid.buyer: Buyer information includingemailfor order confirmation.fulfillment: Fulfillment preferences including shippingmethodsanddestinations.payment: Payment configuration including availableinstrumentsandselected_instrument_id.
https://{shop-domain}/api/ucp/mcp
{} Response
Anchor to [object Object]get_checkout
get_checkoutRetrieve the current state of an existing checkout session.
Use this tool to check the status of a checkout, see updated totals after changes, or verify what information is still needed before completion.
When to use:
- Need to refresh checkout state after buyer returns
- Want to show current totals and line items
- Checking if checkout is ready for payment
Anchor to ParametersParameters
Metadata object containing ucp.profile, the URI to your agent's UCP profile for version compatibility.
The ID of the checkout session to retrieve.
https://{shop-domain}/api/ucp/mcp
{} Response
Anchor to [object Object]update_checkout
update_checkoutUpdate an existing checkout session with new information.
Use this tool to modify line items, update shipping address, change fulfillment method, or add buyer information before completing the checkout.
When to use:
- Buyer wants to change quantity or remove items
- Buyer provides or updates shipping address
- Need to update buyer email or contact info
- Changing fulfillment method (shipping vs pickup)
This tool requires the complete checkout state on every request.
update_checkout replaces the entire checkout with the data you provide, so if you omit fields like line_items or buyer previously included in a create_checkout call, they're removed from the checkout.
This tool requires the complete checkout state on every request.
update_checkout replaces the entire checkout with the data you provide, so if you omit fields like line_items or buyer previously included in a create_checkout call, they're removed from the checkout.
Anchor to ParametersParameters
Metadata object containing ucp.profile, the URI to your agent's UCP profile for version compatibility.
The ID of the checkout session to update.
The checkout object containing the complete updated checkout state. Includes the following fields:
line_items: Updated array of items. Replaces existing line items.buyer: Updated buyer information.fulfillment: Updated fulfillment preferences.payment: Updated payment configuration.
https://{shop-domain}/api/ucp/mcp
{} Response
Anchor to [object Object]complete_checkout
complete_checkoutSubmit payment and place the order.
Use this tool when the checkout is ready and the buyer has authorized payment. This finalizes the transaction and creates an order.
When to use:
- Checkout status is
ready_for_complete - Buyer has reviewed and confirmed the order
- Payment credential has been collected
Anchor to ParametersParameters
Metadata object containing ucp.profile, the URI to your agent's UCP profile for version compatibility.
The ID of the checkout session to complete.
A unique UUID for retry safety. Prevents duplicate order placement.
Payment instrument instance with credential data submitted by the buyer through the trusted UI.
https://{shop-domain}/api/ucp/mcp
{} Response
Anchor to [object Object]cancel_checkout
cancel_checkoutCancel an active checkout session.
Use this tool when a buyer abandons the checkout or explicitly requests cancellation. Canceled checkouts cannot be resumed.
When to use:
- Buyer explicitly cancels the order
- Session has been abandoned
- Need to start fresh with a new checkout
Anchor to ParametersParameters
Metadata object containing ucp.profile, the URI to your agent's UCP profile for version compatibility.
The ID of the checkout session to cancel.
A unique UUID for retry safety.
https://{shop-domain}/api/ucp/mcp
{} Response
Anchor to Checkout statusCheckout status
Checkout sessions transition through the following statuses:
| Status | Description |
|---|---|
incomplete | Checkout is missing required information. Agent should inspect messages and resolve via Update Checkout. |
requires_escalation | Checkout requires buyer input not available via API. Hand off to buyer via continue_url. |
ready_for_complete | All information collected. Agent can call Complete Checkout. |
complete_in_progress | Merchant is processing the Complete Checkout request. |
completed | Order placed successfully. |
canceled | Checkout session is invalid or expired. Start a new session if needed. |
The status field is included in the response of every tool call. You cannot call complete_checkout until the status reads ready_for_complete. Until then, use update_checkout to address incomplete statuses, or open an embedded checkout using continue_url for requires_escalation statuses.
Anchor to Error handlingError handling
Errors follow JSON-RPC 2.0 format with UCP-specific error codes in the data field:
Common error codes:
CHECKOUT_EXPIRED: The checkout session has expired.INVALID_SHIPPING_ADDRESS: The provided address cannot be shipped to.MERCHANDISE_NOT_AVAILABLE: One or more items are out of stock.PAYMENT_DECLINED: Payment was declined by the processor.
{} Error Response
Anchor to Best practicesBest practices
- Idempotency keys: Always provide unique UUIDs for
create_checkout,complete_checkout, andcancel_checkoutto prevent duplicate operations. - Status checks: Poll
get_checkoutto verify status before attempting completion. - Error recovery: Handle
MERCHANDISE_NOT_AVAILABLEby prompting the buyer to select alternatives. - Trusted UI handoff: Use
continue_urlto redirect buyers to a secure checkout UI for payment. - Session management: Cancel abandoned checkouts to free up inventory holds.
- Payment security: Never collect or transmit raw payment credentials through the agent.