GET /reports/billing
Download a wholesale billing CSV for a given month. Every subscription that
was active at any point in the month is included, with prorated quantities so a
mid-month start/stop is billed for the days it was live. The provider is taken
from your API key — there is no service_provider_id parameter.
Endpoint
GET /partner/reports/billing?year=2026&month=7Authentication
X-API-Key: krnl_... — auto-scoped to the authenticated provider. Rate-limited
to 30 requests / minute per key.
Query parameters
| Parameter | Type | Notes |
|---|---|---|
year |
integer | Billing year (2000 or later). Required. |
month |
integer | Billing month, 1–12. Required. |
Invalid values return 400 (month must be between 1 and 12, year must be 2000 or later).
Response
200 OK with Content-Type: text/csv and
Content-Disposition: attachment; filename="provider-billing-YYYY-MM.csv". Columns:
| Column | Description |
|---|---|
Subscription ID |
kurnl subscription id. |
Subscriber ID |
kurnl subscriber id. |
External Subscription ID |
your external id, if the subscription came via external checkout. |
Service Provider |
provider name. |
Fee Type |
Monthly for a subscription’s row; Operator discount for a row that carries a kurnl operator discount; TV package for a TV package on the subscription. |
Quantity |
prorated fraction of days active — an unrounded float (e.g. 0.3225806451612903). |
Total Cost |
quantity × monthly wholesale price, rounded to 2 decimals. Negative on an Operator discount row. |
Wholesale price monthly |
monthly wholesale price: the plan version’s wholesale_price_monthly, falling back to the subscription’s base_wholesale_price_monthly, else 0.0. |
Wholesale Product ID |
wholesale product id. |
Wholesale Product Name |
wholesale product display name; on an Operator discount row the discount’s label, <name> (<code>); on a TV package row the TV package’s name. |
Location Hash |
the served location. |
From Date |
start of the billed window, as a naive timestamp YYYY-MM-DDT00:00:00 (no timezone suffix). |
To Date |
end of the billed window, same naive YYYY-MM-DDT00:00:00 format. |
Operator discounts
A subscription that carries a kurnl operator discount gets one extra row per month with
Fee Type = Operator discount. Its Total Cost and Wholesale price monthly are negative:
kurnl pays the discount, so your margin is unchanged. Add the row to the subscription’s
Monthly row for the net wholesale amount. Match rows on Fee Type; do not assume every
row is Monthly. The same rows are in the dashboard’s Wholesale Billing CSV, whose columns differ: it has
Location Identifier instead of Location Hash and no External Subscription ID.
TV packages
A subscription with an active TV package gets one extra row per package and month with
Fee Type = TV package, the package’s name in Wholesale Product Name and the package’s
monthly wholesale price. Quantity is the share of the month from the day the package was
marked active to the day before it was removed, inside the subscription’s own days of service;
a package still waiting for activation has no row. The wholesale invoice carries the same line.
A bulk subscription (internet included in the rent) has no Monthly row; its TV packages do have
their rows.
Errors
| Status | Meaning |
|---|---|
400 |
Invalid month / year (see above) |
401 |
Missing or invalid X-API-Key |
403 |
"API access is not enabled for this account" |
429 |
Rate limit exceeded (30/min) |
503 |
"The subscriptions could not be read; try again." No CSV is sent, so a file you receive always covers every subscription. Retry later. |
Example
curl -L "https://middleware.kurnl.ca/partner/reports/billing?year=2026&month=7" \ -H "X-API-Key: krnl_your_key" \ -o wholesale-2026-07.csv