App Logo
walmart.com

Add Walmart product to cart

Automatically add Walmart product to cart on walmart.com. Add a product to your Walmart.com cart by item id, with an optional quantity. A product already in the cart has the quantity added to the one it has. Returns the product's cart line after the add (quantity, unit price, line total, seller), the cart's item count and subtotal, and whether the cart belongs to a signed-in account or to this browser's guest cart. Items with no add-to-cart button (out of stock, sold only in store) fail with Walmart's availability for them. Walmart sometimes refuses automated cart changes with its "Robot or human?" check; the run then fails saying so, and it usually clears after a pause.

Input

itemId required

Walmart item id (us_item_id), the trailing number of an /ip/ URL; also returned by search-products.

quantity optional

How many to add.

Default: 1

Output

line required

The product's cart line after the add; null if Walmart did not keep it in the cart.

us_item_id required

Item id actually added (differs when Walmart resolves the page to another variant).

requested_item_id required

Item id passed by the caller.

subtotal optional

Cart subtotal as Walmart displays it, e.g. $7.94.

signed_in optional

True for a signed-in account's cart, false for this browser's guest cart.

cart_count optional

Total quantity across the cart's lines.

FAQ

Add a product to your Walmart.com cart by item id, with an optional quantity. A product already in the cart has the quantity added to the one it has. Returns the product's cart line after the add (quantity, unit price, line total, seller), the cart's item count and subtotal, and whether the cart belongs to a signed-in account or to this browser's guest cart. Items with no add-to-cart button (out of stock, sold only in store) fail with Walmart's availability for them. Walmart sometimes refuses automated cart changes with its "Robot or human?" check; the run then fails saying so, and it usually clears after a pause.
Ask an AI agent connected to Reduck to run reduck/walmart.com/add_to_cart, or run it from a terminal with the Reduck CLI: npx @reduck-ai/cli@latest run --script reduck/walmart.com/add_to_cart
You do not need one. "Add Walmart product to cart" drives the real walmart.com pages in a browser, so it works whether or not walmart.com offers an API for this.
Required: itemId. Optional: quantity.
It returns line, subtotal, signed_in, cart_count, us_item_id, requested_item_id.
No. It only uses pages of walmart.com that are reachable without signing in.
It makes changes on walmart.com, like sending, posting, booking or buying something.
Ask an AI agent connected to Reduck to run reduck/walmart.com/add_to_cart, or run it from a terminal with the Reduck CLI: npx @reduck-ai/cli@latest run --script reduck/walmart.com/add_to_cart
It is part of Reduck's official curated catalogue.

Start building not clicking