This commit is contained in:
seb
2026-10-07 21:23:10 +02:00
parent a29ad50b74
commit 7d537aaa6b
33 changed files with 598 additions and 327 deletions

View File

@@ -4,24 +4,24 @@ Overview of all 145 API endpoints across all modules.
### Notation
Types: `str` string, `int` integer, `num` number, `bool` boolean, `obj` object; `T[]` array; `?` optional.
Types: `str` string, `int` integer, `num` number, `bool` boolean, `{}` object; `T[]` array; `?` optional.
Params: path values first, then `query:` and `body:` (`body?` = optional body). Responses: status code + JSON shape; `Tn` refers to a reusable type below.
### Reusable types
- `T1` = `{ article: T2 }`
- `T2` = `{ id: int, sku: str, name: str, slug: str, track_stock: bool, unitamount: num, weight: num, unit: obj, brand: obj, categoryIds: int[], photos: T17[], eans: str[], prices: T26[], suppliers: T9[] }`
- `T2` = `{ id: int, sku: str, name: str, slug: str, track_stock: bool, unitamount: num, weight: num, unit: T26, brand: T23, categoryIds: int[], photos: T17[], eans: str[], prices: T27[], suppliers: T9[] }`
- `T3` = `{ delivery: T4 }`
- `T4` = `{ id: int, number: str, type: str, supplierId: int, externalNumber: str, date: str, createdAt: str, ledger: T30, lines: T18[], files: T8[] }`
- `T4` = `{ id: int, number: str, type: str, supplierId: int, externalNumber: str, date: str, createdAt: str, ledger: T31, lines: T18[], files: T8[] }`
- `T5` = `{ order: T7 }`
- `T6` = `{ quote: T7 }`
- `T7` = `{ id: int, number: str, type: str, entityId: int, date: str, createdAt: str, lines: T18[] }`
- `T8` = `{ id: int, manifestId: int, fileId: int, sort: int, hash: str, mimetype: str, name: str, size: int, created: str, modified: str, thumbavif: str, thumbx: int, thumby: int, meta: obj }`
- `T9` = `{ id: int, articleId: int, entityId: int, supplierName: str, sku: str, pu: num, stock: num, sort: int, priceId: int, price: T33 }`
- `T8` = `{ id: int, manifestId: int, fileId: int, sort: int, hash: str, mimetype: str, name: str, size: int, created: str, modified: str, thumbavif: str, thumbx: int, thumby: int, meta: { [k]: str } }`
- `T9` = `{ id: int, articleId: int, entityId: int, supplierName: str, sku: str, pu: num, stock: num, sort: int, priceId: int, price: T34 }`
- `T10` = `{ ledger: T11[] }`
- `T11` = `{ id: int, manifestarticle_id: int, transaction_type: str, amount: num, transaction_text: str, hash_version: int, prev_hash: str, sku: str, created_at: str }`
- `T12` = `{ id: int, entityId: int, firstName: str, name: str, street: str, streetNumber: str, zip: str, city: str, county: str, addressType: str }`
- `T13` = `{ id: int, name: str, sort: int, exclusive: bool, values: T28[] }`
- `T13` = `{ id: int, name: str, sort: int, exclusive: bool, values: T29[] }`
- `T14` = `{ entity: T19 }`
- `T15` = `{ printer: T20 }`
- `T16` = `{ labeltemplate: T22 }`
@@ -30,19 +30,20 @@ Params: path values first, then `query:` and `body:` (`body?` = optional body).
- `T19` = `{ id: int, customergroupId: int, firstName: str, name: str, number: str, createdAt: str, updatedAt: str }`
- `T20` = `{ id: int, company_id: int, address: str, type: str, model: str, serial: str, sort: int, desc: str }`
- `T21` = `{ amount: num, net: num, taxrate: num, sku?: str, name?: str, pu?: num, rebate?: num, comment?: str }`
- `T22` = `{ id: int, name: str, width: num, height: num, dpi: int, type: str, content: obj, thumb: str }`
- `T23` = `{ id: int, sort: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str }`
- `T22` = `{ id: int, name: str, width: num, height: num, dpi: int, type: str, content: {}, thumb: str }`
- `T23` = `{ id: int, name: str, fullHash: str, thumbW: int, thumbH: int, thumbHash: str }`
- `T24` = `{ article: T25 }`
- `T25` = `{ id: int, categoryId: int, name: str, sku: str, track_stock: bool }`
- `T26` = `{ minmultiplier: num, net: num, taxRate: num, customergroupId: int }`
- `T27` = `{ id: int, entityId: int, contactType: str, contact: str }`
- `T28` = `{ id: int, attributeId: int, value: str, sort: int }`
- `T29` = `{ id: int, name: str, createdAt: str, updatedAt: str }`
- `T30` = `{ totalPositions: int, completelyOnLedgerPositions: int }`
- `T31` = `{ id: int, name: str, sort: int, exclusive: bool }`
- `T32` = `{ warehouse: T34 }`
- `T33` = `{ net: num, taxId: int, taxRate: num }`
- `T34` = `{ id: int, name: str, sort: int }`
- `T26` = `{ si: str, basesi: str, basesifactor: num, symbol: str, name: str }`
- `T27` = `{ minmultiplier: num, net: num, taxRate: num, customergroupId: int }`
- `T28` = `{ id: int, entityId: int, contactType: str, contact: str }`
- `T29` = `{ id: int, attributeId: int, value: str, sort: int }`
- `T30` = `{ id: int, name: str, createdAt: str, updatedAt: str }`
- `T31` = `{ totalPositions: int, completelyOnLedgerPositions: int }`
- `T32` = `{ id: int, name: str, sort: int, exclusive: bool }`
- `T33` = `{ warehouse: T35 }`
- `T34` = `{ net: num, taxId: int, taxRate: num }`
- `T35` = `{ id: int, name: str, sort: int }`
### Routes
@@ -63,7 +64,7 @@ Params: path values first, then `query:` and `body:` (`body?` = optional body).
- Returns: `200 { items: { id: int, articleId: int, sku: str, name: str, count: int, sort: int }[] }`
#### Set Stückliste (bundle items) for an article — `PUT /article/{sku}/articlelist`
- Params: `sku: str, body: { items: { articleId?: int, sku?: str, count?: int, sort?: int }[] }`
- Returns: `200 { items: obj[] }`
- Returns: `200 { items: { id: int, articleId: int, sku: str, name: str, count: int, sort: int }[] }`
#### List article attribute values — `GET /article/{sku}/attributevalue`
- Params: `sku: str`
- Returns: `200 { attributevalues: { id: int, articleId: int, attributeId: int, attributeName: str, exclusive: bool, attributeValueId: int, value: str, sort: int }[] }`
@@ -84,7 +85,7 @@ Params: path values first, then `query:` and `body:` (`body?` = optional body).
- Returns: `201 T24`
#### Attach an existing article as a child to a parent article — `PUT /article/{sku}/children`
- Params: `sku: str, body: { sku: str, attributeValueId?: int, value?: str, reparent?: bool }`
- Returns: `200 { article: T25, children: obj[] }`
- Returns: `200 { article: T25, children: { id: int, sku: str, name: str, parentsort: int, attributeValueId: int, attributeValue: str }[] }`
#### Remove a child article from a parent article — `DELETE /article/{sku}/children/{childSku}`
- Params: `sku: str, childSku: str, query: deleteArticle?: bool`
- Returns: `200 { success: bool, deleted: bool }`
@@ -105,12 +106,12 @@ Params: path values first, then `query:` and `body:` (`body?` = optional body).
- Returns: `200 { options: { id: int, articleId: int, sku: str, name: str, count: int, sort: int, mandated: bool }[] }`
#### Set options list for an article — `PUT /article/{sku}/optionslist`
- Params: `sku: str, body: { options: { articleId?: int, sku?: str, count?: int, sort?: int, mandated?: bool }[] }`
- Returns: `200 { options: obj[] }`
- Returns: `200 { options: { id: int, articleId: int, sku: str, name: str, count: int, sort: int, mandated: bool }[] }`
#### Toggle parent mode for an article — `POST /article/{sku}/parent`
- Params: `sku: str, body: { isParent: bool, attributeNameId?: int }`
- Returns: `200 T24`
#### Replace POS prices by SKU — `PUT /article/{sku}/prices`
- Params: `sku: str, body: { prices: { price: num, tax: num, minmultiplier?: num }[] }`
- Params: `sku: str, body: { prices: { net?: num, gross?: num, price?: num, taxRate?: num, tax?: num, minmultiplier?: num }[] }`
- Returns: `200 T1`
#### Print article label — `POST /article/{sku}/print`
- Params: `sku: str, body: { templateId: int, printerId: int, quantity: int }`
@@ -156,10 +157,10 @@ _none_
- Returns: `200`
#### List values for an attribute — `GET /attributename/{attributeId}/value`
- Params: `attributeId: int`
- Returns: `200 { values: T28[] }`
- Returns: `200 { values: T29[] }`
#### Create value for an attribute — `POST /attributename/{attributeId}/value`
- Params: `attributeId: int, body: { value: str, sort?: int }`
- Returns: `201 { attributevalue: T28 }`
- Returns: `201 { attributevalue: T29 }`
#### Reorder values of an attribute — `PUT /attributename/{attributeId}/value/order`
- Params: `attributeId: int, body: { attributevalueIds: int[] }`
- Returns: `200`
@@ -174,7 +175,7 @@ _none_
- Returns: `200`
#### Update attribute value — `PATCH /attributevalue/{id}`
- Params: `id: int, body: { value?: str, sort?: int }`
- Returns: `200 { attributevalue: T28 }`
- Returns: `200 { attributevalue: T29 }`
#### Login with Google ID token — `POST /auth/login`
- Params: `body: { idToken: str }`
- Returns: `200 { message: str, user: { id: int, email: str, selectedCompanyId: int, picture: str } }`
@@ -183,19 +184,19 @@ _none_
- Returns: `200 { message: str }`
#### List brands — `GET /brand`
_none_
- Returns: `200 { brands: { id: int, name: str, gsprpinfo: str, pics: T23[] }[] }`
- Returns: `200 { brands: { id: int, name: str, gsprpinfo: str, pics: any[] }[] }`
#### Upsert brand — `PUT /brand`
- Params: `body: { name: str, gsprpinfo?: str }`
- Returns: `200 { brand: { id: int, name: str, gsprpinfo: str, pics: T23[] } }`
- Returns: `200 { brand: { id: int, name: str, gsprpinfo: str, pics: any[] } }`
#### Delete brand — `DELETE /brand/{id}`
- Params: `id: int`
- Returns: `204 void`
#### Delete brand image — `DELETE /brand/{id}/image`
- Params: `id: int`
- Returns: `200 { brand: { id: int, thumbW: int, thumbH: int, thumbHash: str, pics: T23[] } }`
- Returns: `200 { brand: { id: int, thumbW: int, thumbH: int, thumbHash: str, pics: { id: int, sort: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str }[] } }`
#### Add or replace brand image — `POST /brand/{id}/image`
- Params: `id: int, image/avif`
- Returns: `201 { brand: { id: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str, pics: T23[] } }`
- Returns: `201 { brand: { id: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str, pics: { id: int, sort: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str }[] } }`
#### Create category — `POST /category`
- Params: `body: { parentId: int, name: str }`
- Returns: `201 { category: { id: int, parentId: int, sort: int, name: str } }`
@@ -204,7 +205,7 @@ _none_
- Returns: `200 { categoryIds: int[] }`
#### Category tree — `GET /category/tree`
_none_
- Returns: `200 { languageId: int, tree: obj[], articles: obj[] }`
- Returns: `200 { languageId: int, tree: { id: int, parentId: int, sort: int, name: str, slug: str, fullHash: str, thumbW: int, thumbH: int, thumbHash: str, posterminalIds: int[] }[], articles: { id: int, sku: str, name: str, slug: str, net: num, taxRate: num, track_stock: bool, optionsCount: int, articleListCount: int, childCount: int, parentArticleId: int, parentSku: str, fullHash: str, thumbW: int, thumbH: int, thumbHash: str, brand: T23 }[] }`
#### Delete category — `DELETE /category/{id}`
- Params: `id: int`
- Returns: `204 void`
@@ -213,7 +214,7 @@ _none_
- Returns: `200 { category: { id: int, name: str, slug: str, parentId: int, sort: int } }`
#### Articles in category — `GET /category/{id}/articles`
- Params: `id: int`
- Returns: `200 { articles: { id: int, sku: str, name: str, slug: str, net: num, taxRate: num, track_stock: bool, optionsCount: int, articleListCount: int, childCount: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str, brand: obj }[] }`
- Returns: `200 { articles: { id: int, sku: str, name: str, slug: str, net: num, taxRate: num, track_stock: bool, optionsCount: int, articleListCount: int, childCount: int, parentArticleId: int, parentSku: str, fullHash: str, thumbW: int, thumbH: int, thumbHash: str, brand: T23 }[] }`
#### List category attribute values — `GET /category/{id}/attributevalue`
- Params: `id: int`
- Returns: `200 { attributevalues: { id: int, categoryId: int, attributeId: int, attributeName: str, exclusive: bool, attributeValueId: int, value: str, sort: int }[] }`
@@ -258,7 +259,7 @@ _none_
- Returns: `200 { customergroups: { id: int, name: str, sort: int, editable: bool }[] }`
#### Create customer group — `POST /customergroup`
- Params: `body: { name: str }`
- Returns: `201 { customergroup: T34 }`
- Returns: `201 { customergroup: T35 }`
#### Reorder customer groups — `PUT /customergroup/order`
- Params: `body: { customergroupIds: int[] }`
- Returns: `200 { customergroupIds: int[] }`
@@ -267,12 +268,12 @@ _none_
- Returns: `204 void`
#### Update customer group — `PATCH /customergroup/{id}`
- Params: `id: int, body: { name: str }`
- Returns: `200 { customergroup: T34 }`
- Returns: `200 { customergroup: T35 }`
#### List deliveries — `GET /delivery`
_none_
- Returns: `200 { deliveries: { id: int, number: str, type: str, supplierId: int, externalNumber: str, date: str, createdAt: str, ledger: T30 }[] }`
- Returns: `200 { deliveries: { id: int, number: str, type: str, supplierId: int, externalNumber: str, date: str, createdAt: str, ledger: T31 }[] }`
#### Create delivery — `POST /delivery`
- Params: `body: { externalNumber: str, date: str, lines: T21[], supplierId?: int, files?: { mimetype: str, name: str, content: str, sort?: int, size?: int, hash?: str, created?: str, modified?: str, meta?: obj }[] }`
- Params: `body: { externalNumber: str, date: str, lines: T21[], supplierId?: int, files?: { mimetype: str, name: str, content: str, sort?: int, size?: int, hash?: str, created?: str, modified?: str, meta?: { [k]: str } }[] }`
- Returns: `201 T3`
#### Delete delivery — `DELETE /delivery/{id}`
- Params: `id: int`
@@ -281,7 +282,7 @@ _none_
- Params: `id: int`
- Returns: `200 T3`
#### Update delivery — `PATCH /delivery/{id}`
- Params: `id: int, body: { externalNumber?: str, date?: str, supplierId?: int, lines?: T21[], files?: { mimetype: str, name: str, content: str, sort?: int, size?: int, hash?: str, created?: str, modified?: str, meta?: obj }[] }`
- Params: `id: int, body: { externalNumber?: str, date?: str, supplierId?: int, lines?: T21[], files?: { mimetype: str, name: str, content: str, sort?: int, size?: int, hash?: str, created?: str, modified?: str, meta?: { [k]: str } }[] }`
- Returns: `200 T3`
#### Get delivery attachment file content — `GET /delivery/{id}/file/{fileId}`
- Params: `id: int, fileId: int, query: download?: bool`
@@ -309,16 +310,16 @@ _none_
- Returns: `200 { address: T12 }`
#### List entity contacts — `GET /entity/{entityId}/contact`
- Params: `entityId: int`
- Returns: `200 { contacts: T27[] }`
- Returns: `200 { contacts: T28[] }`
#### Create entity contact — `POST /entity/{entityId}/contact`
- Params: `entityId: int, body: { contactType: str, contact: str }`
- Returns: `201 { contact: T27 }`
- Returns: `201 { contact: T28 }`
#### Delete entity contact — `DELETE /entity/{entityId}/contact/{id}`
- Params: `entityId: int, id: int`
- Returns: `204 void`
#### Update entity contact — `PATCH /entity/{entityId}/contact/{id}`
- Params: `entityId: int, id: int, body: { contactType?: str, contact?: str }`
- Returns: `200 { contact: T27 }`
- Returns: `200 { contact: T28 }`
#### Delete entity — `DELETE /entity/{id}`
- Params: `id: int`
- Returns: `204 void`
@@ -332,7 +333,7 @@ _none_
_none_
- Returns: `200 { labeltemplates: T22[] }`
#### Create label template — `POST /labeltemplate`
- Params: `body: { name: str, width: num, height: num, dpi: int, type: str, content: obj }`
- Params: `body: { name: str, width: num, height: num, dpi: int, type: str, content: {} }`
- Returns: `201 T16`
#### Delete label template — `DELETE /labeltemplate/{id}`
- Params: `id: int`
@@ -341,10 +342,10 @@ _none_
- Params: `id: int`
- Returns: `200 T16`
#### Update label template (partial) — `PATCH /labeltemplate/{id}`
- Params: `id: int, body: { name?: str, width?: num, height?: num, dpi?: int, type?: str, content?: obj }`
- Params: `id: int, body: { name?: str, width?: num, height?: num, dpi?: int, type?: str, content?: {} }`
- Returns: `200 T16`
#### Update label template — `PUT /labeltemplate/{id}`
- Params: `id: int, body: { name?: str, width?: num, height?: num, dpi?: int, type?: str, content?: obj }`
- Params: `id: int, body: { name?: str, width?: num, height?: num, dpi?: int, type?: str, content?: {} }`
- Returns: `200 T16`
#### Query ledger by manifest article ID or SKU — `GET /ledger`
- Params: `query: manifestarticle_id?: int, sku?: str, transaction_type?: str`
@@ -402,10 +403,10 @@ _none_
- Returns: `200 T15`
#### List property names — `GET /propertyname`
_none_
- Returns: `200 { propertynames: T31[] }`
- Returns: `200 { propertynames: T32[] }`
#### Create property name — `POST /propertyname`
- Params: `body: { name: str, sort?: int, exclusive?: bool }`
- Returns: `201 { propertyname: T31 }`
- Returns: `201 { propertyname: T32 }`
#### Reorder property names — `PUT /propertyname/order`
- Params: `body: { propertynameIds: int[] }`
- Returns: `200`
@@ -414,7 +415,7 @@ _none_
- Returns: `200`
#### Update property name — `PATCH /propertyname/{id}`
- Params: `id: int, body: { name?: str, sort?: int, exclusive?: bool }`
- Returns: `200 { propertyname: T31 }`
- Returns: `200 { propertyname: T32 }`
#### List quotes — `GET /quote`
_none_
- Returns: `200 { quotes: { id: int, number: str, type: str, entityId: int, date: str, createdAt: str }[] }`
@@ -432,40 +433,40 @@ _none_
- Returns: `200 T6`
#### Adjust stock manually — `POST /stock/adjust`
- Params: `body: { sku?: str, warehouseId?: int, amount?: num, text?: str, lines?: { sku: str, amount: num, warehouseId?: int, text?: str }[] }`
- Returns: `201 { manifest: { id: int, number: str, type: str, date: str, createdAt: str }, lines: obj[], ledger: T11[] }`
- Returns: `201 { manifest: { id: int, number: str, type: str, date: str, createdAt: str }, lines: { manifestarticle_id: int, sku: str, name: str, warehouse_id: int, amount: num, text: str }[], ledger: T11[] }`
#### List suppliers — `GET /supplier`
_none_
- Returns: `200 { suppliers: T29[] }`
- Returns: `200 { suppliers: T30[] }`
#### Create supplier — `POST /supplier`
- Params: `body: { name: str }`
- Returns: `201 { supplier: T29 }`
- Returns: `201 { supplier: T30 }`
#### Delete supplier — `DELETE /supplier/{id}`
- Params: `id: int`
- Returns: `204 void`
#### Update supplier — `PATCH /supplier/{id}`
- Params: `id: int, body: { name: str }`
- Returns: `200 { supplier: T29 }`
- Returns: `200 { supplier: T30 }`
#### List supplier articles by SKUs — `GET /supplier/{id}/articles`
- Params: `id: int, query: skus?: string`
- Returns: `200 { articles: { id: int, articleId: int, entityId: int, supplierName: str, sku: str, pu: num, stock: num, sort: int, priceId: int, price: T33, article: { id: int, sku: str, name: str, slug: str, photos: { sort: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str }[], eans: str[] } }[] }`
- Returns: `200 { articles: { id: int, articleId: int, entityId: int, supplierName: str, sku: str, pu: num, stock: num, sort: int, priceId: int, price: T34, article: { id: int, sku: str, name: str, slug: str, photos: { sort: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str }[], eans: str[] } }[] }`
#### Query supplier articles by SKUs (bulk) — `POST /supplier/{id}/articles`
- Params: `id: int, body?: { skus?: str[] }`
- Returns: `200 { articles: { id: int, articleId: int, entityId: int, supplierName: str, sku: str, pu: num, stock: num, sort: int, priceId: int, price: T33, article: { id: int, sku: str, name: str, slug: str, photos: { sort: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str }[], eans: str[] } }[] }`
- Returns: `200 { articles: { id: int, articleId: int, entityId: int, supplierName: str, sku: str, pu: num, stock: num, sort: int, priceId: int, price: T34, article: { id: int, sku: str, name: str, slug: str, photos: { sort: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str }[], eans: str[] } }[] }`
#### Delete unit — `DELETE /unit`
- Params: `query: si: str`
- Returns: `204 void`
#### List units — `GET /unit`
_none_
- Returns: `200 { units: { si: str, basesi: str, basesifactor: num, symbol: str, name: str }[] }`
- Returns: `200 { units: T26[] }`
#### Upsert unit — `PUT /unit`
- Params: `body: { si: str, basesi: str, basesifactor: num, symbol: str, name: str }`
- Returns: `200 { unit: { si: str, basesi: str, basesifactor: num, symbol: str, name: str } }`
- Returns: `200 { unit: T26 }`
#### List warehouses — `GET /warehouse`
_none_
- Returns: `200 { warehouses: T34[] }`
- Returns: `200 { warehouses: T35[] }`
#### Create warehouse — `POST /warehouse`
- Params: `body: { name: str, sort?: int }`
- Returns: `201 T32`
- Returns: `201 T33`
#### Reorder warehouses — `PUT /warehouse/order`
- Params: `body: { warehouseIds: int[] }`
- Returns: `200 { warehouseIds: int[] }`
@@ -474,13 +475,13 @@ _none_
- Returns: `204 void`
#### Get warehouse by ID — `GET /warehouse/{id}`
- Params: `id: int`
- Returns: `200 T32`
- Returns: `200 T33`
#### Update warehouse (partial) — `PATCH /warehouse/{id}`
- Params: `id: int, body: { name?: str, sort?: int }`
- Returns: `200 T32`
- Returns: `200 T33`
#### Update warehouse — `PUT /warehouse/{id}`
- Params: `id: int, body: { name?: str, sort?: int }`
- Returns: `200 T32`
- Returns: `200 T33`
### Binary & streaming routes (reachable only via `fetch()` in javascript_execute)
These routes are NOT in the table above because their responses are binary or long-lived streams, which the `dashback_request` tool cannot return usefully. They ARE reachable from inside `javascript_execute` with `fetch("/route")`, where you can decode the bytes, write them to the VFS and embed them in your reply: