API Billing

Trigger charges from your backend with one HTTP call

Create charges for your customers from any backend event—API calls, product actions, internal tools, or scheduled jobs. You send the final amount; we record the charge and feed it into payouts.

Create charges from any endpoint

API Billing lets your backend create charges for your customers using a single HTTP endpoint. You define Flows to group charges (per product, feature, or API), send us the final amount when something should be billable, and see everything in one place in your dashboard and payouts.

Works for API calls, web/app actions, webhooks, and internal tools

You keep full control over how you calculate price

We keep the transaction record that payouts and invoicing can use

No plan editor, no metering engine, no subscription builder—just a simple charges API.

Use it whenever your backend already knows the price

Ideal when you:

Already calculate what to charge inside your backend or product logic

Want a clean way to record charges per customer and per feature

Need a source of truth for what should be paid out without rebuilding your billing model

Have multiple surfaces (API, web app, admin panel, cron jobs) that can all create charges

You decide

when and how much to charge.

We provide

a consistent way to send and track those charges.

Three steps to wire it in

How API Billing fits into your system

01
Create a Flow

Create a Flow in the dashboard, like "Pro workspace usage", "Image processing", or "One-off reports".

Flows are just logical streams: they group charges and can be paused or resumed.
02
Use your API key

Use the server-side key from your Orvion account.

Authorization: Bearer <YOUR_API_KEY>
03
Create charges from your backend

When something happens that should be billable—an API call, a button click, a cron job—you call:

POST /v1/flows/{flow_id}/charges

We store the transaction and connect it to your payouts.

Simple Charges API

One endpoint for charges from any workflow

You calculate the price where it belongs (in your app). The API Billing endpoint just records the charge and ties it to a Flow and a customer.

POST/v1/flows/{flow_id}/charges
Terminal
1FLOW_ID="flow_123"
2API_KEY="$AGENTPAY_API_KEY"
3
4curl -X POST "https://api.orvion.com/v1/flows/$FLOW_ID/charges" \
5 -H "Authorization: Bearer $AGENTPAY_API_KEY" \
6 -H "Content-Type: application/json" \
7 -d '{
8 "amount": 100,
9 "currency": "EUR",
10 "customer_ref": "user_123",
11 "reference": "image-job-987",
12 "metadata": {
13 "job_id": "987",
14 "tier": "pro",
15 "source": "api-endpoint:/v1/images/transform"
16 }
17 }'
Request fields
amount

final amount to charge

currency

ISO code (e.g. "EUR")

customer_ref

your internal identifier (user, account, workspace, etc.)

reference

human-readable reference for this charge (job id, order id, etc.)

metadata

optional JSON for whatever context you need (endpoint, feature, region, etc.)

Call it from any backend

Example SDK usage

create-charge.ts
1import { OrvionClient } from "@orvion/sdk";
2
3const client = new OrvionClient({
4 apiKey: process.env.AGENTPAY_API_KEY!
5});
6
7async function recordCharge() {
8 const txn = await client.billing.createCharge({
9 flowId: "flow_123",
10 amount: 100,
11 currency: "EUR",
12 customerRef: "user_123",
13 reference: "checkout-order-456",
14 metadata: {
15 source: "web-app",
16 feature: "pro-plan-upgrade"
17 }
18 });
19
20 console.log("Charge created:", txn.id, txn.status);
21}
22
23recordCharge().catch(console.error);

Works the same way whether the trigger is:

an API endpoint
a button click in your web app
an internal admin action
a scheduled job
Dashboard View

See all charges by flow, customer, and source

Flows
  • Create and name flows per product, feature, or API surface.
  • See which flows are active and when they last created a charge.
  • Pause a flow to stop new charges while keeping history.
Transactions
  • Filter by flow, customer, status, date range.
  • Inspect each charge with full metadata (including which endpoint or workflow created it).

These transactions are the basis for: Payouts – what should be paid out to you. Invoicing – if you generate invoices on top of actual charge data.

Common questions

Start recording charges from your backend

Create a Flow, plug a single HTTP call into your existing logic, and start tracking charges from any endpoint, product action, or internal workflow.