ABAXUS is an API-first billing engine you deploy inside your infrastructure. Configure your pricing model, stream usage events, and issue invoices — three clean steps, no vendor lock-in.
Configure your infrastructure and customer metering
POST /v1/metricsDeclare what to measure — API calls, storage bytes, active seats. Each metric specifies an aggregation type: sum, count, max, unique_count, and more.
POST /v1/price-plansAttach charges to metrics using a pricing model: per-unit, tiered, volume, package, or flat fee. Plans are immutable — a new version is created each time you re-use the same plan ID, so existing subscriptions are never broken.
POST /v1/customersCreate customer records with Stripe credentials and a default payment method attached. The Stripe cus_xxx ID must be provided alongside the payment method to enable reuse across invoices.
POST /v1/subscriptionsBind a customer to a price plan with a start date. The current plan version is pinned at creation — future plan updates never touch this subscription.
# 1. Define what to measure curl -X POST $API/v1/metrics \ -d '{ "key": "api_calls", "aggregation_type": "sum", "value_type": "integer" }'
# 2. Define how to charge curl -X POST $API/v1/price-plans \ -d '{ "id": "plan_growth", "currency": "USD", "charges": [{ "metric_key": "api_calls", "model": "tiered", "properties": { "tiers": [ {"up_to":10000,"unit_amount":"0.001"}, {"up_to":null, "unit_amount":"0.0005"} ] } }] }'
# 3. Register the customer curl -X POST $API/v1/customers \ -d '{ "id": "cust_acme", "billing": {"provider":"stripe",...}, "payment_method": { "provider_customer_id": "cus_xxx", "provider_payment_method": "pm_xxx" } }'
# 4. Activate the subscription curl -X POST $API/v1/subscriptions \ -d '{ "customer_id": "cust_acme", "plan_id": "plan_growth", "start_date": "2026-01-01T00:00:00Z" }' # → {"id":"sub_a1b2c3","status":"active"}
Stream usage signals into ABAXUS in real time
Every billable action in your product becomes an event. ABAXUS accepts single events, batches of up to 500, and historical backfills — all idempotent. One invalid event in a batch never blocks the rest.
202 Accepted.207 Multi-Status response. Maximises throughput at high volume.Every event requires an idempotency_key. Duplicate keys are silently skipped — safe to retry unconditionally on any network failure or timeout.
# Single event — fire and forget curl -X POST $API/v1/events \ -d '{ "customer_id": "cust_acme", "subscription_id": "sub_a1b2c3", "metric_key": "api_calls", "value": "1", "timestamp": "2026-03-17T14:00:00Z", "idempotency_key": "evt_req_abc123", "properties": { "region": "us-east-1" } }' # → 202 Accepted
# Batch — up to 500 at once curl -X POST $API/v1/events/batch \ -d '{ "events": [ {"idempotency_key":"evt_001",...}, {"idempotency_key":"evt_002",...} ] }' # → 207 {"results":[{"status":202},...]}
Automated billing from usage to payment
GET /v1/usage/summaryQuery pre-computed aggregates for a customer-facing dashboard view. Or call POST /v1/usage/compute for the exact authoritative figure that will appear on the invoice.
POST /v1/pricing/calculateRun a full line-item calculation for the billing period. Every tier, every metric broken down. The resulting calculation_id is stored and referenced in the invoice.
POST /v1/invoicesCreate an invoice. cutoff_date becomes the period end; the period start is derived from the last invoice or subscription start date. Invoices with a $0 total are rejected.
POST /v1/invoices/:id/chargeCreate a Stripe PaymentIntent for the invoice total using the customer's saved payment method. On success the invoice transitions to paid.
# A. Check current usage curl $API/v1/usage/summary\ ?customer_id=cust_acme\ &metric_key=api_calls\ &period_start=2026-03-01T00:00:00Z\ &period_end=2026-04-01T00:00:00Z # → {"value":"85000","meta":{"consistency":"eventual"}}
# B. Calculate exact billing curl -X POST $API/v1/pricing/calculate \ -d '{ "customer_id":"cust_acme", "subscription_id":"sub_a1b2c3", "period_start":"2026-03-01T00:00:00Z", "period_end":"2026-04-01T00:00:00Z" }' # → {"total_amount":"127.50","line_items":[...]}
# C. Issue the invoice curl -X POST $API/v1/invoices \ -d '{ "customer_id":"cust_acme", "cutoff_date":"2026-03-31T23:59:59Z" }' # → {"id":"inv_abc","status":"issued"}
# D. Charge the customer curl -X POST $API/v1/invoices/inv_abc/charge # → {"status":"paid","payment_intent":"pi_xxx"}
Browse every endpoint with full parameter tables, request and response examples, and error codes.