Evidence pack of a statement
GET /api/v1/billing/statements/{id}/evidence
https://app.tanba-ooh.kz/api/v1/billing/statements/{id}/evidence
Анықтамалықтың техникалық мәтіні ағылшын тілінде жазылған.
Scope read:billing. Own organisation; the authority and the platform see all. The pack of every play line of the period the statement belongs to; see the evidence pack of a bill line for the content, the summary and the rules (immutable packs, a new version on change, every download audited).
Аутентификация
Authorization тақырыбындағы API кілті немесе консоль сеансы.
Рұқсат: read:billing
Параметрлер
| Атауы | Орны | Түрі | Міндетті | Сипаттама | Мысал |
|---|---|---|---|---|---|
id | жол | string (uuid) | иә | Identifier of the statement. | 3f2b8c1e-6a47-4d0e-9b55-2c7d1a8e4f90 |
format | сұрау | string | жоқ | Set to zip to download the pack instead of reading its summary. zip | zip |
Жауаптар
200 The summary, or the pack as a zip file.
application/json
EvidenceSummary
| Атауы | Түрі | Міндетті | Сипаттама | Мысал |
|---|---|---|---|---|
kind | string | иә | What the pack is about. accrual, statement, window, dispute | |
key | string | иә | Stable name of the subject; a new version of a pack keeps it. | "accrual:4711" |
stored_version | integer | null | иә | Version of the stored pack with exactly this content, or null when the next download will create it. | 1 |
stored_pack_id | string | null (uuid) | иә | Identifier of that stored pack, or null. | "7d1f0e5a-2b9c-4c63-8a4d-5e0f6b3c9a12" |
batches | integer | иә | Telemetry batches in the pack. | 2 |
plays | integer (int64) | иә | Plays those batches added in the hours the pack covers. | 9 |
seals | integer | иә | Daily seals in the pack. | 1 |
batches_sealed | integer | иә | Batches whose receive day is sealed. | 2 |
lines | array of object | иә | The bill lines the pack explains; empty for a structure period. | |
lines[].accrual_id | integer (int64) | иә | Identifier of the bill line. | 4711 |
lines[].source_ref | string | иә | Structure and hours of the line. | "S-001 2026-10-05T10..2026-10-20T11" |
lines[].structure | string | иә | Structure code. | "S-001" |
lines[].plays | integer (int64) | иә | Plays billed on the line. | 3739 |
lines[].units | string | иә | Billing units with three decimals. | "3739.000" |
lines[].amount_kzt | string | иә | Line amount in tenge, without VAT. | "1869.50" |
lines[].trueup | boolean | иә | True for a line that bills late plays of an earlier month; it is not recomputed from its own hours. | false |
lines[].partial | string | иә | Why the batches behind the line cannot all be recounted; empty when they can. | "" |
partial | array of string | иә | What cannot be fully recounted, in words; empty for a complete pack. | [] |
manifest_sha256 | string | иә | SHA-256 of the manifest in hex. | "9f2c1b7a4e6d8053a1c2b3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718" |
download | string | иә | Address that downloads the pack. | "/api/v1/billing/accruals/4711/evidence?format=zip" |
count_rule | string | иә | Version of the counting rule the pack was made with. | "tanba.count/1" |
Мысал
{
"kind": "accrual",
"key": "accrual:4711",
"stored_version": 1,
"stored_pack_id": "7d1f0e5a-2b9c-4c63-8a4d-5e0f6b3c9a12",
"batches": 2,
"plays": 9,
"seals": 1,
"batches_sealed": 2,
"lines": [
{
"accrual_id": 4711,
"source_ref": "S-001 2026-10-05T10..2026-10-20T11",
"structure": "S-001",
"plays": 3739,
"units": "3739.000",
"amount_kzt": "1869.50",
"trueup": false,
"partial": ""
}
],
"partial": [],
"manifest_sha256": "9f2c1b7a4e6d8053a1c2b3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718",
"download": "/api/v1/billing/accruals/4711/evidence?format=zip",
"count_rule": "tanba.count/1"
}
application/zip
Қателер
Қателер 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). |
| 404 | Nothing there, or not visible to the caller. |
| 409 | The period has no play lines. |
| 503 | The signing service is not available. |
| default | An error as a problem document. |
Код мысалдары
curl
curl 'https://app.tanba-ooh.kz/api/v1/billing/statements/3f2b8c1e-6a47-4d0e-9b55-2c7d1a8e4f90/evidence' \
-H 'Authorization: Bearer YOUR_API_KEY'
Python
import requests
response = requests.get(
"https://app.tanba-ooh.kz/api/v1/billing/statements/3f2b8c1e-6a47-4d0e-9b55-2c7d1a8e4f90/evidence",
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/statements/3f2b8c1e-6a47-4d0e-9b55-2c7d1a8e4f90/evidence", 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))
}