5-Minute Quick Start
Go from a fresh ABAXUS deployment to a paid invoice with five API calls.
Prerequisites
Before you begin, you need:
- ABAXUS running and reachable (see the Kubernetes Setup guide for deployment instructions).
- A secret API key starting with
sk_. Generate one in the ABAXUS dashboard under Settings → API Keys, or viaPOST /v1/api-keys. - curl or any HTTP client. All examples below use curl.
Set your API key as an environment variable so you don’t have to repeat it:
| |
Step 1 — Create a Metric
A metric defines what you want to measure and how to aggregate raw events into a usage total. Here we create a metric for API calls that sums all events within a billing period.
| |
Response:
| |
The key field (api_calls) is what you’ll reference when sending events and building price plans. Keep it stable — it’s the identifier that ties everything together.
Step 2 — Create a Price Plan
A price plan defines how to charge for measured usage. Here we create a Growth plan with a tiered charge for API calls and a flat monthly base fee.
| |
Response:
| |
This plan gives customers 100k free API calls, then charges $0.0001 per call up to 1M, dropping to $0.00005 per call beyond that — plus a $49/month base fee.
Step 3 — Create a Customer
Customers represent the entities you bill. Provide a stable id that matches your own user or organization identifier.
| |
Response:
| |
The payment_provider_customer_id links this ABAXUS customer to an existing Stripe Customer object. ABAXUS will use that Stripe customer’s saved payment methods when charging invoices.
Step 4 — Create a Subscription
Subscriptions bind a customer to a plan and lock in the plan version. Once a subscription is created, plan changes won’t affect its billing — customers stay on the plan version they signed up for until you explicitly migrate them.
| |
Response:
| |
Note the plan_version: 1 — this subscription is pinned to version 1 of the Growth plan.
Step 5 — Send an Event
Events are the raw usage signals your product emits. Send them as they happen, or in batches. Include an idempotency_key so retries are safe.
| |
Response: 202 Accepted — the event is queued and will be processed asynchronously.
You can send events from any service in your infrastructure. For high-volume scenarios, use POST /v1/events/batch to send up to 1,000 events in a single request.
Step 6 — Create and Charge an Invoice
When you’re ready to bill, create an invoice for the customer. ABAXUS calculates all charges for the billing period and returns a line-item breakdown.
| |
Response:
| |
Now charge it against Acme’s saved Stripe payment method:
| |
Response:
| |
The invoice is now marked paid, and a PaymentIntent was created in Stripe. The full audit trail (event log) is available at GET /v1/invoices/:id/events.
What’s Next
You’ve completed the core billing loop. From here:
- Core Concepts — understand the mental model behind metrics, plans, events, and invoices in depth.
- Defining Metrics — learn about all 7 aggregation types and how to model complex usage signals.
- Creating Price Plans — build more sophisticated pricing with mixed models and entitlements.
- Event Ingestion — high-volume event ingestion, batching, and idempotency patterns.
Ready to map your billing architecture?
In 30 minutes we identify your data contract gaps and show exactly what fixing the architecture looks like.