Skip to content

Admin Billing Endpoints

Admin Billing API endpoints.


Overview

Method Endpoint Description
GET /api/v1/admin/billing/run-rate Get Billing Run Rate

API Reference

Sartiq Backend Server - Admin Billing 0.1.0

admin-billing


GET /api/v1/admin/billing/run-rate

Get Billing Run Rate

Description

Company-wide token run-rate: photos delivered in the last window_days, priced at each shooting's billing method and each org's wallet rate, then annualized (MRR = windowed € ÷ months-in-window, ARR = MRR × 12).

Reuses the same APPROVED-delivery counting as the lifetime roll-up (with one added window predicate), so the two surfaces can't diverge. Orgs with no delivery in the window are a €0 run-rate and are omitted. flat / none / unset shootings price at 0 and are surfaced via flat_excluded_count — their forfait revenue is real but not token-metered, never invented here.

Input parameters

Parameter In Type Default Nullable Description
OAuth2PasswordBearer header string N/A No
window_days query integer 90 No Trailing delivery window in days (90 = the contract default).

Responses

{
    "window_days": 0,
    "total_windowed_delivered": 0,
    "total_tokens_billable": 10.12,
    "total_mrr_eur": 10.12,
    "total_arr_eur": 10.12,
    "flat_excluded_count": 0,
    "organizations": [
        {
            "organization_id": "c46645ad-c480-4f3e-9f49-08a33fbc055a",
            "organization_name": "string",
            "effective_rate": "string",
            "windowed_delivered": 0,
            "tokens_billable": 10.12,
            "mrr_eur": 10.12,
            "arr_eur": 10.12,
            "flat_excluded_count": 0,
            "shootings": [
                {
                    "shooting_id": "3fc28aa3-bd36-4025-a30f-76b4ed76264e",
                    "name": "string",
                    "billing_metering_rule": null,
                    "windowed_delivered": 0,
                    "tokens_billable": 10.12,
                    "mrr_eur": 10.12,
                    "arr_eur": 10.12
                }
            ]
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "window_days": {
            "type": "integer",
            "title": "Window Days"
        },
        "total_windowed_delivered": {
            "type": "integer",
            "title": "Total Windowed Delivered"
        },
        "total_tokens_billable": {
            "type": "number",
            "title": "Total Tokens Billable"
        },
        "total_mrr_eur": {
            "type": "number",
            "title": "Total Mrr Eur"
        },
        "total_arr_eur": {
            "type": "number",
            "title": "Total Arr Eur"
        },
        "flat_excluded_count": {
            "type": "integer",
            "title": "Flat Excluded Count"
        },
        "organizations": {
            "items": {
                "$ref": "#/components/schemas/RunRateOrganization"
            },
            "type": "array",
            "title": "Organizations"
        }
    },
    "type": "object",
    "required": [
        "window_days",
        "total_windowed_delivered",
        "total_tokens_billable",
        "total_mrr_eur",
        "total_arr_eur",
        "flat_excluded_count",
        "organizations"
    ],
    "title": "RunRateReport",
    "description": "Company-wide token run-rate: every org that delivered in the window plus\nthe grand totals. Superuser-only (carries € and negotiated rates)."
}

{
    "detail": [
        {
            "loc": [
                null
            ],
            "msg": "string",
            "type": "string",
            "input": null,
            "ctx": {}
        }
    ]
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.

Schema of the response body
{
    "properties": {
        "detail": {
            "items": {
                "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
        }
    },
    "type": "object",
    "title": "HTTPValidationError"
}

Schemas

HTTPValidationError

Name Type Description
detail Array<ValidationError>

RunRateOrganization

Name Type Description
arr_eur number
effective_rate string
flat_excluded_count integer
mrr_eur number
organization_id string(uuid)
organization_name string
shootings Array<RunRateShooting>
tokens_billable number
windowed_delivered integer

RunRateReport

Name Type Description
flat_excluded_count integer
organizations Array<RunRateOrganization>
total_arr_eur number
total_mrr_eur number
total_tokens_billable number
total_windowed_delivered integer
window_days integer

RunRateShooting

Name Type Description
arr_eur number
billing_metering_rule
mrr_eur number
name string
shooting_id string(uuid)
tokens_billable number
windowed_delivered integer

ValidationError

Name Type Description
ctx
input
loc Array<>
msg string
type string

Security schemes

Name Type Scheme Description
OAuth2PasswordBearer oauth2