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.
Аутентификация
Authorization тақырыбындағы API кілті немесе консоль сеансы.
Рұқсат: read:billing
Жауаптар
200 Periods, newest first.
application/json
| Атауы | Түрі | Міндетті | Сипаттама | Мысал |
|---|---|---|---|---|
items | array of BillingPeriod | иә | Periods, newest first. | |
items[].id | string (uuid) | иә | Identifier of the billing period. | "0b1c3a52-6f0e-4c2e-9d3a-2f5d1e7a9c10" |
items[].org_id | string (uuid) | иә | Identifier of the organisation billed. | "3a9d5e71-c4b2-4f08-b6d3-e8a1070c5f92" |
items[].org_name | string | Name of the organisation billed. | "Alma Outdoor LLP" | |
items[].period_start | string (date) | иә | First day of the period. | "2026-09-01" |
items[].period_end | string (date) | иә | Last day of the period. | "2026-09-30" |
items[].status | string | иә | Whether the period is still accruing. open, closed | |
items[].closed_at | string | null | When the period was closed; null while it is open. | "2026-10-02T09:00:00+05:00" | |
items[].total_kzt | string | иә | Total of the period in tenge, as a decimal string. | "1250000.00" |
items[].vat_kzt | string | иә | VAT on the total in tenge, as a decimal string. | "150000.00" |
items[].statements | integer | Number 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 | No valid session or API key (unauthenticated, session_expired, invalid_api_key). |
| 403 | The role or the key's scope does not allow this (forbidden, key_scope_denied, key_route_denied). |
| default | An error as a problem document. |
Код мысалдары
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))
}