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

Billing periods with totals

GET /api/v1/billing/periods

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

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

Scope read:billing. Amounts are estimates, in tenge, without VAT unless stated.

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

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

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

Ответы

200 Periods, newest first.

application/json

ИмяТипОбязательныйОписаниеПример
itemsarray of BillingPeriodдаPeriods, newest first.
items[].idstring (uuid)даIdentifier of the billing period."0b1c3a52-6f0e-4c2e-9d3a-2f5d1e7a9c10"
items[].org_idstring (uuid)даIdentifier of the organisation billed."3a9d5e71-c4b2-4f08-b6d3-e8a1070c5f92"
items[].org_namestringName of the organisation billed."Alma Outdoor LLP"
items[].period_startstring (date)даFirst day of the period."2026-09-01"
items[].period_endstring (date)даLast day of the period."2026-09-30"
items[].statusstringдаWhether the period is still accruing. open, closed
items[].closed_atstring | nullWhen the period was closed; null while it is open."2026-10-02T09:00:00+05:00"
items[].total_kztstringдаTotal of the period in tenge, as a decimal string."1250000.00"
items[].vat_kztstringдаVAT on the total in tenge, as a decimal string."150000.00"
items[].statementsintegerNumber of statements issued for the period.2

Пример

{
  "items": [
    {
      "id": "0b1c3a52-6f0e-4c2e-9d3a-2f5d1e7a9c10",
      "org_id": "3a9d5e71-c4b2-4f08-b6d3-e8a1070c5f92",
      "org_name": "Alma Outdoor LLP",
      "period_start": "2026-09-01",
      "period_end": "2026-09-30",
      "status": "open",
      "closed_at": "2026-10-02T09:00:00+05:00",
      "total_kzt": "1250000.00",
      "vat_kzt": "150000.00",
      "statements": 2
    }
  ]
}

Ошибки

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

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

Примеры кода

curl

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

response = requests.get(
    "https://app.tanba-ooh.kz/api/v1/billing/periods",
    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/periods", 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))
}