Telecom · Backend
Billing API Service
A single service that charges subscriber balances for paid services. The core knows nothing about individual operators — each operator’s protocol is isolated in its own adapter.
- Category
- Telecom · Backend
- Role
- Architecture and backend development
- Stack
- Go · gRPC · Telegram Bot API
The problem
- Paid short-code services need to charge the balances of subscribers across different mobile operators.
- Every operator has its own charging protocol: some charge in a single request, others require two steps (reserve, then confirm).
- Operator channels must never be mixed: an operator A subscriber is charged only through operator A’s channel.
- The team needs complete per-request data for later analysis, plus timely alerts about important events.
The solution
- A Go core with one charging interface and a set of adapters — one per operator (Adapter pattern).
- Each adapter encapsulates its operator’s protocol: single-step charge or two-step confirmation.
- Strict routing: a request goes only to the adapter of the subscriber’s operator.
- Configuration for multiple accounts per operator.
- An Admin API for management and per-request metrics export.
- Telegram notifications for the team.
- Adding an operator means adding an adapter — the core stays unchanged.
Architecture
Data flow, step by step
- A client service calls the Billing API over gRPC with a charge request.
- The core resolves the subscriber’s operator and selects that operator’s adapter only.
- The adapter runs the operator protocol: a single charge, or reserve-and-confirm.
- The Admin API provides management and per-request metrics; key events are sent to Telegram.
- Adapters isolate protocol differences, keeping the core small and testable.
- Separate operator channels rule out charging through the wrong billing system.
- Per-request metrics are collected from day one as the basis for analysis and monitoring.
My contribution
- Architecture design: core and operator adapters
- Backend development in Go
- Admin API and metrics requirements
Technology stack
- Goservice core and operator adapters
- gRPCinterface for internal services
- Telegram Bot APIteam notifications