/bff/branch/monthly-breakdown
Returns one row per calendar month over the requested window with: gross revenue (SUM(price × count − sale), storno items excluded), net credit balance, applied write-offs and the resulting "net" (revenue − franchise_fee + writeoff). On top of the rows the response carries window totals plus monthly average + monthly median + best-month + worst-month reference points the admin uses to colour-code each row relative to the branch's own baseline. Franchise fields are emitted as 0 when the branch has no franchise_fee_percentage configured. Revenue is bucketed by COALESCE(core__calendar_event.start_time, shop__order_item.inserted_date) — event-linked items (gym lessons, calendar appointments) land in the month they happened, non-event items in the month they were recorded.
Parameters
2 query
branchSlugstringRequiredBranch slug.
monthCountstringHow many calendar months to return (default 24, clamped to [1, 60]). The window always ends with the current month.
Request
GET /bff/branch/monthly-breakdown
curl -X GET "https://api.bizkithub.com/bff/branch/monthly-breakdown?branchSlug=gymroom-vinohrady&monthCount=12" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY"Response
JSON payload
{
"branchId": "example_branchId",
"branchSlug": "example_branchSlug",
"branchName": "example_branchName",
"currency": "example_currency",
"franchiseFeePercentage": 0,
"monthCount": 0,
"months": [
{
"month": "example_month",
"revenue": 0,
"cashInAmount": 0,
"creditAmount": 0,
"writeoff": 0,
"writeoffAgainstFranchisor": 0,
"franchiseFeePercentage": 0,
"franchiseFeeAmount": 0,
"gatewayFeeAmount": 0,
"costAmount": 0,
"costAmountAgainstFranchisor": 0,
"variableCost": 0,
"net": 0,
"invoice": {
"orderId": 0,
"orderHash": "example_orderHash",
"orderNumber": "example_orderNumber",
"isStorno": false
}
}
],
"totals": {
"revenue": 0,
"cashInAmount": 0,
"creditAmount": 0,
"writeoff": 0,
"franchiseFeeAmount": 0,
"gatewayFeeAmount": 0,
"costAmount": 0,
"variableCost": 0,
"net": 0,
"monthlyAverageRevenue": 0,
"monthlyMedianRevenue": 0,
"monthlyAverageNet": 0,
"monthlyMedianNet": 0
}
}All response codes
1 status code documented
Need an API key?
All BizKitHub API endpoints require authentication via API key.