TAŇBA-OOH Разработчикам

Money report - accrued, invoiced, paid and outstanding

GET /api/v1/billing/reports

https://app.tanba-ooh.kz/api/v1/billing/reports

Технический текст справочника написан на английском.

Scope read:billing. Own organisation; the authority and the platform see all. accrued_* columns are plays and approvals without VAT, split into estimates (open periods) and closed periods; invoiced, paid and outstanding are issued documents and bank payments with VAT where the issuer charges it, and paid + outstanding = invoiced. Estimates are never added to issued documents.

Аутентификация

Ключ API в заголовке Authorization или сессия консоли.

Право доступа: read:billing

Параметры

ИмяГдеТипОбязательныйОписаниеПример
fromзапросstringнетFirst month, YYYY-MM (default eleven months back).2025-11
toзапросstringнетLast month, YYYY-MM (default the current month).2026-10

Ответы

200 The report sections.

application/json

ИмяТипОбязательныйОписаниеПример
fromstringдаFirst month of the report, YYYY-MM."2025-11"
tostringдаLast month of the report, YYYY-MM."2026-10"
monthsarray of objectдаAccrued, invoiced and paid amounts for each month.
by_issuerarray of objectдаAmounts for each issuer of documents.
by_payerarray of objectдаAmounts for each payer.
top_payersarray of objectдаThe payers with the largest amounts.
by_kindarray of objectдаAmounts for each kind of document.
by_districtarray of objectдаAmounts for each district.
overduearray of objectдаDocuments past their due date.
ageingarray of objectдаOutstanding amounts by age.
cash_calendararray of objectдаExpected payments by date.

Пример

{
  "from": "2025-11",
  "to": "2026-10",
  "months": [
    {}
  ],
  "by_issuer": [
    {}
  ],
  "by_payer": [
    {}
  ],
  "top_payers": [
    {}
  ],
  "by_kind": [
    {}
  ],
  "by_district": [
    {}
  ],
  "overdue": [
    {}
  ],
  "ageing": [
    {}
  ],
  "cash_calendar": [
    {}
  ]
}

Ошибки

Ошибки приходят документом problem (application/problem+json) со стабильным полем code.

СтатусЗначение
401Нет действительной сессии или ключа API (unauthenticated, session_expired, invalid_api_key).
403Роль или право ключа этого не допускает (forbidden, key_scope_denied, key_route_denied).
422Ошибки полей (validation_failed).
defaultОшибка в виде документа problem.

Примеры кода

curl

curl 'https://app.tanba-ooh.kz/api/v1/billing/reports' \
  -H 'Authorization: Bearer YOUR_API_KEY'
Python
import requests

response = requests.get(
    "https://app.tanba-ooh.kz/api/v1/billing/reports",
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
    },
)
print(response.status_code, response.text)
Go
package main

import (
	"fmt"
	"io"
	"net/http"
)

func main() {
	req, err := http.NewRequest("GET", "https://app.tanba-ooh.kz/api/v1/billing/reports", nil)
	if err != nil {
		panic(err)
	}
	req.Header.Set("Authorization", "Bearer YOUR_API_KEY")
	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()
	data, _ := io.ReadAll(resp.Body)
	fmt.Println(resp.Status, string(data))
}