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

Evidence pack of one bill line

GET /api/v1/billing/accruals/{id}/evidence

https://app.tanba-ooh.kz/api/v1/billing/accruals/{id}/evidence

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

Scope read:billing. Own organisation; the authority and the platform see all. Without format=zip the answer is a summary of the pack: what it holds and whether a signed pack of exactly this content is stored. With format=zip (or Accept: application/zip) the answer is the pack itself, tanba.evidence/1: a manifest signed with the status key, the telemetry batches behind the line exactly as the devices sent them, the keys that signed them, the daily seals and the approval envelopes. Check it offline with tanba-verify evidence PACK.zip --ca root.pem. A pack never changes: asking again for an unchanged line returns the stored pack, and a change (a new seal, for example) is stored as the next version. Every download is entered in the audit log.

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

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

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

Параметры

ИмяГдеТипОбязательныйОписаниеПример
idпутьinteger (int64)даIdentifier of the bill line (id of a line of the billing period).4711
formatзапросstringнетSet to zip to download the pack instead of reading its summary. zipzip

Ответы

200 The summary, or the pack as a zip file.

application/json

EvidenceSummary

ИмяТипОбязательныйОписаниеПример
kindstringдаWhat the pack is about. accrual, statement, window, dispute
keystringдаStable name of the subject; a new version of a pack keeps it."accrual:4711"
stored_versioninteger | nullдаVersion of the stored pack with exactly this content, or null when the next download will create it.1
stored_pack_idstring | null (uuid)даIdentifier of that stored pack, or null."7d1f0e5a-2b9c-4c63-8a4d-5e0f6b3c9a12"
batchesintegerдаTelemetry batches in the pack.2
playsinteger (int64)даPlays those batches added in the hours the pack covers.9
sealsintegerдаDaily seals in the pack.1
batches_sealedintegerдаBatches whose receive day is sealed.2
linesarray of objectдаThe bill lines the pack explains; empty for a structure period.
lines[].accrual_idinteger (int64)даIdentifier of the bill line.4711
lines[].source_refstringдаStructure and hours of the line."S-001 2026-10-05T10..2026-10-20T11"
lines[].structurestringдаStructure code."S-001"
lines[].playsinteger (int64)даPlays billed on the line.3739
lines[].unitsstringдаBilling units with three decimals."3739.000"
lines[].amount_kztstringдаLine amount in tenge, without VAT."1869.50"
lines[].trueupbooleanдаTrue for a line that bills late plays of an earlier month; it is not recomputed from its own hours.false
lines[].partialstringдаWhy the batches behind the line cannot all be recounted; empty when they can.""
partialarray of stringдаWhat cannot be fully recounted, in words; empty for a complete pack.[]
manifest_sha256stringдаSHA-256 of the manifest in hex."9f2c1b7a4e6d8053a1c2b3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f60718"
downloadstringдаAddress that downloads the pack."/api/v1/billing/accruals/4711/evidence?format=zip"
count_rulestringда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Нет действительной сессии или ключа API (unauthenticated, session_expired, invalid_api_key).
403Роль или право ключа этого не допускает (forbidden, key_scope_denied, key_route_denied).
404Ничего нет или вызывающему это не видно.
409The line is not a play line and has no evidence.
503The signing service is not available.
defaultОшибка в виде документа problem.

Примеры кода

curl

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

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