Skip to main content
End-to-end flow: search, cart, checkout, confirmed An end-to-end example: your agent connects, searches Walmart for batteries, adds them to a cart, and checks out. Every call below is an MCP tool call. The same operations work on REST.

1. Create a cart

create_cart returns an empty cart. The id is used by every later call.
account: "platform" uses the signed-in AgentMall Walmart account and clears its shared cart. Omit account for a shopper browser, then call sign_in with encrypted credentials.
search_catalog returns up to 10 products. Prices are integer minor units (cents for USD).
Check the title. Search results are real Walmart listings. Confirm the product matches what the shopper asked for before adding it to the cart.

3. Add to cart

update_cart replaces the cart contents. The response includes the live line items and totals from the merchant.
The url must already point to the chosen size or colour. If the product has options, call get_product first to get the variants list, then use the variant’s id and url.

4. Open checkout

create_checkout opens the checkout page and reads it. Nothing is placed.
Tax and total are estimates until an address is set.

5. Set address and shipping

update_checkout writes the address and selects shipping. The response includes updated totals with tax.
Show these totals to the shopper before asking for a card.

6. Add payment

The card value is Evervault ev: ciphertext, collected through the console’s card collection page. Never send a raw card number.

7. Place the order

Show the review to the shopper. When they approve:
complete_checkout places the order. One approval, one merchant commit.
The session ends. The AgentMall fee ($0.50) is charged to your organization.

8. Verify the order

get_order reads the order. No session needed.

What to watch for

  • Check titles after searching. Search results are real listings and relevance varies.
  • Show totals before asking for payment. Tax depends on the address.
  • Use the latest review_hash from the most recent checkout response. A stale hash returns review_changed.
  • Never retry after commit_unknown. Call get_order and wait. See Handling checkout errors.