Recurring Pix, authorized once by the customer.
For a monthly plan paid in Brazil. codespar_charge creates the Pix Automático recurrence at Celcoin in one of three ways: a request sent to the payer's bank app with no QR, a QR that carries only the recurrence, or a QR that charges now and carries it. The customer authorizes it in the bank app, and each cycle is charged on that authorization; the results come back from Celcoin. It needs Pix Automático activated for your organization. Charging one price in several currencies and dunning are not offered; the fiscal document per cycle goes through NFe.io, in live projects only.
One authorization, then each cycle.
An example with demo data: the agent creates a monthly Pix Automático recurrence of R$ 52.00; the customer authorizes it in the bank app, and the fiscal document for each cycle is issued in a live project.
- The customer authorizes once, in the bank app
- The recurrence is created at Celcoin
- Several currencies and dunning are not offered
The conversation is the easy part.
Recurring billing in Brazil meant a card on file or a boleto every month, and failed charges chased by hand.
Ask the customer for a card on file
Pix Automático: the customer authorizes the recurrence in the bank app
Send a boleto every month
Each cycle is charged on the authorization the customer gave
Issue the fiscal document at month end
codespar_invoice issues it per cycle, in a live project
Start every recurrence the same way
Three ways to start: no QR, a recurrence QR, or a QR that charges now
Recurring Pix, authorized by the customer.
codespar_charge creates the Pix Automático recurrence at Celcoin in one of three journeys: a request to the payer's bank app with no QR, a QR that carries only the recurrence, or a QR that charges now and carries it. The customer's authorization in the bank app is what lets each cycle be charged, and Celcoin reports the outcome. Charging one base price in several currencies and dunning are not offered; the fiscal document per cycle goes through NFe.io, in live projects only.
Price and cycle
codespar_chargePix Automático
CelcoinIn the bank app
Charged on the authorization
codespar_invoiceNF-e · live projects only
NFe.iocodespar_charge with a recurrence block maps the journey to its Celcoin endpoint: journey 1 (no QR, the request reaches the payer's bank app), journey 2 (a QR carrying only the recurrence) or journey 3 (a QR that charges now and carries it; paying it is the acceptance). The payer's authorization at their bank and the agent's mandate are separate objects. Each cycle is an instruction to Celcoin, and its result arrives by webhook. The NF-e per cycle is codespar_invoice through NFe.io, in a live project.
The code, and what it assumes.
// Prerequisites: CODESPAR_API_KEY set to a test key (csk_test_…), a Celcoin // connection, Pix Automático activated for your organization, and a mandate of // the receiving consumer to create the recurrence under. import { CodeSpar } from "@codespar/sdk"; const session = await new CodeSpar().create("user_0000", { preset: "brazilian" }); // the agent fills codespar_charge with the recurrence block const run = await session.send( "Create a monthly Pix Automático recurrence of R$ 52.00 for Ana Souza (CPF 123.456.789-09), plan Pro, with a QR that charges the first month now.", ); const created = run.tool_calls.find((c) => c.tool_name === "codespar_charge"); console.log(created?.status, created?.output); // the QR the customer pays and authorizes in the bank app
Example with the published SDK (@codespar/sdk 0.16.11). Its prerequisites are in the comments. Compiling does not prove the integration: run it in test mode first.
codespar_chargeCreates the Pix Automático recurrence at Celcoin, in one of three journeys.
codespar_invoiceIssues the fiscal document for a cycle through NFe.io; live projects only.
Start with a test key.
Test keys are free. Open the sandbox, connect the providers your project uses and see which tools it can call before you build.