# Add to Xiaomi UK cart

Automatically add to Xiaomi UK cart on mi.com. Add one unit of a Xiaomi UK product to the cart of your browser and get the cart back, with prices in pounds.

- Site: mi.com
- Address: `reduck/mi.com/add_to_cart`
- Updated: 2026-12-01 (v1)
- Author: Reduck AI (reduck)

## About

Give it the variant's item id from Get Xiaomi UK product, when the product has more than one. It adds the product as the buy page's button does, and lines already in the cart stay. A sold-out variant or an unknown product fails with an error. Nothing is paid or ordered. No account is needed.

## Run it

Ask an AI agent connected to Reduck over MCP (`https://mcp.reduck.ai/mcp`) to run `reduck/mi.com/add_to_cart`, or run it from a terminal:

```bash
npx @reduck-ai/cli@latest run --script reduck/mi.com/add_to_cart
```

## Input

- `product` (string, required): The product's slug (e.g. redmi-buds-5-pro) or a mi.com/uk product link.
- `item_id` (string, optional): The variant's item_id from Get Xiaomi UK product. Needed when the product has several variants.

## Output

- `slug` (string, required)
- `count` (integer, required)
- `lines` (array, required)
- `item_id` (string, required)
- `line_id` (string, required)
- `quantity_in_cart` (integer, required)
- `total` (number | null, optional)
- `currency` (string, optional)
- `delivery` (number | null, optional)
- `subtotal` (number, optional)

## FAQ

### What does "Add to Xiaomi UK cart" do?

Add one unit of a Xiaomi UK (mi.com/uk) product to the shopping cart with the buy page's own Add to cart button, for the variant given by its item id (from Get Xiaomi UK product; not needed when the product has one variant), and return the cart afterwards: each line with its line id, item id, name, quantity, prices in pounds and a review_hash, plus the item count, subtotal, delivery and total. Works as a guest: lines already in the cart stay. Nothing is paid or ordered. A sold-out variant, an unknown product or item id fails with an error.

### How do I automatically add to Xiaomi UK cart on mi.com?

Ask an AI agent connected to Reduck to run reduck/mi.com/add_to_cart, or run it from a terminal with the Reduck CLI: npx @reduck-ai/cli@latest run --script reduck/mi.com/add_to_cart

### Is there a mi.com API to add to Xiaomi UK cart?

You do not need one. "Add to Xiaomi UK cart" drives the real mi.com pages in a browser, so it works whether or not mi.com offers an API for this.

### What information do I need to provide?

Required: product. Optional: item_id.

### What does it return?

It returns slug, count, lines, total, item_id, line_id, currency, delivery, subtotal, quantity_in_cart.

### Do I need to be logged in to mi.com?

No. It only uses pages of mi.com that are reachable without signing in.

### Does it change anything on mi.com, or only read data?

It makes changes on mi.com, like sending, posting, booking or buying something.

### How do I run it?

Ask an AI agent connected to Reduck to run reduck/mi.com/add_to_cart, or run it from a terminal with the Reduck CLI: npx @reduck-ai/cli@latest run --script reduck/mi.com/add_to_cart

### Who maintains it?

It is one of Reduck's official scripts.

Source: https://reduck.ai/explore/scripts/reduck/mi.com/add_to_cart
