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 clear empties your entire cart in a single GET + PUT — it removes all product lines atomically. It is the recommended first step before building a fresh basket with cart set-many, ensuring you start from a known empty state.

Synopsis

mercadona cart clear [flags]

Flags

FlagDefaultDescription
--wh <code>config/mad1Warehouse code
--lang <code>config/esLanguage code (es, en, ca, eu, vai)
--jsonfalseEmit raw cart JSON (PUT response)

Examples

# Clear all items
mercadona cart clear

# Clear and get JSON confirmation
mercadona cart clear --json

Human output

On success, the command prints how many products were removed:
✓ carrito vaciado (5 productos eliminados)
If the cart is already empty when the command runs, no write is issued and a different message is shown:
✓ el carrito ya está vacío
With --json, the raw PUT response (the new empty cart object) is emitted to stdout instead.
The recommended pattern for replacing an existing basket is to run cart clear first, then cart set-many -f basket.txt. This guarantees the resulting cart contains exactly the products in your file, with no leftover lines from a previous session. If you only want to add or adjust specific items without wiping the rest, use cart set-many directly — it applies changes on top of whatever is already in the cart.

Build docs developers (and LLMs) love