Billing Flows
Beta
Billing Flows are logical billing streams that group charges together. Examples include "Image API Usage", "Premium Feature X", or "Data Processing". Flows control whether charges are active or paused.
Step 1 – Get an API Key
Go to the dashboard and open Developers / Settings → API keys (where you already manage keys). Create a server-side key if you don't have one. Store this key securely as MESHPAY_API_KEY in your backend.
You will use this key in the Authorization header:
Authorization: Bearer <MESHPAY_API_KEY>
Step 2 – Create a Billing Flow
You can create flows via dashboard or API.
Option A – Dashboard
- Go to API Billing → Flows
- Click New Flow
- Fill in:
- Name – e.g. "Image API Usage"
- Description – optional
- Accounting Currency – optional (for reporting only; charges can use any currency)
- Click Save
You'll be redirected to the Flow detail page (Configuration / API Access / Test Requests).
Option B – API
POST
/v1/billing/flowsRequest Body
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
| name | string | Required | Name of the billing flow | Image API Usage |
| description | string | null | Optional | Optional description of the flow | Charges per processed image. |
| accounting_currency | string | null | Optional | Optional accounting currency for reporting (e.g., 'USD'). Does NOT constrain charge currencies - charges can use any currency. | EUR |
Code Examples
import requestsimport osurl = "https://api.orvion.sh/v1/billing/flows"headers = {"Authorization": f"Bearer {os.environ['MESHPAY_API_KEY']}","Content-Type": "application/json"}data = {"name": "Image API Usage","description": "Charges per processed image.","accounting_currency": "EUR" # Optional - for reporting only}response = requests.post(url, json=data, headers=headers)flow = response.json()print(f"Flow created: {flow['id']}")
Response
Returns the created flow object:
{
"id": "flow_123",
"name": "Image API Usage",
"description": "Charges per processed image.",
"accounting_currency": "EUR",
"status": "active",
"created_at": "2025-11-27T12:00:00Z"
}
Save the id (e.g. flow_123) – you'll use it as flow_id in charge calls.
Flow Properties
Status
Flows can be in one of two states:
active(default) - Charges can be created for this flowpaused- Charges are blocked (returns 403 when attempting to create charges)
Fields
id- Unique identifier for the flow (e.g.,flow_123)name- Display name for the flowdescription- Optional descriptionaccounting_currency- Optional currency code for reporting/analytics (does NOT constrain charge currencies)status- Current status (activeorpaused)organization_id- Organization that owns this flowcreated_at- Timestamp when the flow was created
Error Scenarios
400 Bad Request
- Missing required field (
name) - Invalid JSON in request body
401 Unauthorized
- Missing or invalid API key
- API key does not have permission to create flows
422 Unprocessable Entity
- Invalid
accounting_currencyformat - Validation errors
Next Steps
- Create your first charge using the flow ID
- View transactions for this flow
- Test charges from the dashboard
Related Documentation
- API Billing Overview - Core concepts
- Charges API - Creating charges for a flow
- Transactions - Viewing flow transactions