Your brand and your app, with CodeSpar's payments underneath.
A fintech (Fintera, in this example) wants its subscribers to pay boletos and Pix bills inside its own app. On CodeSpar, each subscriber is a consumer of Fintera's organization: codespar_kyc onboarding opens the subscriber's payment account through Celcoin (CPF, or CNPJ for a business), and codespar_pay pays a Pix or an existing boleto from that account. Fintera's app is the interface; CodeSpar runs the payments underneath.
See the prices and applicable conditions on the pricing page.
One organization, many subscribers.
An example with demo data: Fintera's organization, its subscribers as consumers, and the Pix and boleto payments they made from their own accounts in August.
- Each subscriber is a consumer of Fintera's organization
- The subscriber's account is opened through codespar_kyc onboarding
- Each payment comes from the subscriber's own account
Show me August's payments for Fintera's subscribers.
Listing August's payments across Fintera's consumers.
The conversation is the easy part.
Consumer fintechs that want bill payment end up rebuilding onboarding, accounts and payments around a processor, outside the app their subscribers already use.
Send subscribers to another app to pay a bill
Subscribers pay inside your app, with CodeSpar underneath
Build onboarding and accounts from scratch
codespar_kyc onboarding opens each subscriber's payment account
Build a payment integration per rail
codespar_pay pays a Pix or an existing boleto
Rebuild each subscriber's history
codespar_wallet action=statement lists the subscriber's entries
Your organization, your subscribers as consumers.
Each subscriber is a consumer of your organization. codespar_kyc with check_type onboarding (CPF) or onboarding-business (CNPJ) opens the subscriber's payment account through Celcoin; codespar_pay pays a Pix or an existing boleto from it; codespar_wallet reads the balance and the statement. Your app is the interface.
In your app
codespar_kycPayment account, CPF or CNPJ
Celcoincodespar_payPix or boleto
codespar_paycodespar_walletThe subscriber's entries
WalletHistory in your app
Your organization holds your subscribers as consumers. codespar_kyc opens each consumer's payment account at Celcoin (onboarding for a CPF, onboarding-business for a CNPJ), returning a verification to poll until the account exists. codespar_pay pays from that account: a Pix to a key or a copia-e-cola, or an existing boleto by its line, with an idempotency key. codespar_wallet reads the consumer's balance and statement for your app.
The code, and what it assumes.
// Prerequisites: CODESPAR_API_KEY set to a test key (csk_test_…), a Celcoin // connection, and a subscriber (sub_8821) whose payment account was opened with // codespar_kyc (check_type "onboarding"; see the meta-tool reference for its fields). import { CodeSpar } from "@codespar/sdk"; const session = await new CodeSpar().create("sub_8821", { preset: "brazilian" }); // the subscriber pays an existing boleto from their own account const pay = await session.execute("codespar_pay", { action: "pay", method: "boleto", linha_digitavel: "<the boleto's 47-digit line>", amount: 12_990, // centavos currency: "BRL", description: "Electricity bill", consumer_id: "sub_8821", idempotency_key: "bill-8821-2026-08", // required for a boleto }); console.log(pay.success, pay.data); // the subscriber's history, for your app const statement = await session.execute("codespar_wallet", { action: "statement", consumer_id: "sub_8821", limit: 20 }); console.log(statement.data);
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_kycOpens the subscriber's payment account through Celcoin: onboarding (CPF) or onboarding-business (CNPJ).
codespar_payPays a Pix or an existing boleto from the subscriber's account.
codespar_walletReads the subscriber's balance and statement.
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.