Товари
Що продає організація: товари та послуги, їхні групи й ціни. Товар може мати кілька цін, одну з них можна зробити основною.
Купони
GET /coupons
Купони організації сторінками (limit, cursor) за назвою, чинні або архівні (archived); q знаходить купони, у назві яких є ці літери або код яких із них починається, без урахування регістру. У кожного — знижка, обмеження, товари й групи (appliesTo, null — уся угода), скільки живих угод тримають його зараз (uses) і чи застосовували його хоч раз (used). Читає роль із розділом «Угоди» або сторінкою «Товари».
Параметри запиту
archivedbooleanтипово
falsecursorstringдовжина 1–512
limitinteger1–100 · типово
50qstringдовжина ≤ 100
Приклад запиту
curl 'https://your-company.altahub.ai/api/v1/coupons' \
-H 'Authorization: Bearer alta_…'const response = await fetch('https://your-company.altahub.ai/api/v1/coupons', {
method: 'GET',
headers: {
Authorization: 'Bearer alta_…',
},
});
const data = await response.json();import requests
response = requests.get(
"https://your-company.altahub.ai/api/v1/coupons",
headers={"Authorization": "Bearer alta_…"},
)
data = response.json()<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://your-company.altahub.ai/api/v1/coupons', [
'headers' => ['Authorization' => 'Bearer alta_…'],
]);
$data = json_decode((string) $response->getBody(), true);Відповідь 200
Успішна відповідь.
{
"items": [
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000a01",
"name": "Black Friday",
"code": "BF2026",
"discount": {
"type": "amount",
"value": "1000.00"
},
"currency": "UAH",
"validUntil": "2026-11-30",
"oncePerClient": true,
"maxUses": 100,
"uses": 12,
"used": true,
"minimumAmount": "20000.00",
"appliesTo": null,
"archived": false,
"version": 2,
"createdAt": "2026-10-20T08:15:00Z"
},
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000a02",
"name": "Service −10 %",
"code": null,
"discount": {
"type": "percent",
"value": "10.00"
},
"currency": null,
"validUntil": null,
"oncePerClient": false,
"maxUses": null,
"uses": 0,
"used": false,
"minimumAmount": null,
"appliesTo": {
"productIds": [
"0192f3a1-7c2e-7b4d-9a61-000000000067"
],
"categoryIds": [],
"items": [
{
"kind": "product",
"id": "0192f3a1-7c2e-7b4d-9a61-000000000067",
"name": "Сервіс кавомашини на рік"
}
]
},
"archived": false,
"version": 1,
"createdAt": "2026-10-24T16:45:00Z"
}
],
"nextCursor": null
}Поля відповіді
itemsobject[]Вкладені поля: 15
appliesToobject | nullВкладені поля: 3
categoryIdsstring[] · uuiditemsobject[]Вкладені поля: 3
idstring · uuidkindstringЗначення:
productcategorynamestring
productIdsstring[] · uuid
archivedbooleancodestring | nullcreatedAtstring · date-timecurrencystring | nullшаблон
^[A-Z]{3}$discountobjectВкладені поля: 2
typestringA percentage of what is left of the deal (`percent`) or an amount of the coupon’s currency (`amount`)
Значення:
percentamountvaluestringшаблон
^[0-9]+\.[0-9]{2}$
idstring · uuidmaxUsesinteger | null≥ 1
minimumAmountstring | nullшаблон
^[0-9]+\.[0-9]{2}$namestringoncePerClientbooleanusedbooleanusesinteger≥ 0
validUntilstring · date | nullversioninteger≥ 1
nextCursorstring | null
Створити купон
POST /coupons
Потрібна сторінка «Товари» в ролі. Назва, необовʼязковий код (латинські літери, цифри, «-», «_»; зайнятий чинним купоном без урахування регістру — 409 NAME_TAKEN), знижка: percent — відсоток від того, що лишилося від угоди (більше 0, не більше 100), або amount — сума в currency, яка розкладається по рядках. Обмеження: validUntil — останній день, коли купон можна застосувати (за календарем організації), oncePerClient — одна жива угода на клієнта (контакт угоди), maxUses — не більше стількох живих угод одразу, minimumAmount — сума товарів угоди зі знижками в рядках від цієї суми (у currency), appliesTo — лише ці товари й групи. currency потрібна для суми й мінімуму. Повтор із тим самим idempotencyKey після втраченої відповіді поверне той самий купон.
Тіло запиту
discountobject обов’язковоВкладені поля: 2
typestring обов’язковоA percentage of what is left of the deal (`percent`) or an amount of the coupon’s currency (`amount`)
Значення:
percentamountvaluestring | number обов’язковошаблон
^[0-9]{1,12}(\.[0-9]{1,2})?$· 0–999999999999.99
namestring обов’язководовжина 1–100 · шаблон
\SappliesToobject | nullВкладені поля: 2
categoryIdsstring[] · uuidкількість ≤ 100 · без повторів
productIdsstring[] · uuidкількість ≤ 100 · без повторів
codestring | nullшаблон
^[A-Za-z0-9_-]{1,40}$currencystring | nullшаблон
^[A-Z]{3}$idempotencyKeystringшаблон
^[\x21-\x7e]{1,255}$maxUsesinteger | null1–1000000
minimumAmountstring | number | nullшаблон
^[0-9]{1,12}(\.[0-9]{1,2})?$· 0–999999999999.99oncePerClientbooleanvalidUntilstring · date | null
Приклад запиту
curl -X POST 'https://your-company.altahub.ai/api/v1/coupons' \
-H 'Authorization: Bearer alta_…' \
-H 'Content-Type: application/json' \
-d '{
"name": "Service −10 %",
"discount": {
"type": "percent",
"value": "10"
},
"appliesTo": {
"productIds": [
"0192f3a1-7c2e-7b4d-9a61-000000000067"
]
}
}'const response = await fetch('https://your-company.altahub.ai/api/v1/coupons', {
method: 'POST',
headers: {
Authorization: 'Bearer alta_…',
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Service −10 %',
discount: {
type: 'percent',
value: '10',
},
appliesTo: {
productIds: [
'0192f3a1-7c2e-7b4d-9a61-000000000067',
],
},
}),
});
const data = await response.json();import requests
response = requests.post(
"https://your-company.altahub.ai/api/v1/coupons",
headers={"Authorization": "Bearer alta_…"},
json={
"name": "Service −10 %",
"discount": {
"type": "percent",
"value": "10",
},
"appliesTo": {
"productIds": [
"0192f3a1-7c2e-7b4d-9a61-000000000067",
],
},
},
)
data = response.json()<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://your-company.altahub.ai/api/v1/coupons', [
'headers' => ['Authorization' => 'Bearer alta_…'],
'json' => [
'name' => 'Service −10 %',
'discount' => [
'type' => 'percent',
'value' => '10',
],
'appliesTo' => [
'productIds' => [
'0192f3a1-7c2e-7b4d-9a61-000000000067',
],
],
],
]);
$data = json_decode((string) $response->getBody(), true);Відповідь 201
Успішна відповідь.
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000a02",
"name": "Service −10 %",
"code": null,
"discount": {
"type": "percent",
"value": "10.00"
},
"currency": null,
"validUntil": null,
"oncePerClient": false,
"maxUses": null,
"uses": 0,
"used": false,
"minimumAmount": null,
"appliesTo": {
"productIds": [
"0192f3a1-7c2e-7b4d-9a61-000000000067"
],
"categoryIds": [],
"items": [
{
"kind": "product",
"id": "0192f3a1-7c2e-7b4d-9a61-000000000067",
"name": "Сервіс кавомашини на рік"
}
]
},
"archived": false,
"version": 1,
"createdAt": "2026-10-24T16:45:00Z"
}Поля відповіді
appliesToobject | nullВкладені поля: 3
categoryIdsstring[] · uuiditemsobject[]Вкладені поля: 3
idstring · uuidkindstringЗначення:
productcategorynamestring
productIdsstring[] · uuid
archivedbooleancodestring | nullcreatedAtstring · date-timecurrencystring | nullшаблон
^[A-Z]{3}$discountobjectВкладені поля: 2
typestringA percentage of what is left of the deal (`percent`) or an amount of the coupon’s currency (`amount`)
Значення:
percentamountvaluestringшаблон
^[0-9]+\.[0-9]{2}$
idstring · uuidmaxUsesinteger | null≥ 1
minimumAmountstring | nullшаблон
^[0-9]+\.[0-9]{2}$namestringoncePerClientbooleanusedbooleanusesinteger≥ 0
validUntilstring · date | nullversioninteger≥ 1
Отримати купон
GET /coupons/{couponId}
Один купон, чинний або архівний; купон іншої організації — 404.
Параметри шляху
couponIdstring · uuid обов’язково
Приклад запиту
curl 'https://your-company.altahub.ai/api/v1/coupons/{couponId}' \
-H 'Authorization: Bearer alta_…'const response = await fetch('https://your-company.altahub.ai/api/v1/coupons/{couponId}', {
method: 'GET',
headers: {
Authorization: 'Bearer alta_…',
},
});
const data = await response.json();import requests
response = requests.get(
"https://your-company.altahub.ai/api/v1/coupons/{couponId}",
headers={"Authorization": "Bearer alta_…"},
)
data = response.json()<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://your-company.altahub.ai/api/v1/coupons/{couponId}', [
'headers' => ['Authorization' => 'Bearer alta_…'],
]);
$data = json_decode((string) $response->getBody(), true);Відповідь 200
Успішна відповідь.
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000a01",
"name": "Black Friday",
"code": "BF2026",
"discount": {
"type": "amount",
"value": "1000.00"
},
"currency": "UAH",
"validUntil": "2026-11-30",
"oncePerClient": true,
"maxUses": 100,
"uses": 12,
"used": true,
"minimumAmount": "20000.00",
"appliesTo": null,
"archived": false,
"version": 2,
"createdAt": "2026-10-20T08:15:00Z"
}Поля — як у відповіді Створити купон
Змінити купон
PATCH /coupons/{couponId}
Назва й код (null — без коду) змінюються завжди; знижка й обмеження — доки купон жодного разу не застосовували, інакше 409 coupon_used: інша знижка — новий купон (ті самі умови, надіслані назад, нічого не змінюють). Поле, якого не надіслали, лишається. З version, яку ви прочитали: купон встигли змінити — 409.
Параметри шляху
couponIdstring · uuid обов’язково
Тіло запиту
appliesToobject | nullВкладені поля: 2
categoryIdsstring[] · uuidкількість ≤ 100 · без повторів
productIdsstring[] · uuidкількість ≤ 100 · без повторів
codestring | nullшаблон
^[A-Za-z0-9_-]{1,40}$currencystring | nullшаблон
^[A-Z]{3}$discountobjectВкладені поля: 2
typestring обов’язковоA percentage of what is left of the deal (`percent`) or an amount of the coupon’s currency (`amount`)
Значення:
percentamountvaluestring | number обов’язковошаблон
^[0-9]{1,12}(\.[0-9]{1,2})?$· 0–999999999999.99
maxUsesinteger | null1–1000000
minimumAmountstring | number | nullшаблон
^[0-9]{1,12}(\.[0-9]{1,2})?$· 0–999999999999.99namestringдовжина 1–100 · шаблон
\SoncePerClientbooleanvalidUntilstring · date | nullversioninteger≥ 1
Приклад запиту
curl -X PATCH 'https://your-company.altahub.ai/api/v1/coupons/{couponId}' \
-H 'Authorization: Bearer alta_…' \
-H 'Content-Type: application/json' \
-d '{
"name": "Black Friday 2026"
}'const response = await fetch('https://your-company.altahub.ai/api/v1/coupons/{couponId}', {
method: 'PATCH',
headers: {
Authorization: 'Bearer alta_…',
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Black Friday 2026',
}),
});
const data = await response.json();import requests
response = requests.patch(
"https://your-company.altahub.ai/api/v1/coupons/{couponId}",
headers={"Authorization": "Bearer alta_…"},
json={
"name": "Black Friday 2026",
},
)
data = response.json()<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('PATCH', 'https://your-company.altahub.ai/api/v1/coupons/{couponId}', [
'headers' => ['Authorization' => 'Bearer alta_…'],
'json' => [
'name' => 'Black Friday 2026',
],
]);
$data = json_decode((string) $response->getBody(), true);Відповідь 200
Успішна відповідь.
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000a01",
"name": "Black Friday 2026",
"code": "BF2026",
"discount": {
"type": "amount",
"value": "1000.00"
},
"currency": "UAH",
"validUntil": "2026-11-30",
"oncePerClient": true,
"maxUses": 100,
"uses": 12,
"used": true,
"minimumAmount": "20000.00",
"appliesTo": null,
"archived": false,
"version": 3,
"createdAt": "2026-10-20T08:15:00Z"
}Поля — як у відповіді Створити купон
Видалити купон
DELETE /coupons/{couponId}
Лише купон, який жодного разу не застосовували; застосований — 409 coupon_used: надішліть його в архів.
Параметри шляху
couponIdstring · uuid обов’язково
Приклад запиту
curl -X DELETE 'https://your-company.altahub.ai/api/v1/coupons/{couponId}' \
-H 'Authorization: Bearer alta_…'const response = await fetch('https://your-company.altahub.ai/api/v1/coupons/{couponId}', {
method: 'DELETE',
headers: {
Authorization: 'Bearer alta_…',
},
});
const data = await response.json();import requests
response = requests.delete(
"https://your-company.altahub.ai/api/v1/coupons/{couponId}",
headers={"Authorization": "Bearer alta_…"},
)
data = response.json()<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('DELETE', 'https://your-company.altahub.ai/api/v1/coupons/{couponId}', [
'headers' => ['Authorization' => 'Bearer alta_…'],
]);
$data = json_decode((string) $response->getBody(), true);Відповідь 200
Успішна відповідь.
{
"deleted": true
}Поля відповіді
deletedbooleanЗначення:
true
Купон в архів
POST /coupons/{couponId}/archive
Купон більше не застосовується до угод; угоди, де він стоїть, його зберігають; його код може взяти інший купон. Архівний ще раз нічого не змінює.
Параметри шляху
couponIdstring · uuid обов’язково
Приклад запиту
curl -X POST 'https://your-company.altahub.ai/api/v1/coupons/{couponId}/archive' \
-H 'Authorization: Bearer alta_…' \
-H 'Content-Type: application/json' \
-d '{}'const response = await fetch('https://your-company.altahub.ai/api/v1/coupons/{couponId}/archive', {
method: 'POST',
headers: {
Authorization: 'Bearer alta_…',
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
});
const data = await response.json();import requests
response = requests.post(
"https://your-company.altahub.ai/api/v1/coupons/{couponId}/archive",
headers={"Authorization": "Bearer alta_…"},
json={},
)
data = response.json()<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://your-company.altahub.ai/api/v1/coupons/{couponId}/archive', [
'headers' => ['Authorization' => 'Bearer alta_…'],
'json' => new \stdClass(),
]);
$data = json_decode((string) $response->getBody(), true);Відповідь 200
Успішна відповідь.
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000a01",
"name": "Black Friday",
"code": "BF2026",
"discount": {
"type": "amount",
"value": "1000.00"
},
"currency": "UAH",
"validUntil": "2026-11-30",
"oncePerClient": true,
"maxUses": 100,
"uses": 12,
"used": true,
"minimumAmount": "20000.00",
"appliesTo": null,
"archived": true,
"version": 3,
"createdAt": "2026-10-20T08:15:00Z"
}Поля — як у відповіді Створити купон
Повернути купон з архіву
POST /coupons/{couponId}/restore
Поки купон був в архіві, його код узяв інший чинний купон — 409 NAME_TAKEN. Чинний ще раз нічого не змінює.
Параметри шляху
couponIdstring · uuid обов’язково
Приклад запиту
curl -X POST 'https://your-company.altahub.ai/api/v1/coupons/{couponId}/restore' \
-H 'Authorization: Bearer alta_…' \
-H 'Content-Type: application/json' \
-d '{}'const response = await fetch('https://your-company.altahub.ai/api/v1/coupons/{couponId}/restore', {
method: 'POST',
headers: {
Authorization: 'Bearer alta_…',
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
});
const data = await response.json();import requests
response = requests.post(
"https://your-company.altahub.ai/api/v1/coupons/{couponId}/restore",
headers={"Authorization": "Bearer alta_…"},
json={},
)
data = response.json()<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://your-company.altahub.ai/api/v1/coupons/{couponId}/restore', [
'headers' => ['Authorization' => 'Bearer alta_…'],
'json' => new \stdClass(),
]);
$data = json_decode((string) $response->getBody(), true);Відповідь 200
Успішна відповідь.
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000a01",
"name": "Black Friday",
"code": "BF2026",
"discount": {
"type": "amount",
"value": "1000.00"
},
"currency": "UAH",
"validUntil": "2026-11-30",
"oncePerClient": true,
"maxUses": 100,
"uses": 12,
"used": true,
"minimumAmount": "20000.00",
"appliesTo": null,
"archived": false,
"version": 4,
"createdAt": "2026-10-20T08:15:00Z"
}Поля — як у відповіді Створити купон
Групи товарів
GET /product-categories
Групи товарів організації за назвою (не більше 200). Читає роль із розділом «Угоди» або сторінкою «Товари».
Приклад запиту
curl 'https://your-company.altahub.ai/api/v1/product-categories' \
-H 'Authorization: Bearer alta_…'const response = await fetch('https://your-company.altahub.ai/api/v1/product-categories', {
method: 'GET',
headers: {
Authorization: 'Bearer alta_…',
},
});
const data = await response.json();import requests
response = requests.get(
"https://your-company.altahub.ai/api/v1/product-categories",
headers={"Authorization": "Bearer alta_…"},
)
data = response.json()<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://your-company.altahub.ai/api/v1/product-categories', [
'headers' => ['Authorization' => 'Bearer alta_…'],
]);
$data = json_decode((string) $response->getBody(), true);Відповідь 200
Успішна відповідь.
{
"items": [
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000064",
"name": "Кавомашини",
"version": 1
},
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000065",
"name": "Сервіс",
"version": 1
}
]
}Поля відповіді
itemsobject[]Вкладені поля: 3
idstring · uuidnamestringversioninteger≥ 1
Створити групу товарів
POST /product-categories
Назва унікальна в організації без урахування регістру: зайнята — 409 NAME_TAKEN. Потрібна сторінка «Товари» в ролі. Повтор з тим самим idempotencyKey після втраченої відповіді поверне вже створену групу.
Тіло запиту
namestring обов’язководовжина 1–60 · шаблон
\SidempotencyKeystringшаблон
^[\x21-\x7e]{1,255}$
Приклад запиту
curl -X POST 'https://your-company.altahub.ai/api/v1/product-categories' \
-H 'Authorization: Bearer alta_…' \
-H 'Content-Type: application/json' \
-d '{
"name": "Кавомашини"
}'const response = await fetch('https://your-company.altahub.ai/api/v1/product-categories', {
method: 'POST',
headers: {
Authorization: 'Bearer alta_…',
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Кавомашини',
}),
});
const data = await response.json();import requests
response = requests.post(
"https://your-company.altahub.ai/api/v1/product-categories",
headers={"Authorization": "Bearer alta_…"},
json={
"name": "Кавомашини",
},
)
data = response.json()<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://your-company.altahub.ai/api/v1/product-categories', [
'headers' => ['Authorization' => 'Bearer alta_…'],
'json' => [
'name' => 'Кавомашини',
],
]);
$data = json_decode((string) $response->getBody(), true);Відповідь 201
Успішна відповідь.
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000064",
"name": "Кавомашини",
"version": 1
}Поля відповіді
idstring · uuidnamestringversioninteger≥ 1
Перейменувати групу товарів
PATCH /product-categories/{categoryId}
З version, яку ви прочитали: групу встигли змінити — 409. Без version нова назва лягає на групу, якою вона є зараз.
Параметри шляху
categoryIdstring · uuid обов’язково
Тіло запиту
namestring обов’язководовжина 1–60 · шаблон
\Sversioninteger≥ 1
Приклад запиту
curl -X PATCH 'https://your-company.altahub.ai/api/v1/product-categories/{categoryId}' \
-H 'Authorization: Bearer alta_…' \
-H 'Content-Type: application/json' \
-d '{
"name": "Кавомашини",
"version": 1
}'const response = await fetch('https://your-company.altahub.ai/api/v1/product-categories/{categoryId}', {
method: 'PATCH',
headers: {
Authorization: 'Bearer alta_…',
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Кавомашини',
version: 1,
}),
});
const data = await response.json();import requests
response = requests.patch(
"https://your-company.altahub.ai/api/v1/product-categories/{categoryId}",
headers={"Authorization": "Bearer alta_…"},
json={
"name": "Кавомашини",
"version": 1,
},
)
data = response.json()<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('PATCH', 'https://your-company.altahub.ai/api/v1/product-categories/{categoryId}', [
'headers' => ['Authorization' => 'Bearer alta_…'],
'json' => [
'name' => 'Кавомашини',
'version' => 1,
],
]);
$data = json_decode((string) $response->getBody(), true);Відповідь 200
Успішна відповідь.
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000064",
"name": "Кавомашини",
"version": 1
}Поля — як у відповіді Створити групу товарів
Видалити групу товарів
DELETE /product-categories/{categoryId}
Лише групу, у якій немає товарів, зокрема архівних: інакше 409 category_in_use — спершу перенесіть товари. Група, на яку націлено купон, — 409 category_in_coupon: спершу приберіть її з купона.
Параметри шляху
categoryIdstring · uuid обов’язково
Приклад запиту
curl -X DELETE 'https://your-company.altahub.ai/api/v1/product-categories/{categoryId}' \
-H 'Authorization: Bearer alta_…'const response = await fetch('https://your-company.altahub.ai/api/v1/product-categories/{categoryId}', {
method: 'DELETE',
headers: {
Authorization: 'Bearer alta_…',
},
});import requests
response = requests.delete(
"https://your-company.altahub.ai/api/v1/product-categories/{categoryId}",
headers={"Authorization": "Bearer alta_…"},
)<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('DELETE', 'https://your-company.altahub.ai/api/v1/product-categories/{categoryId}', [
'headers' => ['Authorization' => 'Bearer alta_…'],
]);Відповідь 204
Успішна відповідь, без тіла.
Товари
GET /products
Товари сторінками (limit, cursor), чинні або архівні (archived). Без q — за групами (групи за назвою, товари без групи в кінці), у групі за назвою. З q — за назвою: товари, у назві чи артикулі яких є слова, що починаються з кожного слова q (до 5 слів від 2 символів або число); збіглося більше 2 000 — сторінки покажуть 2 000 з них і truncated: true, уточніть q. У кожного — чинні ціни та значення власних полів. Суми — у копійках (*Cents).
Параметри запиту
archivedbooleanтипово
falsecursorstringдовжина 1–512
limitinteger1–100 · типово
50qstringдовжина ≤ 200
Приклад запиту
curl 'https://your-company.altahub.ai/api/v1/products' \
-H 'Authorization: Bearer alta_…'const response = await fetch('https://your-company.altahub.ai/api/v1/products', {
method: 'GET',
headers: {
Authorization: 'Bearer alta_…',
},
});
const data = await response.json();import requests
response = requests.get(
"https://your-company.altahub.ai/api/v1/products",
headers={"Authorization": "Bearer alta_…"},
)
data = response.json()<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://your-company.altahub.ai/api/v1/products', [
'headers' => ['Authorization' => 'Bearer alta_…'],
]);
$data = json_decode((string) $response->getBody(), true);Відповідь 200
Успішна відповідь.
{
"items": [
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000066",
"name": "Кавомашина Jura E8",
"code": "JE8-01",
"unit": "шт",
"description": "Автоматична, для зерен і молока",
"categoryId": "0192f3a1-7c2e-7b4d-9a61-000000000064",
"archivedAt": null,
"version": 1,
"prices": [
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000068",
"productId": "0192f3a1-7c2e-7b4d-9a61-000000000066",
"name": "Роздріб",
"currency": "UAH",
"isDefault": true,
"amountCents": 4500000,
"rateId": "0192f3a1-7c2e-7b4d-9a61-00000000006b",
"effectiveFrom": "2026-10-20T08:15:00Z",
"archivedAt": null,
"version": 1
},
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000069",
"productId": "0192f3a1-7c2e-7b4d-9a61-000000000066",
"name": "Опт",
"currency": "UAH",
"isDefault": false,
"amountCents": 4200000,
"rateId": "0192f3a1-7c2e-7b4d-9a61-00000000006c",
"effectiveFrom": "2026-10-20T08:15:00Z",
"archivedAt": null,
"version": 1
}
],
"customFields": []
},
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000067",
"name": "Сервіс кавомашини на рік",
"code": null,
"unit": "рік",
"description": null,
"categoryId": "0192f3a1-7c2e-7b4d-9a61-000000000065",
"archivedAt": null,
"version": 1,
"prices": [
{
"id": "0192f3a1-7c2e-7b4d-9a61-00000000006a",
"productId": "0192f3a1-7c2e-7b4d-9a61-000000000067",
"name": "Роздріб",
"currency": "UAH",
"isDefault": false,
"amountCents": 600000,
"rateId": "0192f3a1-7c2e-7b4d-9a61-00000000006d",
"effectiveFrom": "2026-10-20T08:15:00Z",
"archivedAt": null,
"version": 1
}
],
"customFields": []
}
],
"nextCursor": null,
"truncated": false
}Поля відповіді
itemsobject[]Вкладені поля: 11
archivedAtstring · date-time | nullcategoryIdstring · uuid | nullcodestring | nullcustomFieldsobject[]Вкладені поля: 2
fieldIdstring · uuidvaluestring | boolean | string[] · uuid | objectВаріант 1 · string
string
Варіант 2 · boolean
boolean
Варіант 3 · string[] · uuid
string[] · uuid
Варіант 4 · object
amountstringcurrencystring
Варіант 5 · object
citystringcountrystringlinestringpostcodestring
descriptionstring | nullidstring · uuidnamestringpricesobject[]Вкладені поля: 10
amountCentsinteger0–9007199254740991
archivedAtstring · date-time | nullcurrencystringeffectiveFromstring · date-timeidstring · uuidisDefaultbooleannamestringproductIdstring · uuidrateIdstring · uuidversioninteger≥ 1
unitstring | nullversioninteger≥ 1
taxRateIdstring · uuid | null
nextCursorstring | nulltruncatedboolean
Створити товар
POST /products
Досить назви. Артикул (code) необов’язковий і унікальний серед чинних товарів без урахування регістру: зайнятий — 409 NAME_TAKEN у /body/code. Назви не унікальні. Одразу можна передати до 20 цін (prices), жодна з них не стає основною (основну позначають у зміні ціни); без цін теж можна, якщо ви рахуєте ціну в кожній угоді. Повтор з тим самим idempotencyKey після втраченої відповіді поверне вже створений товар, той самий ключ з іншими даними — 409 idempotency_key_reused.
Тіло запиту
namestring обов’язководовжина 1–200 · шаблон
\ScategoryIdstring · uuid | nullcodestring | nullдовжина ≤ 60
customFieldsobject[]кількість ≤ 100
Вкладені поля: 2
fieldIdstring · uuid обов’язковоvaluestring | boolean | string[] · uuid | object | null обов’язковоВаріант 1 · string
string
Варіант 2 · boolean
boolean
Варіант 3 · string[] · uuid
string[] · uuid
Варіант 4 · object
amountstring обов’язководовжина ≤ 40
currencystring обов’язководовжина ≤ 3
Варіант 5 · object
citystring | nullдовжина ≤ 200
countrystring | nullдовжина ≤ 200
linestring | nullдовжина ≤ 600
postcodestring | nullдовжина ≤ 40
descriptionstring | nullдовжина ≤ 1000
idempotencyKeystringшаблон
^[\x21-\x7e]{1,255}$pricesobject[]кількість ≤ 20
Вкладені поля: 3
amountCentsinteger обов’язково0–9007199254740991
currencystring обов’язковошаблон
^[A-Z]{3}$namestring обов’язководовжина 1–60 · шаблон
\S
taxRateIdstring · uuid | nullunitstring | nullдовжина ≤ 20
Приклад запиту
curl -X POST 'https://your-company.altahub.ai/api/v1/products' \
-H 'Authorization: Bearer alta_…' \
-H 'Content-Type: application/json' \
-d '{
"name": "Кавомашина Jura E8",
"code": "JE8-01",
"unit": "шт",
"description": "Автоматична, для зерен і молока",
"categoryId": "0192f3a1-7c2e-7b4d-9a61-000000000064",
"prices": [
{
"name": "Роздріб",
"currency": "UAH",
"amountCents": 4500000
},
{
"name": "Опт",
"currency": "UAH",
"amountCents": 4200000
}
]
}'const response = await fetch('https://your-company.altahub.ai/api/v1/products', {
method: 'POST',
headers: {
Authorization: 'Bearer alta_…',
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Кавомашина Jura E8',
code: 'JE8-01',
unit: 'шт',
description: 'Автоматична, для зерен і молока',
categoryId: '0192f3a1-7c2e-7b4d-9a61-000000000064',
prices: [
{
name: 'Роздріб',
currency: 'UAH',
amountCents: 4500000,
},
{
name: 'Опт',
currency: 'UAH',
amountCents: 4200000,
},
],
}),
});
const data = await response.json();import requests
response = requests.post(
"https://your-company.altahub.ai/api/v1/products",
headers={"Authorization": "Bearer alta_…"},
json={
"name": "Кавомашина Jura E8",
"code": "JE8-01",
"unit": "шт",
"description": "Автоматична, для зерен і молока",
"categoryId": "0192f3a1-7c2e-7b4d-9a61-000000000064",
"prices": [
{
"name": "Роздріб",
"currency": "UAH",
"amountCents": 4500000,
},
{
"name": "Опт",
"currency": "UAH",
"amountCents": 4200000,
},
],
},
)
data = response.json()<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://your-company.altahub.ai/api/v1/products', [
'headers' => ['Authorization' => 'Bearer alta_…'],
'json' => [
'name' => 'Кавомашина Jura E8',
'code' => 'JE8-01',
'unit' => 'шт',
'description' => 'Автоматична, для зерен і молока',
'categoryId' => '0192f3a1-7c2e-7b4d-9a61-000000000064',
'prices' => [
[
'name' => 'Роздріб',
'currency' => 'UAH',
'amountCents' => 4500000,
],
[
'name' => 'Опт',
'currency' => 'UAH',
'amountCents' => 4200000,
],
],
],
]);
$data = json_decode((string) $response->getBody(), true);Відповідь 201
Успішна відповідь.
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000066",
"name": "Кавомашина Jura E8",
"code": "JE8-01",
"unit": "шт",
"description": "Автоматична, для зерен і молока",
"categoryId": "0192f3a1-7c2e-7b4d-9a61-000000000064",
"archivedAt": null,
"version": 1,
"prices": [
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000069",
"productId": "0192f3a1-7c2e-7b4d-9a61-000000000066",
"name": "Опт",
"currency": "UAH",
"isDefault": false,
"amountCents": 4200000,
"rateId": "0192f3a1-7c2e-7b4d-9a61-00000000006c",
"effectiveFrom": "2026-10-20T08:15:00Z",
"archivedAt": null,
"version": 1
},
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000068",
"productId": "0192f3a1-7c2e-7b4d-9a61-000000000066",
"name": "Роздріб",
"currency": "UAH",
"isDefault": false,
"amountCents": 4500000,
"rateId": "0192f3a1-7c2e-7b4d-9a61-00000000006b",
"effectiveFrom": "2026-10-20T08:15:00Z",
"archivedAt": null,
"version": 1
}
],
"customFields": []
}Поля відповіді
archivedAtstring · date-time | nullcategoryIdstring · uuid | nullcodestring | nullcustomFieldsobject[]Вкладені поля: 2
fieldIdstring · uuidvaluestring | boolean | string[] · uuid | objectВаріант 1 · string
string
Варіант 2 · boolean
boolean
Варіант 3 · string[] · uuid
string[] · uuid
Варіант 4 · object
amountstringcurrencystring
Варіант 5 · object
citystringcountrystringlinestringpostcodestring
descriptionstring | nullidstring · uuidnamestringpricesobject[]Вкладені поля: 10
amountCentsinteger0–9007199254740991
archivedAtstring · date-time | nullcurrencystringeffectiveFromstring · date-timeidstring · uuidisDefaultbooleannamestringproductIdstring · uuidrateIdstring · uuidversioninteger≥ 1
unitstring | nullversioninteger≥ 1
taxRateIdstring · uuid | null
Отримати товар
GET /products/{productId}
Один товар, чинний або архівний, з цінами та значеннями власних полів.
Параметри шляху
productIdstring · uuid обов’язково
Приклад запиту
curl 'https://your-company.altahub.ai/api/v1/products/{productId}' \
-H 'Authorization: Bearer alta_…'const response = await fetch('https://your-company.altahub.ai/api/v1/products/{productId}', {
method: 'GET',
headers: {
Authorization: 'Bearer alta_…',
},
});
const data = await response.json();import requests
response = requests.get(
"https://your-company.altahub.ai/api/v1/products/{productId}",
headers={"Authorization": "Bearer alta_…"},
)
data = response.json()<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://your-company.altahub.ai/api/v1/products/{productId}', [
'headers' => ['Authorization' => 'Bearer alta_…'],
]);
$data = json_decode((string) $response->getBody(), true);Відповідь 200
Успішна відповідь.
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000066",
"name": "Кавомашина Jura E8",
"code": "JE8-01",
"unit": "шт",
"description": "Автоматична, для зерен і молока",
"categoryId": "0192f3a1-7c2e-7b4d-9a61-000000000064",
"archivedAt": null,
"version": 1,
"prices": [
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000068",
"productId": "0192f3a1-7c2e-7b4d-9a61-000000000066",
"name": "Роздріб",
"currency": "UAH",
"isDefault": true,
"amountCents": 4500000,
"rateId": "0192f3a1-7c2e-7b4d-9a61-00000000006b",
"effectiveFrom": "2026-10-20T08:15:00Z",
"archivedAt": null,
"version": 1
},
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000069",
"productId": "0192f3a1-7c2e-7b4d-9a61-000000000066",
"name": "Опт",
"currency": "UAH",
"isDefault": false,
"amountCents": 4200000,
"rateId": "0192f3a1-7c2e-7b4d-9a61-00000000006c",
"effectiveFrom": "2026-10-20T08:15:00Z",
"archivedAt": null,
"version": 1
}
],
"customFields": []
}Поля — як у відповіді Створити товар
Змінити товар
PATCH /products/{productId}
Назва, артикул (null прибирає), одиниця, опис, група (null — без групи) та значення власних полів. З version, яку ви прочитали, чужа правка за цей час — 409; без version зміна лягає на товар, яким він є зараз. Ціни змінюються своїми запитами.
Параметри шляху
productIdstring · uuid обов’язково
Тіло запиту
categoryIdstring · uuid | nullcodestring | nullдовжина ≤ 60
customFieldsobject[]кількість ≤ 100
Вкладені поля: 2
fieldIdstring · uuid обов’язковоvaluestring | boolean | string[] · uuid | object | null обов’язковоВаріант 1 · string
string
Варіант 2 · boolean
boolean
Варіант 3 · string[] · uuid
string[] · uuid
Варіант 4 · object
amountstring обов’язководовжина ≤ 40
currencystring обов’язководовжина ≤ 3
Варіант 5 · object
citystring | nullдовжина ≤ 200
countrystring | nullдовжина ≤ 200
linestring | nullдовжина ≤ 600
postcodestring | nullдовжина ≤ 40
descriptionstring | nullдовжина ≤ 1000
namestringдовжина 1–200 · шаблон
\StaxRateIdstring · uuid | nullunitstring | nullдовжина ≤ 20
versioninteger≥ 1
Приклад запиту
curl -X PATCH 'https://your-company.altahub.ai/api/v1/products/{productId}' \
-H 'Authorization: Bearer alta_…' \
-H 'Content-Type: application/json' \
-d '{
"unit": "шт",
"version": 1
}'const response = await fetch('https://your-company.altahub.ai/api/v1/products/{productId}', {
method: 'PATCH',
headers: {
Authorization: 'Bearer alta_…',
'Content-Type': 'application/json',
},
body: JSON.stringify({
unit: 'шт',
version: 1,
}),
});
const data = await response.json();import requests
response = requests.patch(
"https://your-company.altahub.ai/api/v1/products/{productId}",
headers={"Authorization": "Bearer alta_…"},
json={
"unit": "шт",
"version": 1,
},
)
data = response.json()<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('PATCH', 'https://your-company.altahub.ai/api/v1/products/{productId}', [
'headers' => ['Authorization' => 'Bearer alta_…'],
'json' => [
'unit' => 'шт',
'version' => 1,
],
]);
$data = json_decode((string) $response->getBody(), true);Відповідь 200
Успішна відповідь.
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000066",
"name": "Кавомашина Jura E8",
"code": "JE8-01",
"unit": "шт",
"description": "Автоматична, для зерен і молока",
"categoryId": "0192f3a1-7c2e-7b4d-9a61-000000000064",
"archivedAt": null,
"version": 2,
"prices": [
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000068",
"productId": "0192f3a1-7c2e-7b4d-9a61-000000000066",
"name": "Роздріб",
"currency": "UAH",
"isDefault": true,
"amountCents": 4500000,
"rateId": "0192f3a1-7c2e-7b4d-9a61-00000000006b",
"effectiveFrom": "2026-10-20T08:15:00Z",
"archivedAt": null,
"version": 1
},
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000069",
"productId": "0192f3a1-7c2e-7b4d-9a61-000000000066",
"name": "Опт",
"currency": "UAH",
"isDefault": false,
"amountCents": 4200000,
"rateId": "0192f3a1-7c2e-7b4d-9a61-00000000006c",
"effectiveFrom": "2026-10-20T08:15:00Z",
"archivedAt": null,
"version": 1
}
],
"customFields": []
}Поля — як у відповіді Створити товар
В архів
POST /products/{productId}/archive
Товар виходить із пропозиції, його ціни лишаються як були, артикул звільняється. Товар не видаляється: на нього посилається те, що за ним продано.
Параметри шляху
productIdstring · uuid обов’язково
Приклад запиту
curl -X POST 'https://your-company.altahub.ai/api/v1/products/{productId}/archive' \
-H 'Authorization: Bearer alta_…' \
-H 'Content-Type: application/json' \
-d '{}'const response = await fetch('https://your-company.altahub.ai/api/v1/products/{productId}/archive', {
method: 'POST',
headers: {
Authorization: 'Bearer alta_…',
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
});
const data = await response.json();import requests
response = requests.post(
"https://your-company.altahub.ai/api/v1/products/{productId}/archive",
headers={"Authorization": "Bearer alta_…"},
json={},
)
data = response.json()<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://your-company.altahub.ai/api/v1/products/{productId}/archive', [
'headers' => ['Authorization' => 'Bearer alta_…'],
'json' => new \stdClass(),
]);
$data = json_decode((string) $response->getBody(), true);Відповідь 200
Успішна відповідь.
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000066",
"name": "Кавомашина Jura E8",
"code": "JE8-01",
"unit": "шт",
"description": "Автоматична, для зерен і молока",
"categoryId": "0192f3a1-7c2e-7b4d-9a61-000000000064",
"archivedAt": "2026-10-24T16:45:00Z",
"version": 2,
"prices": [
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000068",
"productId": "0192f3a1-7c2e-7b4d-9a61-000000000066",
"name": "Роздріб",
"currency": "UAH",
"isDefault": true,
"amountCents": 4500000,
"rateId": "0192f3a1-7c2e-7b4d-9a61-00000000006b",
"effectiveFrom": "2026-10-20T08:15:00Z",
"archivedAt": null,
"version": 1
},
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000069",
"productId": "0192f3a1-7c2e-7b4d-9a61-000000000066",
"name": "Опт",
"currency": "UAH",
"isDefault": false,
"amountCents": 4200000,
"rateId": "0192f3a1-7c2e-7b4d-9a61-00000000006c",
"effectiveFrom": "2026-10-20T08:15:00Z",
"archivedAt": null,
"version": 1
}
],
"customFields": []
}Поля — як у відповіді Створити товар
Додати ціну
POST /products/{productId}/prices
Назва (унікальна серед чинних цін товару), валюта й сума в копійках; 0 — теж ціна. Основної в товару може й не бути: isDefault: true робить основною нову ціну (попередня перестає нею бути), без нього ціна не основна, перша теж. Повтор з тим самим idempotencyKey поверне вже додану ціну.
Параметри шляху
productIdstring · uuid обов’язково
Тіло запиту
amountCentsinteger обов’язково0–9007199254740991
currencystring обов’язковошаблон
^[A-Z]{3}$namestring обов’язководовжина 1–60 · шаблон
\SidempotencyKeystringшаблон
^[\x21-\x7e]{1,255}$isDefaultboolean
Приклад запиту
curl -X POST 'https://your-company.altahub.ai/api/v1/products/{productId}/prices' \
-H 'Authorization: Bearer alta_…' \
-H 'Content-Type: application/json' \
-d '{
"name": "Опт",
"currency": "UAH",
"amountCents": 4200000
}'const response = await fetch('https://your-company.altahub.ai/api/v1/products/{productId}/prices', {
method: 'POST',
headers: {
Authorization: 'Bearer alta_…',
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Опт',
currency: 'UAH',
amountCents: 4200000,
}),
});
const data = await response.json();import requests
response = requests.post(
"https://your-company.altahub.ai/api/v1/products/{productId}/prices",
headers={"Authorization": "Bearer alta_…"},
json={
"name": "Опт",
"currency": "UAH",
"amountCents": 4200000,
},
)
data = response.json()<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://your-company.altahub.ai/api/v1/products/{productId}/prices', [
'headers' => ['Authorization' => 'Bearer alta_…'],
'json' => [
'name' => 'Опт',
'currency' => 'UAH',
'amountCents' => 4200000,
],
]);
$data = json_decode((string) $response->getBody(), true);Відповідь 201
Успішна відповідь.
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000069",
"productId": "0192f3a1-7c2e-7b4d-9a61-000000000066",
"name": "Опт",
"currency": "UAH",
"isDefault": false,
"amountCents": 4200000,
"rateId": "0192f3a1-7c2e-7b4d-9a61-00000000006c",
"effectiveFrom": "2026-10-20T08:15:00Z",
"archivedAt": null,
"version": 1
}Поля відповіді
amountCentsinteger0–9007199254740991
archivedAtstring · date-time | nullcurrencystringeffectiveFromstring · date-timeidstring · uuidisDefaultbooleannamestringproductIdstring · uuidrateIdstring · uuidversioninteger≥ 1
Змінити ціну
PATCH /products/{productId}/prices/{priceId}
Нова назва, нова сума або позначка «основна»: isDefault: true ставить її (попередня основна перестає нею бути), isDefault: false знімає, і в товару не лишається основної; version необов’язкова, як у зміні товару. Нова сума діє з цієї хвилини (rateId змінюється), попередня лишається для того, що за нею продано. Архівну ціну не змінюють — 409 price_archived.
Параметри шляху
priceIdstring · uuid обов’язковоproductIdstring · uuid обов’язково
Тіло запиту
amountCentsinteger0–9007199254740991
isDefaultbooleannamestringдовжина 1–60 · шаблон
\Sversioninteger≥ 1
Приклад запиту
curl -X PATCH 'https://your-company.altahub.ai/api/v1/products/{productId}/prices/{priceId}' \
-H 'Authorization: Bearer alta_…' \
-H 'Content-Type: application/json' \
-d '{
"amountCents": 4700000,
"version": 1
}'const response = await fetch('https://your-company.altahub.ai/api/v1/products/{productId}/prices/{priceId}', {
method: 'PATCH',
headers: {
Authorization: 'Bearer alta_…',
'Content-Type': 'application/json',
},
body: JSON.stringify({
amountCents: 4700000,
version: 1,
}),
});
const data = await response.json();import requests
response = requests.patch(
"https://your-company.altahub.ai/api/v1/products/{productId}/prices/{priceId}",
headers={"Authorization": "Bearer alta_…"},
json={
"amountCents": 4700000,
"version": 1,
},
)
data = response.json()<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('PATCH', 'https://your-company.altahub.ai/api/v1/products/{productId}/prices/{priceId}', [
'headers' => ['Authorization' => 'Bearer alta_…'],
'json' => [
'amountCents' => 4700000,
'version' => 1,
],
]);
$data = json_decode((string) $response->getBody(), true);Відповідь 200
Успішна відповідь.
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000068",
"productId": "0192f3a1-7c2e-7b4d-9a61-000000000066",
"name": "Роздріб",
"currency": "UAH",
"isDefault": true,
"amountCents": 4700000,
"rateId": "0192f3a1-7c2e-7b4d-9a61-00000000006e",
"effectiveFrom": "2026-10-24T16:45:00Z",
"archivedAt": null,
"version": 2
}Поля — як у відповіді Додати ціну
Ціну — в архів
POST /products/{productId}/prices/{priceId}/archive
defaultPriceId (необов’язково) — чинна ціна, яка стане основною. Основна ціна без нього йде в архів сама, і в товару не лишається основної. Останню ціну можна архівувати — товар лишиться без цін.
Параметри шляху
priceIdstring · uuid обов’язковоproductIdstring · uuid обов’язково
Тіло запиту
defaultPriceIdstring · uuid
Приклад запиту
curl -X POST 'https://your-company.altahub.ai/api/v1/products/{productId}/prices/{priceId}/archive' \
-H 'Authorization: Bearer alta_…' \
-H 'Content-Type: application/json' \
-d '{}'const response = await fetch('https://your-company.altahub.ai/api/v1/products/{productId}/prices/{priceId}/archive', {
method: 'POST',
headers: {
Authorization: 'Bearer alta_…',
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
});
const data = await response.json();import requests
response = requests.post(
"https://your-company.altahub.ai/api/v1/products/{productId}/prices/{priceId}/archive",
headers={"Authorization": "Bearer alta_…"},
json={},
)
data = response.json()<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://your-company.altahub.ai/api/v1/products/{productId}/prices/{priceId}/archive', [
'headers' => ['Authorization' => 'Bearer alta_…'],
'json' => new \stdClass(),
]);
$data = json_decode((string) $response->getBody(), true);Відповідь 200
Успішна відповідь.
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000069",
"productId": "0192f3a1-7c2e-7b4d-9a61-000000000066",
"name": "Опт",
"currency": "UAH",
"isDefault": false,
"amountCents": 4200000,
"rateId": "0192f3a1-7c2e-7b4d-9a61-00000000006c",
"effectiveFrom": "2026-10-20T08:15:00Z",
"archivedAt": "2026-10-24T16:45:00Z",
"version": 2
}Поля — як у відповіді Додати ціну
Повернути з архіву
POST /products/{productId}/unarchive
Якщо артикул тим часом зайняв інший чинний товар — 409 NAME_TAKEN: спершу змініть один з артикулів.
Параметри шляху
productIdstring · uuid обов’язково
Приклад запиту
curl -X POST 'https://your-company.altahub.ai/api/v1/products/{productId}/unarchive' \
-H 'Authorization: Bearer alta_…' \
-H 'Content-Type: application/json' \
-d '{}'const response = await fetch('https://your-company.altahub.ai/api/v1/products/{productId}/unarchive', {
method: 'POST',
headers: {
Authorization: 'Bearer alta_…',
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
});
const data = await response.json();import requests
response = requests.post(
"https://your-company.altahub.ai/api/v1/products/{productId}/unarchive",
headers={"Authorization": "Bearer alta_…"},
json={},
)
data = response.json()<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://your-company.altahub.ai/api/v1/products/{productId}/unarchive', [
'headers' => ['Authorization' => 'Bearer alta_…'],
'json' => new \stdClass(),
]);
$data = json_decode((string) $response->getBody(), true);Відповідь 200
Успішна відповідь.
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000066",
"name": "Кавомашина Jura E8",
"code": "JE8-01",
"unit": "шт",
"description": "Автоматична, для зерен і молока",
"categoryId": "0192f3a1-7c2e-7b4d-9a61-000000000064",
"archivedAt": null,
"version": 3,
"prices": [
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000068",
"productId": "0192f3a1-7c2e-7b4d-9a61-000000000066",
"name": "Роздріб",
"currency": "UAH",
"isDefault": true,
"amountCents": 4500000,
"rateId": "0192f3a1-7c2e-7b4d-9a61-00000000006b",
"effectiveFrom": "2026-10-20T08:15:00Z",
"archivedAt": null,
"version": 1
},
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000069",
"productId": "0192f3a1-7c2e-7b4d-9a61-000000000066",
"name": "Опт",
"currency": "UAH",
"isDefault": false,
"amountCents": 4200000,
"rateId": "0192f3a1-7c2e-7b4d-9a61-00000000006c",
"effectiveFrom": "2026-10-20T08:15:00Z",
"archivedAt": null,
"version": 1
}
],
"customFields": []
}Поля — як у відповіді Створити товар
Податки
GET /tax-rates
Ставки податку організації сторінками (limit, cursor) за назвою, чинні або архівні (archived): назва, як її друкують у рахунку, ставка у відсотках із двома знаками і чи брав її хоч один рядок угоди, посилання на оплату або рахунок (used). Читає роль із розділом «Угоди» або сторінкою «Товари».
Параметри запиту
archivedbooleanтипово
falsecursorstringдовжина 1–512
limitinteger1–100 · типово
50
Приклад запиту
curl 'https://your-company.altahub.ai/api/v1/tax-rates' \
-H 'Authorization: Bearer alta_…'const response = await fetch('https://your-company.altahub.ai/api/v1/tax-rates', {
method: 'GET',
headers: {
Authorization: 'Bearer alta_…',
},
});
const data = await response.json();import requests
response = requests.get(
"https://your-company.altahub.ai/api/v1/tax-rates",
headers={"Authorization": "Bearer alta_…"},
)
data = response.json()<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://your-company.altahub.ai/api/v1/tax-rates', [
'headers' => ['Authorization' => 'Bearer alta_…'],
]);
$data = json_decode((string) $response->getBody(), true);Відповідь 200
Успішна відповідь.
{
"items": [
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000c02",
"name": "Звільнено",
"rate": "0.00",
"used": false,
"archived": false,
"version": 1,
"createdAt": "2026-10-24T16:45:00Z"
},
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000c01",
"name": "ПДВ 20 %",
"rate": "20.00",
"used": true,
"archived": false,
"version": 1,
"createdAt": "2026-10-20T08:15:00Z"
}
],
"nextCursor": null
}Поля відповіді
itemsobject[]Вкладені поля: 7
archivedbooleancreatedAtstring · date-timeidstring · uuidnamestringratestringшаблон
^[0-9]{1,3}\.[0-9]{2}$usedbooleanversioninteger≥ 1
nextCursorstring | null
Створити податок
POST /tax-rates
Потрібна сторінка «Товари» в ролі. Назва (зайнята чинною ставкою без урахування регістру — 409 NAME_TAKEN) і ставка у відсотках від 0 до 100, не більше двох знаків (0 — звільнення зі своєю назвою). З першою ставкою в організації з’являється продавець (GET /billing-entities), щоб задати йому «Ціни включають податок» і ставку за замовчуванням. Повтор із тим самим idempotencyKey після втраченої відповіді поверне ту саму ставку.
Тіло запиту
namestring обов’язковоAs documents print it: «ПДВ 20 %», «Звільнено»
довжина 1–100 · шаблон
\Sratestring | number обов’язковоA percent from 0 (a named exemption) to 100, with up to two decimals
шаблон
^[0-9]{1,3}(\.[0-9]{1,2})?$· 0–100idempotencyKeystringшаблон
^[\x21-\x7e]{1,255}$
Приклад запиту
curl -X POST 'https://your-company.altahub.ai/api/v1/tax-rates' \
-H 'Authorization: Bearer alta_…' \
-H 'Content-Type: application/json' \
-d '{
"name": "Звільнено",
"rate": "0"
}'const response = await fetch('https://your-company.altahub.ai/api/v1/tax-rates', {
method: 'POST',
headers: {
Authorization: 'Bearer alta_…',
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'Звільнено',
rate: '0',
}),
});
const data = await response.json();import requests
response = requests.post(
"https://your-company.altahub.ai/api/v1/tax-rates",
headers={"Authorization": "Bearer alta_…"},
json={
"name": "Звільнено",
"rate": "0",
},
)
data = response.json()<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://your-company.altahub.ai/api/v1/tax-rates', [
'headers' => ['Authorization' => 'Bearer alta_…'],
'json' => [
'name' => 'Звільнено',
'rate' => '0',
],
]);
$data = json_decode((string) $response->getBody(), true);Відповідь 201
Успішна відповідь.
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000c02",
"name": "Звільнено",
"rate": "0.00",
"used": false,
"archived": false,
"version": 1,
"createdAt": "2026-10-24T16:45:00Z"
}Поля відповіді
archivedbooleancreatedAtstring · date-timeidstring · uuidnamestringratestringшаблон
^[0-9]{1,3}\.[0-9]{2}$usedbooleanversioninteger≥ 1
Отримати податок
GET /tax-rates/{taxRateId}
Одна ставка, чинна або архівна; ставка іншої організації — 404.
Параметри шляху
taxRateIdstring · uuid обов’язково
Приклад запиту
curl 'https://your-company.altahub.ai/api/v1/tax-rates/{taxRateId}' \
-H 'Authorization: Bearer alta_…'const response = await fetch('https://your-company.altahub.ai/api/v1/tax-rates/{taxRateId}', {
method: 'GET',
headers: {
Authorization: 'Bearer alta_…',
},
});
const data = await response.json();import requests
response = requests.get(
"https://your-company.altahub.ai/api/v1/tax-rates/{taxRateId}",
headers={"Authorization": "Bearer alta_…"},
)
data = response.json()<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://your-company.altahub.ai/api/v1/tax-rates/{taxRateId}', [
'headers' => ['Authorization' => 'Bearer alta_…'],
]);
$data = json_decode((string) $response->getBody(), true);Відповідь 200
Успішна відповідь.
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000c01",
"name": "ПДВ 20 %",
"rate": "20.00",
"used": true,
"archived": false,
"version": 1,
"createdAt": "2026-10-20T08:15:00Z"
}Поля — як у відповіді Створити податок
Змінити податок
PATCH /tax-rates/{taxRateId}
Назва змінюється завжди; ставка — поки її не взяв жоден рядок угоди, посилання на оплату чи рахунок, інакше 409 tax_rate_used: інша ставка — новий податок. Рядок, що вже стоїть в угоді, зберігає ставку, яку взяв. Поле, яке не надіслали, лишається. З version, яку ви прочитали: ставку встигли змінити — 409.
Параметри шляху
taxRateIdstring · uuid обов’язково
Тіло запиту
namestringAs documents print it: «ПДВ 20 %», «Звільнено»
довжина 1–100 · шаблон
\Sratestring | numberA percent from 0 (a named exemption) to 100, with up to two decimals
шаблон
^[0-9]{1,3}(\.[0-9]{1,2})?$· 0–100versioninteger≥ 1
Приклад запиту
curl -X PATCH 'https://your-company.altahub.ai/api/v1/tax-rates/{taxRateId}' \
-H 'Authorization: Bearer alta_…' \
-H 'Content-Type: application/json' \
-d '{
"name": "ПДВ 20 % (основна)"
}'const response = await fetch('https://your-company.altahub.ai/api/v1/tax-rates/{taxRateId}', {
method: 'PATCH',
headers: {
Authorization: 'Bearer alta_…',
'Content-Type': 'application/json',
},
body: JSON.stringify({
name: 'ПДВ 20 % (основна)',
}),
});
const data = await response.json();import requests
response = requests.patch(
"https://your-company.altahub.ai/api/v1/tax-rates/{taxRateId}",
headers={"Authorization": "Bearer alta_…"},
json={
"name": "ПДВ 20 % (основна)",
},
)
data = response.json()<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('PATCH', 'https://your-company.altahub.ai/api/v1/tax-rates/{taxRateId}', [
'headers' => ['Authorization' => 'Bearer alta_…'],
'json' => [
'name' => 'ПДВ 20 % (основна)',
],
]);
$data = json_decode((string) $response->getBody(), true);Відповідь 200
Успішна відповідь.
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000c01",
"name": "ПДВ 20 % (основна)",
"rate": "20.00",
"used": true,
"archived": false,
"version": 2,
"createdAt": "2026-10-20T08:15:00Z"
}Поля — як у відповіді Створити податок
Видалити податок
DELETE /tax-rates/{taxRateId}
Лише ставку, яку нічого не брало; взята — 409 tax_rate_used (надішліть її в архів), ставка продавця або товару — 409 tax_rate_assigned.
Параметри шляху
taxRateIdstring · uuid обов’язково
Приклад запиту
curl -X DELETE 'https://your-company.altahub.ai/api/v1/tax-rates/{taxRateId}' \
-H 'Authorization: Bearer alta_…'const response = await fetch('https://your-company.altahub.ai/api/v1/tax-rates/{taxRateId}', {
method: 'DELETE',
headers: {
Authorization: 'Bearer alta_…',
},
});
const data = await response.json();import requests
response = requests.delete(
"https://your-company.altahub.ai/api/v1/tax-rates/{taxRateId}",
headers={"Authorization": "Bearer alta_…"},
)
data = response.json()<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('DELETE', 'https://your-company.altahub.ai/api/v1/tax-rates/{taxRateId}', [
'headers' => ['Authorization' => 'Bearer alta_…'],
]);
$data = json_decode((string) $response->getBody(), true);Відповідь 200
Успішна відповідь.
{
"deleted": true
}Поля — як у відповіді Видалити купон
Податок в архів
POST /tax-rates/{taxRateId}/archive
Ставку більше не вибирають для продавця і товарів; рядки, посилання і рахунки, які її взяли, її зберігають. Ставка продавця або товару — 409 tax_rate_assigned: спершу виберіть їм іншу.
Параметри шляху
taxRateIdstring · uuid обов’язково
Приклад запиту
curl -X POST 'https://your-company.altahub.ai/api/v1/tax-rates/{taxRateId}/archive' \
-H 'Authorization: Bearer alta_…' \
-H 'Content-Type: application/json' \
-d '{}'const response = await fetch('https://your-company.altahub.ai/api/v1/tax-rates/{taxRateId}/archive', {
method: 'POST',
headers: {
Authorization: 'Bearer alta_…',
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
});
const data = await response.json();import requests
response = requests.post(
"https://your-company.altahub.ai/api/v1/tax-rates/{taxRateId}/archive",
headers={"Authorization": "Bearer alta_…"},
json={},
)
data = response.json()<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://your-company.altahub.ai/api/v1/tax-rates/{taxRateId}/archive', [
'headers' => ['Authorization' => 'Bearer alta_…'],
'json' => new \stdClass(),
]);
$data = json_decode((string) $response->getBody(), true);Відповідь 200
Успішна відповідь.
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000c02",
"name": "Звільнено",
"rate": "0.00",
"used": false,
"archived": true,
"version": 2,
"createdAt": "2026-10-24T16:45:00Z"
}Поля — як у відповіді Створити податок
Повернути податок з архіву
POST /tax-rates/{taxRateId}/restore
Поки ставка була в архіві, її назву взяла інша чинна ставка — 409 NAME_TAKEN. Чинна ще раз нічого не змінює.
Параметри шляху
taxRateIdstring · uuid обов’язково
Приклад запиту
curl -X POST 'https://your-company.altahub.ai/api/v1/tax-rates/{taxRateId}/restore' \
-H 'Authorization: Bearer alta_…' \
-H 'Content-Type: application/json' \
-d '{}'const response = await fetch('https://your-company.altahub.ai/api/v1/tax-rates/{taxRateId}/restore', {
method: 'POST',
headers: {
Authorization: 'Bearer alta_…',
'Content-Type': 'application/json',
},
body: JSON.stringify({}),
});
const data = await response.json();import requests
response = requests.post(
"https://your-company.altahub.ai/api/v1/tax-rates/{taxRateId}/restore",
headers={"Authorization": "Bearer alta_…"},
json={},
)
data = response.json()<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('POST', 'https://your-company.altahub.ai/api/v1/tax-rates/{taxRateId}/restore', [
'headers' => ['Authorization' => 'Bearer alta_…'],
'json' => new \stdClass(),
]);
$data = json_decode((string) $response->getBody(), true);Відповідь 200
Успішна відповідь.
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000c02",
"name": "Звільнено",
"rate": "0.00",
"used": false,
"archived": false,
"version": 3,
"createdAt": "2026-10-24T16:45:00Z"
}Поля — як у відповіді Створити податок