TPVStream API: catalogue and stock
Read and change products, categories, VAT, modifiers and stock.
Routes for the catalogue and the stock. Common rules (key, pagination, Idempotency-Key, If-Match, errors) are in API rules.
Products
| Method | Route | Right |
|---|---|---|
| GET | /products |
catalog:read |
| GET | /products/{id} |
catalog:read |
| POST | /products |
catalog:write |
| PATCH | /products/{id} |
catalog:write |
| DELETE | /products/{id} (deactivates, with its variants) |
catalog:write |
Filters of GET /products: active (true by default, false or all), categoryId, barcode, sku and updatedSince (ISO date: only what changed since then, to sync).
A product:
{
"id": "8f1c…",
"name": "Basic T-shirt",
"description": null,
"type": "other",
"priceCents": 1990,
"taxRate": 21,
"taxRateId": "a12b…",
"categoryId": "c34d…",
"parentId": null,
"variantIds": ["v1…", "v2…"],
"isIngredient": false,
"barcode": "8412345678905",
"extraBarcodes": [],
"sku": "CAM-001",
"unit": null,
"isWeighted": false,
"trackStock": true,
"stockQuantity": 12,
"lowStockAlert": 3,
"allergens": null,
"isActive": true,
"online": null,
"updatedAt": "2026-11-27T08:00:00.000Z"
}
priceCents: selling price, VAT included.costPriceCents(cost price) only shows if the key hasstock:read.type:food,drinkorother.- Variants (sizes, colours, formats): products whose
parentIdis the parent product. The parent lists its active variants invariantIds. isIngredient: true: ingredient or raw material, not sold alone. Usually you will not publish it in a shop.isWeighted: true: sold by weight; stock and quantities can have decimals.
Create a product
curl -X POST https://api.tpvstream.com/<id>/v1/products \
-H "Authorization: Bearer tpv_live_…" \
-H "Idempotency-Key: 3a5c…" \
-H "Content-Type: application/json" \
-d '{"name":"Ceramic mug","priceCents":890,"taxRateId":"a12b…","categoryId":"c34d…","sku":"TAZ-01","trackStock":true,"stockQuantity":20}'
Required: name and priceCents. Without taxRateId, the default VAT of the POS is used. Answer 201 with the new product.
To change it, read the product, take its ETag and send only the changed fields with PATCH and If-Match. A changed price does not touch tickets already open on the POS.
Categories
| Method | Route | Right |
|---|---|---|
| GET | /categories · /categories/{id} |
catalog:read |
| POST · PATCH | /categories · /categories/{id} |
catalog:write |
| DELETE | /categories/{id} |
catalog:write |
Fields: id, name, parentId (subcategory), color (#RRGGBB), sortOrder, isActive. As on the POS, deactivating a category also deactivates its subcategories and products.
VAT rates
GET /tax-rates (catalog:read): id, name, rate (for example 21) and isDefault. Use the id in taxRateId when creating a product.
Modifiers
GET /modifier-groups (catalog:read): option groups of the products (cooking, extras, sauces…).
{
"id": "g1…",
"name": "Extras",
"required": false,
"min": 0,
"max": 2,
"modifiers": [
{ "id": "m1…", "name": "Cheese", "priceCents": 120 },
{ "id": "m2…", "name": "Bacon", "priceCents": 150 }
],
"productIds": ["8f1c…"]
}
max: 0 = no limit. priceCents is what is added to the price, VAT included. Modifiers are read only through the API.
Online sheet
The online field of a product is its sheet for the online shop (Online shop tab of the product on the POS), or null if it has none. It is read only.
It holds published, the texts (name, summary, description), priceCents (web price, null = POS price), SEO (metaTitle, metaDescription, slug), brand, tags, sizes and weight, delivery times and images: [{ "id", "alt" }] in order (the first one is the cover).
Each picture is read on its own: GET /product-images/{id} (catalog:read) returns { "id", "productId", "mime": "image/jpeg", "base64" }.
Stock
| Method | Route | Right |
|---|---|---|
| GET | /stock (?lowOnly=true = only below minimum) |
stock:read |
| GET | /stock/movements (?productId&from&to) |
stock:read |
| POST | /stock/adjustments |
stock:write |
GET /stock lists the products with stock tracking: productId, name, unit, stockQuantity, lowStockAlert and low (true if below minimum).
Each movement gives type, quantity, stockBefore, stockAfter, reason and createdAt.
Adjust a stock
Send either delta (add or remove) or setTo (new value), and always a reason:
{ "productId": "8f1c…", "delta": -2, "reason": "Online shop sale #1042" }
{ "productId": "8f1c…", "setTo": 15, "reason": "Stocktake" }
Answer 201: { "productId": "8f1c…", "stockQuantity": 13 }. The adjustment shows in the POS history with the author API:<key name>.
For an online shop, use delta with an Idempotency-Key tied to the order: if you repeat the call, the stock is not taken off twice.
