create_cart_link
Build a link that puts the given products into the customer's cart.
This tool writes nothing. It returns a URL; the products are added only when the customer opens that URL in their own browser. Give the URL to the customer and let them click it.
Args: items: 1-20 rows of {"product_id": int >= 1, "quantity": int 1-50}. Unknown fields are rejected. Repeated product_ids are merged into one row and their quantities summed. checkout: If True, opening the link takes the customer straight to checkout; if False (default) it opens the cart review page.
Returns: JSON with cart_url, the normalised items, item_count, total_quantity, the echoed checkout flag and a short note to show the customer.
Errors (isError=true, body {"error": {...}}): - products_not_found: one or more product_ids do not exist or are not published. The message lists the offending ids. - shop_api_unavailable: the shop could not be reached; retryable.
Notes: - The link SETS the quantities, it does not add to what is already in the cart. Opening the same link twice gives the same result as opening it once, so the customer can safely click it again. - Stock is re-checked when the link is opened. If stock ran out in the meantime, the quantity is reduced or the row skipped — the link can never oversell. - Checkout requires a customer account, so the customer may be asked to log in or register before paying.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | 1-20 products to put in the cart | |
| checkout | No | If True, the link goes straight to checkout; otherwise (default) to the cart review page |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | Yes | ||
| items | Yes | ||
| cart_url | Yes | Open in a browser to fill the cart | |
| checkout | No | True if the link goes straight to checkout, False to cart review | |
| item_count | Yes | Number of distinct products | |
| total_quantity | Yes | Sum of quantities |