Skip to main content
ConceptsMeta-tools

codespar_shop

Buy-side shopping — act as the shopper to search a store's catalog and buy a product, minting the store's real Pix. VTEX guest checkout and Mercado Livre. Call via session.execute().

1 min read

codespar_shop

Meta-tool

codespar_shop is the buy-side primitive: the agent acts as the shopper, searching a store's catalog and buying a product, minting the store's real Pix copia-e-cola to settle from the governed wallet (via codespar_pay × pix). Use codespar_checkout when you are the merchant creating a checkout for a shopper to pay you.

Actions

actionWhat it does
searchReturns products for a merchant query
checkoutDrives the store's real checkout and returns the payable Pix + total

Stores

StoreFlow
VTEX guest checkout (Cobasi, Animale, Lojas Pompeia)No login — vault the buyer's checkout identity once via codespar_manage_connections (save_profile) so later buys don't re-ask for CEP / email / CPF
Mercado LivreBuys on the buyer's own account via a one-time connected login (codespar_manage_connections connect_start / connect_finish)

Behind the meta-tool, a cart engine resolves product, price, and availability before payment — with adapters for VTEX, Mercado Livre, and a hosted browser-worker for sites without a programmatic API. Cart state is also reachable directly via the /v1/cart REST surface. codespar_shop mints the store's payable Pix; settle it with codespar_pay using method: "pix".

Direct execute

There is no typed wrapper for codespar_shop yet — call via session.execute().

// 1) search a store's catalog
const found = await session.execute("codespar_shop", {
  action: "search",
  merchant: "cobasi",
  query: "ração golden 15kg",
});

// 2) drive the real checkout → returns the store's payable Pix
const cart = await session.execute("codespar_shop", {
  action: "checkout",
  merchant: "cobasi",
  productId: found.products[0].id,
});
console.log(cart.pixCopiaECola, cart.total);
# 1) search a store's catalog
found = session.execute("codespar_shop", {
    "action": "search",
    "merchant": "cobasi",
    "query": "ração golden 15kg",
})

# 2) drive the real checkout → returns the store's payable Pix
cart = session.execute("codespar_shop", {
    "action": "checkout",
    "merchant": "cobasi",
    "productId": found["products"][0]["id"],
})
print(cart["pixCopiaECola"], cart["total"])

See also

codespar_shop | CodeSpar