Skip to main content
All use cases
Recurring billingSaaS

One base price, charged in every local currency.

The agent charges the local-currency equivalent of one base price, on the rail each customer prefers, with the right fiscal document. It handles dunning, retries, and downgrades under a recurring-consent mandate.

BeforeOne rail, one currency, manual dunning
AfterEvery currency, every rail, on consent
12 currencies
from one base price
Try it in the Sandbox
12 currencies
One base price
Charged in each customer's local currency
Pix Automatico
Recurring on consent
No card on file, mandatory since Jan 2026
NF-e
Fiscal doc
Issued per cycle (homologation today)
Sealed
Every cycle
Receipt hash-chained to the mandate
What the agent does

One base price, one local charge.

The agent takes a base price, charges the local equivalent on the customer's preferred rail under a recurring-consent mandate, issues the fiscal document, and retries on a soft decline. Each cycle seals to the mandate.

  • Charges the local equivalent of one base price
  • Runs on Pix Automatico recurring consent, no card on file
  • Issues the fiscal document each cycle
  • Dunning and retries stay inside the mandate
Plan · Pro
Recurring · mandate
Agent
Cycle due. Charging R$ 52 on Pix Automatico.
via codespar_charge · Pix rail
Paid. Fiscal doc issued for this cycle.
PlanPro
RailPix Automatico
AmountR$ 52,00
Receiptrcpt_SB
Renewed. Next cycle in 30 days.
charged · invoiced · sealedrcpt_SB01
The pain

The conversation is the easy part.

Recurring billing across borders means one currency, one rail, and dunning you chase by hand when a charge fails.

Bill everyone in one currency

The agent charges the local equivalent of one base price

Force everyone onto a card

The agent uses the rail each customer prefers, including Pix

Chase failed charges by hand

Dunning and retries run under the mandate

Issue fiscal docs at month end

The fiscal document is issued each cycle

How the agent does it

Recurring revenue, every rail, on consent.

The agent charges the local-currency equivalent of one base price on the rail each customer prefers, under a recurring-consent mandate. Pix Automatico carries the recurring leg with no card on file. Each cycle is a sealed receipt.

01
Base price
Base

One price to localize

02
Localize
FX

Convert to the local currency

03
Charge
codespar_charge

Recurring on Pix Automatico

Pix rail
04
Invoice
codespar_invoice

Fiscal doc for the cycle

Fiscal rail
05
Seal
Audit ledger

Receipt to the mandate

Architecture

The agent localizes one base price, then codespar_charge runs the recurring leg on Pix Automatico under a recurring-consent mandate, codespar_invoice issues the fiscal document, and the receipt seals to the mandate. Soft declines retry inside the same caps.

In code

A few lines. The whole loop.

subscription-agent.ts
const session = await codespar.sessions.create();

// charge the local equivalent of one base price, on consent
const res = await session.execute("codespar_charge", {
  basePriceUsd: 10,
  rail: "pix-automatico", // recurring-consent mandate
  customer: "cus_8821",
});

await session.verificationStatus(res.toolCallId);
12 currencies · sealedreceipt · rcp_subscr
Featured tools
codespar_charge

Runs the recurring charge on the customer's preferred rail.

codespar_invoice

Issues the fiscal document for each billing cycle.

Audit ledger

Hash-seals every cycle to the recurring-consent mandate.

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.

Subscription billing agent — CodeSpar | CodeSpar