Skip to main content
ConceptsMeta-tools

codespar_checkout

Sell-side merchant checkout — as a merchant, create and process a checkout for a shopper to pay you. Routes to Stripe ACP, Asaas, or x402 by payment method. Call via session.execute().

1 min read

codespar_checkout

Meta-tool

codespar_checkout is the sell-side primitive: as a merchant, you create and process a checkout for a shopper to pay you. It handles cart, pricing, tax, and payment, and routes to the right rail from paymentMethod. Use codespar_shop when the agent is the buyer shopping a store. Use codespar_charge for a bare inbound charge, and codespar_pay for an outbound transfer.

Rails

The rail is selected from paymentMethod:

paymentMethodRoutes toNotes
cardStripe ACPAgentic Commerce Protocol hosted checkout
pixAsaasBRL, instant settlement
boletoAsaasBR bank slip
usdcx402On-chain micropayment settlement

Direct execute

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

const order = await session.execute("codespar_checkout", {
  items: [{ name: "Tênis Masculino", quantity: 1 }],
  paymentMethod: "pix",
  currency: "BRL",
  recipient: "shopper@example.com",
});
console.log(order.tool_call_id, order.status);
order = session.execute("codespar_checkout", {
    "items": [{"name": "Tênis Masculino", "quantity": 1}],
    "paymentMethod": "pix",
    "currency": "BRL",
    "recipient": "shopper@example.com",
})
print(order["tool_call_id"], order["status"])

Args shape

FieldTypeRequiredDescription
itemsarrayYesItems in the checkout
paymentMethodstringNocard | pix | boleto | usdc
currencystringNoCurrency code (e.g. BRL, USD)
recipientstringNoShopper identifier (who pays the merchant)

Result

Returns a tool_call_id plus the resolved payment rail. Card and Pix settle asynchronously — correlate completion with session.paymentStatus() just like codespar_charge.

See also

codespar_checkout | CodeSpar