---
name: purchase_product
description: End-to-end product purchase — search, configure, add to cart, checkout
tools_required:
  - search_products
  - configure_product
  - add_to_cart
  - checkout_flow
annotations:
  requires_user_presence: true
  estimated_steps: 4
  estimated_time: "2-5 minutes"
---

# Purchase Product

End-to-end workflow for buying a product on CloudCart. This skill
chains four tools spanning REST and WebMCP execution contexts.

## Prerequisites

- OAuth 2.0 authorization for scope `cart:write`.
- User is present; destructive tools require explicit confirmation.

## Steps

1. **`search_products`** (REST) — find candidate SKUs for the
   user's query.
2. **`configure_product`** (WebMCP) — open the product page and
   yield to the browser configurator to capture the variant SKU.
3. **`add_to_cart`** (REST, OAuth) — POST the configured SKU and
   quantity to the cart.
4. **`checkout_flow`** (WebMCP) — navigate to `/checkout` and
   hand off to the user for final confirmation. **Do not
   auto-submit.**

## Error handling

| Failure | Response |
|---------|----------|
| Empty search results | Ask the user to refine the query |
| OAuth 401 | Refresh token once, then escalate |
| Checkout cancelled | Preserve the cart; report to the user |

## Success criteria

Returns the order confirmation ID from the checkout step.
