Drill-down from one payer to its periods, documents and accrual lines
GET /api/v1/billing/reports/payers/{id}
https://app.tanba-ooh.kz/api/v1/billing/reports/payers/{id}
Технический текст справочника написан на английском.
Scope read:billing. The source of a line is its reference - an approval number, or a structure code with the hours of the plays.
Аутентификация
Ключ API в заголовке Authorization или сессия консоли.
Право доступа: read:billing
Параметры
| Имя | Где | Тип | Обязательный | Описание | Пример |
|---|---|---|---|---|---|
id | путь | string (uuid) | да | Identifier of the payer. | 3a9d5e71-c4b2-4f08-b6d3-e8a1070c5f92 |
Ответы
200 The payer with its periods.
application/json
| Имя | Тип | Обязательный | Описание | Пример |
|---|---|---|---|---|
payer | object | да | The payer. | |
periods | array of object | да | The periods of the payer with their documents and accrual lines. |
Пример
{
"payer": {},
"periods": [
{}
]
}
Ошибки
Ошибки приходят документом problem (application/problem+json) со стабильным полем code.
| Статус | Значение |
|---|---|
| 401 | Нет действительной сессии или ключа API (unauthenticated, session_expired, invalid_api_key). |
| 403 | Роль или право ключа этого не допускает (forbidden, key_scope_denied, key_route_denied). |
| 404 | Ничего нет или вызывающему это не видно. |
| default | Ошибка в виде документа problem. |
Примеры кода
curl
curl 'https://app.tanba-ooh.kz/api/v1/billing/reports/payers/3a9d5e71-c4b2-4f08-b6d3-e8a1070c5f92' \
-H 'Authorization: Bearer YOUR_API_KEY'
Python
import requests
response = requests.get(
"https://app.tanba-ooh.kz/api/v1/billing/reports/payers/3a9d5e71-c4b2-4f08-b6d3-e8a1070c5f92",
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/payers/3a9d5e71-c4b2-4f08-b6d3-e8a1070c5f92", 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))
}