Price lists
Price lists for customer groups and companies (D321), and their fixed prices.
| Operation | Method and path | Scope |
|---|---|---|
| List price lists | GET /price-lists | products:read |
| List a price list's prices | GET /price-lists/{id}/prices | products:read |
| Set a price list's prices | POST /price-lists/{id}/prices | products:publish |
List price lists
GET https://kaizenaflow.com/api/admin/v1/price-lists
The store's price lists for customer groups and companies (D321), A to Z, each with how many fixed prices and buyers it has.
Operation:
price_lists.listScope:
products:read, orproducts:write, which reads tooAnswers:
200, the answer underdata.
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
updated_after | string (date-time) | no | Only what was made or changed after this time (ISO 8601 with its offset), for incremental sync. |
Answer
| Field | Type | Description |
|---|---|---|
data | list of objects | |
data[].id | string (uuid) | |
data[].name | string | |
data[].percent | integer or null | A percentage off every price it reaches; null for a list of fixed prices only. |
data[].active | boolean | |
data[].exclusive | boolean | Its buyers see only the products it prices. |
data[].prices | integer | Fixed prices it holds. |
data[].groups | integer | Customer groups it is for. |
data[].companies | integer | Companies it is for. |
data[].updated_at | string (date-time) |
Errors
| Status | Code | When |
|---|---|---|
| 401 | unauthorized | No valid token in Authorization: Bearer kf_…, or one that was revoked. |
| 403 | feature_off | The store has switched off the feature the operation stands behind (Settings, Store features); the message names it. |
| 403 | forbidden | The token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which. |
| 422 | invalid | Nothing was done: a body, query or cursor that is not as described, or a check of the screen it goes through; the message says what. |
| 429 | rate_limited | More calls than the budget allows; Retry-After says how many seconds to wait. |
| 500 | failed | Something went wrong on our side; nothing more was done. It is safe to try again. |
Example request
curl
curl 'https://kaizenaflow.com/api/admin/v1/price-lists' \
-H "Authorization: Bearer $KAIZENA_TOKEN"JavaScript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/price-lists", {
headers: {
Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
},
});
const answer = await response.json();Python
import json
import os
import urllib.request
request = urllib.request.Request(
"https://kaizenaflow.com/api/admin/v1/price-lists",
headers={
"Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
},
)
with urllib.request.urlopen(request) as response:
answer = json.load(response)List a price list's prices
GET https://kaizenaflow.com/api/admin/v1/price-lists/{id}/prices
The list's fixed prices per variant and currency, in minor units, the most recently changed first.
Operation:
price_lists.pricesScope:
products:read, orproducts:write, which reads tooAnswers:
200, a page: the rows underdata, andnextfor the page after.Pages: at most 100 rows, 50 when
limitis left out; give an answer'snextas?after=for the page after.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | yes | The thing's id in this store. |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit | integer, 1 to 100 | no | Rows a page holds, at most 100; 50 when left out. A larger number gives 100. |
after | string, at most 200 characters | no | The next cursor of the page before; the first page when left out. |
updated_after | string (date-time) | no | Only what was made or changed after this time (ISO 8601 with its offset), for incremental sync. |
Answer
| Field | Type | Description |
|---|---|---|
data | list of objects | |
data[].variant_id | string (uuid) | |
data[].product_id | string (uuid) | |
data[].sku | string | |
data[].currency | string, matching ^[A-Z]{3}$ | An ISO 4217 code, such as NOK or EUR. |
data[].amount_minor | integer | An amount in minor units of the currency (øre, cents), VAT included where the store's prices are. |
data[].updated_at | string (date-time) | |
next | string or null | The cursor of the next page, given as ?after=; null on the last page. |
Errors
| Status | Code | When |
|---|---|---|
| 401 | unauthorized | No valid token in Authorization: Bearer kf_…, or one that was revoked. |
| 403 | feature_off | The store has switched off the feature the operation stands behind (Settings, Store features); the message names it. |
| 403 | forbidden | The token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which. |
| 404 | not_found | No such route, or nothing with that id in the token's store (another store's ids are simply not found). |
| 422 | invalid | Nothing was done: a body, query or cursor that is not as described, or a check of the screen it goes through; the message says what. |
| 429 | rate_limited | More calls than the budget allows; Retry-After says how many seconds to wait. |
| 500 | failed | Something went wrong on our side; nothing more was done. It is safe to try again. |
Example request
curl
curl 'https://kaizenaflow.com/api/admin/v1/price-lists/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/prices' \
-H "Authorization: Bearer $KAIZENA_TOKEN"JavaScript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/price-lists/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/prices", {
headers: {
Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
},
});
const answer = await response.json();Python
import json
import os
import urllib.request
request = urllib.request.Request(
"https://kaizenaflow.com/api/admin/v1/price-lists/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/prices",
headers={
"Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
},
)
with urllib.request.urlopen(request) as response:
answer = json.load(response)Set a price list's prices
POST https://kaizenaflow.com/api/admin/v1/price-lists/{id}/prices
Sets fixed prices through the price list page's own writer: each row's amount for its variant and currency (one of the store's markets'), null taking it away. Every row is checked before anything is written.
Operation:
price_lists.set_pricesScope:
products:publishAnswers:
200, the answer underdata.Once only: with an
Idempotency-Keyheader.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | yes | The thing's id in this store. |
Body
JSON, with Content-Type: application/json.
| Field | Type | Required | Description |
|---|---|---|---|
rows | list of objects, 1 to 500 items | yes | |
rows[].variant_id | string (uuid) | no | The variant, by its id. |
rows[].sku | string, 1 to 64 characters | no | The variant, by its SKU. |
rows[].currency | string, matching ^[A-Z]{3}$ | yes | One of the store's markets' currencies. |
rows[].amount_minor | integer, 0 to 10,000,000,000 or null | yes | The fixed price in minor units, VAT included as the store's prices are; null takes it away. |
Answer
| Field | Type | Description |
|---|---|---|
data | object | |
data.set | integer | |
data.removed | integer |
Errors
| Status | Code | When |
|---|---|---|
| 401 | unauthorized | No valid token in Authorization: Bearer kf_…, or one that was revoked. |
| 403 | feature_off | The store has switched off the feature the operation stands behind (Settings, Store features); the message names it. |
| 403 | forbidden | The token does not hold the scope the operation needs, or its owner does not hold the staff permission it needs in the store now (a store that is not open, as in the admin, keeps open only its orders, customers, reports and the owner's own pages such as its webhooks; its products, discounts, website and settings, read or changed, are refused); the message names which. |
| 404 | not_found | No such route, or nothing with that id in the token's store (another store's ids are simply not found). |
| 409 | conflict | Nothing was done: it clashes with how things are now (nothing left to send), or an Idempotency-Key is in use or was used for another request. |
| 422 | invalid | Nothing was done: a body, query or cursor that is not as described, or a check of the screen it goes through; the message says what. |
| 429 | rate_limited | More calls than the budget allows; Retry-After says how many seconds to wait. |
| 500 | failed | Something went wrong on our side; nothing more was done. It is safe to try again. |
Example request
curl
curl -X POST 'https://kaizenaflow.com/api/admin/v1/price-lists/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/prices' \
-H "Authorization: Bearer $KAIZENA_TOKEN" \
-H "Content-Type: application/json" \
-d '{"rows":[{"variant_id":"a9012318-1d02-4424-9f91-3c4f58cc1841","currency":"NOK","amount_minor":1}]}'JavaScript
const response = await fetch("https://kaizenaflow.com/api/admin/v1/price-lists/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/prices", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.KAIZENA_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"rows": [
{
"variant_id": "a9012318-1d02-4424-9f91-3c4f58cc1841",
"currency": "NOK",
"amount_minor": 1
}
]
}),
});
const answer = await response.json();Python
import json
import os
import urllib.request
request = urllib.request.Request(
"https://kaizenaflow.com/api/admin/v1/price-lists/3f2b8c1e-6d4a-4b9e-8c7f-1a2b3c4d5e6f/prices",
method="POST",
headers={
"Authorization": "Bearer " + os.environ["KAIZENA_TOKEN"],
"Content-Type": "application/json",
},
data=json.dumps({
"rows": [
{
"variant_id": "a9012318-1d02-4424-9f91-3c4f58cc1841",
"currency": "NOK",
"amount_minor": 1,
},
],
}).encode(),
)
with urllib.request.urlopen(request) as response:
answer = json.load(response)