How it works

Three stages. Eight API calls. One database you already know how to run.

ABAXUS turns product usage into paid invoices. Run the open core in your own infrastructure or use ABAXUS Cloud, where we host it. Every call is idempotent. Every number is exact.

  1. 01 · Setup · 4 calls

    Decide what you charge for

    Metrics, price plans, customers, subscriptions. Done once, versioned forever.

    Jump to setup
  2. 02 · Ingestion · 1 call

    Send every billable action

    Single events, batches of 500, backfills. Retries can't double-bill.

    Jump to ingestion
  3. 03 · Invoicing · 3–4 calls

    Turn usage into paid invoices

    Exact usage, calculated lines, issued invoice, charged payment, all audited.

    Jump to invoicing

The architecture, on one screen

If you can draw your billing system on a whiteboard, you can defend it in an audit. This is the whole thing.

Your productAPI, workers, SDKsemit usage events with an idempotency key
Core: your cluster · Cloud: ABAXUS cloud · same pipeline
Ingestion API202 / 207, dedupe
Durable queuemessaging adapter · default Postgres SKIP LOCKED
Meteringversioned aggregates
Pricing engineimmutable plans
InvoicesSHA-256 traced lines
storage adapter · default PostgreSQL 16 · append-only ledger · DECIMAL(20,10) · audit trail · Prometheus metrics
Payment providerStripereceives only the charge: amount, currency, payment method

Modular by design

Every major component sits behind an adapter.

ABAXUS is built from small, separable modules: ingestion, metering, pricing, invoicing, payments. The two components that carry infrastructure weight, storage and messaging, are defined as interfaces with adapters behind them. Metering, pricing and invoicing logic never touches a concrete database or broker.

Storage adapterDefault: PostgreSQL 16Events, aggregates, ledger and audit trail go through one storage interface.
Messaging adapterDefault: Postgres queueEvent delivery and background work go through one messaging interface.

Start with the defaults: one Go service and PostgreSQL. Swap an adapter when your scale or your platform standards call for it, without rewriting your pricing or invoice logic.

Self-hosted Core: you define how ABAXUS is composed in your own VPC, which adapters, which topology, which dependencies, and you own that definition. ABAXUS Cloud: we define and operate the composition for you.

01 · SETUP

Model your pricing once. Change it without rewriting history.

WHY IT MATTERSPlans are immutable and subscriptions pin a version. A price change next quarter never alters an invoice from last quarter.
  1. 1
    Define metricsPOST /v1/metricsWhat you measure: API calls, storage bytes, seats. Aggregate by sum, count, max or unique count.
  2. 2
    Create price plansPOST /v1/price-plansPer-unit, tiered, volume, package or flat fee. Reusing a plan ID creates a new version.
  3. 3
    Register customersPOST /v1/customersOptionally attach a payment method. Provider credentials are set once in Settings.
  4. 4
    Create subscriptionsPOST /v1/subscriptionsBinds a customer to a pinned plan version. Entitlements apply immediately, no sync job.
setup.sh4 calls · live
# 1. what to measure
curl -X POST /v1/metrics -d '{ "key": "api_calls",
  "aggregation": "sum" }'

# 2. how to price it
curl -X POST /v1/price-plans -d '{ "id": "plan_growth",
  "currency": "USD", "charges": [ { "metric": "api_calls",
  "model": "tiered", "tiers": [
    { "up_to": 10000, "unit": "0.001" },
    { "up_to": null,  "unit": "0.0005" } ] } ] }'

# 3. who pays
curl -X POST /v1/customers -d '{ "id": "cust_acme" }'

# 4. bind them
curl -X POST /v1/subscriptions -d '{ "customer_id": "cust_acme",
  "plan_id": "plan_growth", "start_date": "2026-01-01" }'
→ { "id": "sub_a1b2c3", "status": "active" }
Entitlements: what a customer can use, separate from what they pay
booleanSSO, priority support
limitseats, monthly API calls
customrate limits, allowlists
GET /v1/entitlements/check returns granted and exceeded, so "not on plan" and "over limit" are never confused.

02 · INGESTION

Send every billable action. Retries are always safe.

WHY IT MATTERSEvery event requires an idempotency key, and duplicates are skipped without error. A network timeout can never turn into a double charge.
POST /v1/events202One event, queued asynchronously. Never blocks your request path.
POST /v1/events/batch207Up to 500 events, each with its own status. One bad event doesn't block the rest.
POST /v1/events/backfillmigrationsHistorical data straight to the events table. Affected aggregates are invalidated automatically.
ingest.shthe retry is the point
curl -X POST /v1/events -d '{
  "idempotency_key": "req_7f3a-0001",
  "customer_id": "cust_acme",
  "subscription_id": "sub_a1b2c3",
  "metric": "api_calls",
  "value": "1",
  "properties": { "region": "eu-1" }
}'
→ 202 Accepted

# network blip, client retries the same key
curl -X POST /v1/events -d '{ "idempotency_key": "req_7f3a-0001", … }'
→ 202 Accepted · duplicate skipped, counted once

03 · INVOICING

From usage to payment, with a receipt for every number.

WHY IT MATTERSDashboards read fast, eventually consistent aggregates. Invoices read exact, checksummed scans. The two are labelled, so "why don't these match?" has an answer before anyone asks.
A
Check usageGET /v1/usage/summary · POST /v1/usage/computeSummary for dashboards, compute for the exact invoice figure.
B
Calculate billingPOST /v1/pricing/calculateLine items per tier and metric, stored as a calculation the invoice references.
C
Issue invoicePOST /v1/invoicesPeriod runs from the last invoice to your cutoff date. $0 invoices are rejected.
D
Charge paymentPOST /v1/invoices/:id/chargeStripe PaymentIntent on the saved method. The intent ID lands in the audit trail.
INVOICE LIFECYCLE · every transition audited · GET /v1/invoices/:id/events
invoice.shMarch 2026 · cust_acme
A · usage
→ "85000" api_calls
B · calculate
→ total "127.50" USD
C · invoice
→ inv_abc · issued
D · charge
→ paid · pi_xxx

What your team actually operates

Fewer moving parts means fewer pages at 3 a.m. and a shorter security review.

In the stack

Go PostgreSQL 16 Docker / Helm Prometheus zerolog JSON

Not required by default

Kafka Redis Elasticsearch ClickHouse Microservices

Rather not operate it?

ABAXUS Cloud runs this same pipeline for you, hosted and operated by ABAXUS, and adds spike control at ingestion and an agent that resolves metering disputes at invoicing.

Compare Core and Cloud

Guarantees you can put in an architecture review

Idempotent everywhereEvery write is safe to retry.
Exact arithmeticDECIMAL(20,10). No floats, no rounding drift.
No hard deletesCorrections are adjustment entries.
Full audit trailEvery invoice line traces to raw events.

Now see how it maps to your stack.

A free 30-minute architecture review with the engineer who built the pipeline.

  1. 01Gap analysisWhere your current billing falls short of production requirements.
  2. 02Build-vs-buy recommendationBased on ARR, team size, event volume and compliance needs.
  3. 03Implementation scopeMigration effort estimate and cutover plan.