One billing provider. Three billing worlds.
How Stackbox handles B2C ad-hoc charging, recurring tariff plans and aggregated MSP billing through a single billing provider — data-driven, automated, and with full reconciliation back into CPO accounting.
01 · Challenge
Three billing realities. One system. Zero compromises.
A CPO serving both direct customers and MSPs runs three fundamentally different billing models in parallel — with different data sources, billing logic, recipients and accounting requirements. Solving this complexity in a unified billing process is the real challenge.
B2C Ad-hoc: single transaction, immediate billing
Ad-hoc charging sessions via app must be billed per session, immediately. Each session is a standalone transaction with an individual amount that must be delivered directly to the end customer — without delay, with a tax-compliant receipt.
B2C Recurring: tariff plans with subscription logic
Subscription customers pay a periodic base fee and charge at preferential rates. The billing logic must correctly map subscription cycles, top-up consumption billing and mid-cycle tariff changes — automatically and without manual intervention.
B2B MSP: aggregated billing at MSP tariffs
MSPs route their users — via app or charge card — to CPO infrastructure. All sessions from one MSP must be aggregated, priced at the bilaterally agreed MSP tariff and invoiced to the MSP as a consolidated bill.
Heterogeneous data sources per stream
Session data (CDRs) comes from the CPMS, tariff assignments from contract management, payment status from the PSP and MSP contract data from the roaming backend. For each stream, the right data must be combined and correctly evaluated.
Accounting: reconciliation and cost centres
Paid invoices, cancellations, partial payments and credits must be fed back into CPO accounting in a structured way — with correct assignment to cost centres, tax classes and posting groups for ERP or accounting systems.
Tax compliance across all streams
B2C invoices, B2B MSP invoices and subscription fees have different tax requirements — different performance data, tax statements and archiving obligations that must be correctly represented per stream.
None of these three billing streams operates by the same logic. Ad-hoc is transactional, tariff is subscription-based, MSP is aggregated and contract-bound. A billing provider can handle this technically — but only if the data is right: correctly prepared, stream-specifically assigned, and fully delivered via API. That's the integration challenge Stackbox solves.
02 · The three billing streams
Each stream has its own logic — and its own data structure.
Before the billing provider integration can take effect, each billing stream must be understood and modelled as a standalone unit. Stackbox cleanly separated these three streams, worked them out data-first and delivers them as separate API payloads to the billing provider.
Direct payment via app
End customer starts a charging session via app or QR code, pays directly via PSP. No pre-registration for a tariff required.
Tariff plans & subscriptions
Registered customers with a tariff contract pay a periodic base fee and are billed separately for consumption beyond that.
MSP consolidated invoice
MSPs route their customers — via app or charge card (RFID) — to CPO charging infrastructure. Billing runs aggregated against the MSP.
03 · Solution
One API layer orchestrating all three streams.
Stackbox built a billing integration layer that mediates between CPMS, contract management, PSP and billing provider. It ensures every billing stream receives the right data in the right structure — and that results flow fully back into CPO accounting.
CDR ingestion & stream classification
Every completed charging session delivers a CDR from the CPMS. The integration layer classifies each CDR automatically: ad-hoc direct payment, tariff customer or MSP session — based on token type, customer assignment and contract context.
Stream-specific data enrichment
Depending on the classified stream, CDR data is enriched: for ad-hoc with PSP transaction data, for tariff customers with the active tariff model and subscription status, for MSP sessions with the bilaterally agreed B2B tariff and MSP contract reference.
API handoff to billing provider
The prepared records are delivered stream-specifically to the billing provider: ad-hoc as individual transactions with immediate invoicing, tariff customers as consumption items against the subscription, MSP sessions as an aggregated batch per billing period.
MSP aggregation & tariff pricing
All sessions for an MSP are collected per period, priced at the MSP-specific tariff and invoiced as a consolidated item. The logic accounts for charge type differences (AC/DC), location categories and any discount agreements from the MSP contract.
Reconciliation back into CPO accounting
Invoice status, payments, cancellations and credits are fed back from the billing provider via webhook or API polling and passed into the CPO's ERP or accounting system — with correct cost centre and tax assignment per stream.
Dunning & exception handling
Payment failures, chargebacks and disputed MSP CDRs are handled stream-specifically: automatic dunning for B2C customers, escalated resolution processes for B2B disputes, and structured error logs for unassignable sessions.
Data flow
Classification · Enrichment · Routing
CDR → Billing Mapping
| CDR field | Billing object | |
|---|---|---|
| session_id | → | invoice.line_item |
| total_energy | → | charge.quantity |
| token.uid | → | customer.id / msp.id |
| tariff_id | → | price_plan.id |
| start_datetime | → | billing_period |
| total_cost | → | line_item.amount |
Ad-hoc: real-time invoicing
Every completed ad-hoc session automatically triggers invoice creation. CDR and PSP transaction are linked, and the tax-compliant receipt is sent immediately via email and accessible in the app — no manual follow-up required.
Recurring: subscription & consumption
Tariff customers automatically receive their monthly base fee as a recurring charge plus a separate consumption invoice for all sessions in the period. Mid-cycle tariff changes are calculated pro-rata to the day.
MSP: aggregation & B2B tariff
All sessions for an MSP are collected over the period and priced at the bilaterally agreed rate. The consolidated B2B invoice includes a full session list as an attachment and is OCPI-CDR-referenced for easy reconciliation.
Accounting reconciliation
Invoice status and payment events flow back into CPO accounting in a structured way. Every posting carries cost centre, tax class and stream identifier — directly importable into ERP systems.
What flows back into CPO accounting
Structured records per billing stream — automatic, complete, ready to post.
04 · Impact
What actually changes for CPOs.
From three parallel, partially manual processes to a fully automated billing stack — with measurable results from day one.
billing streams fully automated through a single billing provider
manual postings — all data flows back into the ERP automatically and in structured form
CDR coverage — no session goes uncharged, regardless of stream
fully API-driven — no manual exports, no CSV uploads, no system gaps
tax-compliant receipts and audit-proof archiving of all invoices
scalable to any number of MSP partners and B2C customers without added overhead
We had three separate billing processes that all ran somewhat half-automated — ad-hoc through the PSP, tariff customers through a separate solution, and MSP billing almost entirely in Excel. Stackbox merged it all into a single integration layer. Now everything runs automatically — and our accounting team receives structured data that's ready to post.
Stackbox · Billing Integration
Ready to automate all your billing streams?
We'll show you how the Stackbox billing integration layer prepares your CDR data and delivers it stream-specifically to your billing provider — with full reconciliation back into your accounting system.
Let's talk →