The pain
The sale closes on WhatsApp, but the charge leaves the channel and the confirmation never comes back to the system.
Who uses it
The sales or support operator who runs the conversation.
Who buys it
The business owner, or the customer-service platform that serves those businesses.
The gain
Cart, Pix charge and confirmation in one thread, with the payment in your ledger. Money going out is a separate request your approval rule can hold.
The flow, side by side
From the cart to a confirmed payment.
The agent charges, the customer pays in the bank app, the ledger records it. Money going out is a separate request your rules can hold.
01Agent
Cart from the conversation
The copilot drafts the cart from what the customer wrote; prices come from your catalog.
Pedido #1047 · R$ 289.90 · Illustrative02CodeSpar
Pix charge
codespar_charge issues a Pix charge with QR and copy-paste code. With an approval rule on the tool, an operator approves it first.
codespar_charge · Pix · 24 h03Customer
Paid in the bank app
The customer pays with the QR or the code in the bank app. The payment is confirmed to the charge.
payment_status · succeeded04Your system
Ledger and the thread
Money in is a ledger entry. Your WhatsApp integration tells the customer the order is confirmed. A refund is a new request: money out.
ledger entry · #1047 confirmed
Two ways to pay
Two ways to pay. One runs today.
Path B is what runs today, in the sandbox: a Pix charge in the thread, paid in the bank app. Path A, paying inside the chat under the customer's own mandate, is where this goes: it depends on a bank or partner and does not exist today. Below, how it would look.
Path B · QR / copy and paste
SandboxPay in the bank app, confirmed in the thread
The cart goes out with a Pix QR and a copy-paste code. The customer pays in the bank app; the payment is confirmed to the charge and lands in your ledger. Your integration says so in the thread.
Runs in the sandbox with a test key. Delivery on WhatsApp is your integration.
Path A · pay inside the chat
Direction · bank or partnerConfirm and pay in the message
The customer taps once and their own assistant pays under a mandate the customer gave their bank or a partner: cap per purchase, expiry, verified payee. No bank app.
Direction. Depends on the bank or partner that holds the customer's mandate. It does not exist today.
Path A · pay inside the chat
Confirm and pay in the message, as it would look.
The same cart. The customer taps once and their own assistant pays under a mandate the customer gave their bank or a partner: cap, expiry, verified payee. No bank app, no redirect. None of this exists today; it depends on that bank or partner.
Illustrative · demo data · It does not exist today: it depends on the bank or partner that holds the customer's mandate.
Behind it
Charge in, money out, each with its own rule.
Collect issues the charge; Pay sends the refund. A mandate governs what an agent spends, so the charge side has none: there, an optional approval rule puts a person before the charge.
SDK example · demo data · not run on this page
What exists today
Exists, sandbox, pilot or direction: one label per control.
What you can run with a test key today, what runs in the sandbox, what depends on a pilot or an integration, and what is only a direction.
Cookbook
A Pix charge in the chat, end to end.
One call issues the charge, one reads its status. An approval rule, if you set one, holds the charge in the Dashboard; the agent reads the outcome.
- A test keyFrom the Dashboard. Test keys are free; nothing moves real money.
- An approval rule, if you want oneAgent and tool, set in the Dashboard: codespar_charge for charges, codespar_pay for refunds.
- A conversationAny reference the agent can quote: customer, items, amount, order number.
// 1 · a test key from the Dashboard; an approval rule on codespar_charge is optionalimport { CodeSpar } from "@codespar/sdk";const session = await new CodeSpar().create("user_0000", { preset: "brazilian" }); // 2 · the agent issues the Pix charge for order #1047: QR and copy-paste codeconst run = await session.send("charge R$ 289.90 by Pix to Ana Souza for order #1047");const charge = run.tool_calls.find((c) => c.tool_name === "codespar_charge"); // 3 · the customer pays in the bank app; follow the charge until it settlesif (charge) console.log((await session.paymentStatus(charge.id)).payment_status); // "succeeded"SDK example · demo data · not run on this page