Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ivorpad/mercadona-cli/llms.txt

Use this file to discover all available pages before exploring further.

cart add and cart set update a single product line in your cart. add is additive — it increments the existing quantity by the amount you supply. set assigns an absolute quantity; passing 0 removes the item from the cart entirely. Both commands accept a --max spending cap and print a concise one-line summary after writing.

Synopsis

mercadona cart add <product_id> <qty> [flags]
mercadona cart set <product_id> <qty> [flags]

Flags

FlagDefaultDescription
--max <eur>0/env/configRefuse if resulting cart total exceeds this amount
--wh <code>config/mad1Warehouse code
--lang <code>config/esLanguage code (es, en, ca, eu, vai)
--jsonfalseEmit raw cart JSON (PUT response)

Examples

# Add 2 units of product 51110
mercadona cart add 51110 2

# Add with spending cap
mercadona cart add 10379 99 --max 50
# → error: BUDGET EXCEEDED (estimated ≈123.20€ > 50.00€ limit): ...

# Set absolute quantity (remove if 0)
mercadona cart set 51110 3
mercadona cart set 51110 0   # removes the item

# Set with JSON output
mercadona cart set 13406 2 --json

Human output format

After a successful write, a single summary line is printed to stdout showing the touched product, its new quantity, and the updated cart totals:
✓ add [51110] Queso rallado mozzarella pizza-Roma Hacendado → x3  |  carrito: 4 productos, total 20.16€
If the basket is below the 60€ delivery minimum, a shortfall hint is appended on the next line.

Difference between add and set

  • add: new qty = existing qty + N. The result is never below 0 — if the line did not already exist it is created with qty = N.
  • set: new qty = N exactly. Passing 0 removes the line entirely from the cart.
qty is parsed as a float, so weight and bulk products accept fractional values such as 0.5.
For updating more than one product at a time, prefer cart set-many. It folds all changes into a single PutCart, performs the budget check upfront against the full resulting basket, and avoids the eventual-consistency race that can occur between multiple back-to-back single-product writes.
Back-to-back add or set calls for different products can race. Each write does its own GetCart — if the second call reads before the first write has propagated, it overwrites the first change with a stale cart snapshot. Use cart set-many whenever you need to update multiple products in one operation.

Build docs developers (and LLMs) love