Skip to main content
All use cases
Conversational commerceMarketplaces

Sell, charge, and ship inside WhatsApp.

The buyer browses, asks questions, and pays without ever leaving the chat. Your agent generates a Pix QR inline, confirms the payment, issues the NF-e, books the carrier, and drops tracking back into the same thread. No links, no redirects, no app to install.

BeforePayment link → cart abandoned
AfterPix QR in-thread → paid
3-tap
checkout inside chat
Try it in the Sandbox
Pix
Settled in-chat
Inline QR via Asaas or Mercado Pago
NF-e
Auto-issued
Fiscal doc the moment payment clears
1 thread
End to end
Charge, invoice, ship, notify
Sealed
Every step
Mandate-signed audit ledger
What the buyer sees

The whole checkout happens in the bubble.

No redirect, no payment page, no app. The agent quotes, generates a Pix QR inline, watches the settlement webhook, and only then issues the NF-e and books the label — all inside the same WhatsApp thread the buyer was already in.

  • Pix QR rendered in-thread — buyer pays from their banking app and comes right back
  • Settlement correlation flips the order to paid without a human polling the PSP
  • NF-e and tracking land in the same conversation, sealed to the order
Loja Aurora
agent · online
Agent
Oi! Quero 2 × Tênis SKU-ABX. Dá pra pagar no Pix?
Claro! 2 × Tênis SKU-ABX = R$ 240,00. Segue o Pix 👇
Pix · AsaasR$ 240,00
00020126…br.gov.bcb.pix
via codespar_charge · Asaas
Paguei!
Pagamento confirmado ✅ Já emiti sua nota fiscal e despachei.
via codespar_invoice · NFe.io
NF-e00421 · PDF+XML
RastreioME842193BR
Prazo3–5 dias úteis
via codespar_ship · Melhor Envio
paid · invoiced · shippedrcp_wa8421
The pain

The conversation is the easy part.

78% of Brazilian commerce already runs through WhatsApp — but the conversation is the easy 30%. The other 70% is Pix reconciliation, NF-e issuance, carrier labels, and PSP fallback, all stitched by hand and re-solved by every team that ships.

Bounce the buyer to a payment link and pray they come back

Generate a Pix QR inline with codespar_charge — paid in-thread

Poll the PSP webhook and reconcile the payment by hand

Settlement correlation flips the order to paid automatically

Issue the NF-e in a separate portal after the sale closes

codespar_invoice emits the NF-e the moment payment confirms

Copy-paste a tracking code from the carrier dashboard

codespar_ship books the label and posts tracking back to chat

How the agent does it

One thread. The whole commerce loop.

Your agent runs the full sequence from a single session. CodeSpar's meta-tools compress every provider — Asaas for Pix, NFe.io for the fiscal doc, Melhor Envio for logistics, Z-API for the channel — into commerce verbs the agent speaks natively. Every step is mandate-signed and sealed into an immutable audit ledger, so the CFO sees exactly what the agent did and why.

01
Charge
codespar_charge

R$ 240 · Pix QR in-chat

Asaas
02
Confirm
Settlement

Payment correlated · order paid

03
Invoice
codespar_invoice

NF-e 00421 · PDF + XML

NFe.io
04
Ship
codespar_ship

Label booked · tracking sent

Melhor Envio
05
Notify
Z-API

Receipt + tracking in thread

Architecture

A single session connects the WhatsApp channel to the meta-tool router. The agent emits commerce intents (charge, invoice, ship); the router resolves each to the tenant's configured provider, signs a mandate, executes through the proxy, and seals the receipt. The buyer only ever sees the conversation.

In code

A few lines. The whole loop.

whatsapp-commerce.ts
const session = await codespar.sessions.create({ channel: "whatsapp" });

// Buyer: "Quero 2 × SKU-ABX, pode ser no Pix?"
const charge = await session.execute("codespar_charge", {
  rail: "pix",
  amount: 240.0,
  buyer: { name, phone },
  items: [{ sku: "SKU-ABX", qty: 2 }],
});

await session.paymentStatus(charge.toolCallId); // → "paid"

await session.execute("codespar_invoice", { rail: "nfe", buyer, items, companyId });
await session.execute("codespar_ship",    { rail: "melhor-envio", to: buyer.address });
// receipt sealed · tracking posted back to the same WhatsApp thread
3-tap · sealedreceipt · rcp_whatsa
Featured tools
codespar_charge

Inline Pix QR via Asaas, Mercado Pago, or Stripe — buyer pays in-thread.

codespar_invoice

NF-e issued through NFe.io the moment payment confirms; PDF + XML stored.

codespar_ship

Books the Melhor Envio label and returns a tracking code to the chat.

See the meta-tool reference

Ship it this afternoon.

Open the sandbox, point a session at your providers, and run the whole loop against real rails in minutes — not the quarter it takes to build it by hand.

WhatsApp commerce bot — CodeSpar | CodeSpar