This commit is contained in:
seb
2026-10-06 04:43:35 +02:00
parent 75ab6ce171
commit fe5990af9f
8 changed files with 571 additions and 104 deletions

View File

@@ -1,6 +1,6 @@
# Dash API Routes Overview (All)
Overview of all 180 API endpoints across all modules.
Overview of all 182 API endpoints across all modules.
### Notation
@@ -10,18 +10,18 @@ Params: path values first, then `query:` and `body:` (`body?` = optional body).
### 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: T27[], suppliers: T9[] }`
- `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: T28[], suppliers: T9[] }`
- `T3` = `{ delivery: T4 }`
- `T4` = `{ id: int, number: str, type: str, supplierId: int, externalNumber: str, date: str, createdAt: str, ledger: T32, lines: T18[], files: T8[] }`
- `T4` = `{ id: int, number: str, type: str, supplierId: int, externalNumber: str, date: str, createdAt: str, ledger: T33, 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: T35 }`
- `T9` = `{ id: int, articleId: int, entityId: int, supplierName: str, sku: str, pu: num, stock: num, sort: int, priceId: int, price: T36 }`
- `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: T30[] }`
- `T13` = `{ id: int, name: str, sort: int, exclusive: bool, values: T31[] }`
- `T14` = `{ entity: T20 }`
- `T15` = `{ printer: T21 }`
- `T16` = `{ labeltemplate: T23 }`
@@ -32,26 +32,27 @@ Params: path values first, then `query:` and `body:` (`body?` = optional body).
- `T21` = `{ id: int, company_id: int, address: str, type: str, model: str, serial: str, sort: int, desc: str }`
- `T22` = `{ amount: num, net: num, taxrate: num, sku?: str, name?: str, pu?: num, rebate?: num, comment?: str }`
- `T23` = `{ id: int, name: str, width: num, height: num, dpi: int, type: str, content: obj, thumb: str }`
- `T24` = `{ article: T26 }`
- `T25` = `{ id: int, iso639: str, name: str, taxrate: num, reducedtaxrate: num }`
- `T26` = `{ id: int, categoryId: int, name: str, sku: str, track_stock: bool }`
- `T27` = `{ minmultiplier: num, net: num, taxRate: num, customergroupId: int }`
- `T28` = `{ id: int, email: str, selectedCompanyId: int, picture: str }`
- `T29` = `{ id: int, entityId: int, contactType: str, contact: str }`
- `T30` = `{ id: int, attributeId: int, value: str, sort: int }`
- `T31` = `{ id: int, name: str, createdAt: str, updatedAt: str }`
- `T32` = `{ totalPositions: int, completelyOnLedgerPositions: int }`
- `T33` = `{ id: int, name: str, sort: int, exclusive: bool }`
- `T34` = `{ warehouse: T36 }`
- `T35` = `{ net: num, taxId: int, taxRate: num }`
- `T36` = `{ id: int, name: str, sort: int }`
- `T37` = `{ id: int, categoryIds: int[] }`
- `T24` = `{ id: int, sort: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str }`
- `T25` = `{ article: T27 }`
- `T26` = `{ id: int, iso639: str, name: str, taxrate: num, reducedtaxrate: num }`
- `T27` = `{ id: int, categoryId: int, name: str, sku: str, track_stock: bool }`
- `T28` = `{ minmultiplier: num, net: num, taxRate: num, customergroupId: int }`
- `T29` = `{ id: int, email: str, selectedCompanyId: int, picture: str }`
- `T30` = `{ id: int, entityId: int, contactType: str, contact: str }`
- `T31` = `{ id: int, attributeId: int, value: str, sort: int }`
- `T32` = `{ id: int, name: str, createdAt: str, updatedAt: str }`
- `T33` = `{ totalPositions: int, completelyOnLedgerPositions: int }`
- `T34` = `{ id: int, name: str, sort: int, exclusive: bool }`
- `T35` = `{ warehouse: T37 }`
- `T36` = `{ net: num, taxId: int, taxRate: num }`
- `T37` = `{ id: int, name: str, sort: int }`
- `T38` = `{ id: int, categoryIds: int[] }`
### Routes
#### Create article in category — `POST /article`
- Params: `body: { categoryId: int, name: str, track_stock?: bool }`
- Returns: `201 T24`
- Returns: `201 T25`
#### Export articles as ZIP — `GET /article/export.zip`
- Params: `query: categoryId?: int`
- Returns: `200 zip`
@@ -87,10 +88,10 @@ Params: path values first, then `query:` and `body:` (`body?` = optional body).
- Returns: `200 { children: { id: int, sku: str, name: str, parentsort: int, attributeValueId: int, attributeValue: str }[] }`
#### Create and attach a new child article to a parent article — `POST /article/{sku}/children`
- Params: `sku: str, body: { attributeValueId?: int, value?: str, name?: str }`
- Returns: `201 T24`
- Returns: `201 T25`
#### 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: T26, children: obj[] }`
- Returns: `200 { article: T27, children: obj[] }`
#### 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 }`
@@ -117,7 +118,7 @@ Params: path values first, then `query:` and `body:` (`body?` = optional body).
- Returns: `200 { options: obj[] }`
#### Toggle parent mode for an article — `POST /article/{sku}/parent`
- Params: `sku: str, body: { isParent: bool, attributeNameId?: int }`
- Returns: `200 T24`
- Returns: `200 T25`
#### Replace POS prices by SKU — `PUT /article/{sku}/prices`
- Params: `sku: str, body: { prices: { price: num, tax: num, minmultiplier?: num }[] }`
- Returns: `200 T1`
@@ -165,10 +166,10 @@ _none_
- Returns: `200`
#### List values for an attribute — `GET /attributename/{attributeId}/value`
- Params: `attributeId: int`
- Returns: `200 { values: T30[] }`
- Returns: `200 { values: T31[] }`
#### Create value for an attribute — `POST /attributename/{attributeId}/value`
- Params: `attributeId: int, body: { value: str, sort?: int }`
- Returns: `201 { attributevalue: T30 }`
- Returns: `201 { attributevalue: T31 }`
#### Reorder values of an attribute — `PUT /attributename/{attributeId}/value/order`
- Params: `attributeId: int, body: { attributevalueIds: int[] }`
- Returns: `200`
@@ -183,28 +184,34 @@ _none_
- Returns: `200`
#### Update attribute value — `PATCH /attributevalue/{id}`
- Params: `id: int, body: { value?: str, sort?: int }`
- Returns: `200 { attributevalue: T30 }`
- Returns: `200 { attributevalue: T31 }`
#### Login with Google ID token — `POST /auth/login`
- Params: `body: { idToken: str }`
- Returns: `200 { message: str, user: T28 }`
- Returns: `200 { message: str, user: T29 }`
#### Logout — `POST /auth/logout`
_none_
- Returns: `200 { message: str }`
#### Current user — `GET /auth/me`
_none_
- Returns: `200 { user: T28, googleClientId: str }`
- Returns: `200 { user: T29, googleClientId: str }`
#### Set selected company — `PUT /auth/selected-company`
- Params: `body: { companyId: int }`
- Returns: `200 { user: T28 }`
- Returns: `200 { user: T29 }`
#### List brands — `GET /brand`
_none_
- Returns: `200 { brands: { id: int, name: str, gsprpinfo: str, pics: { id: int, sort: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str }[] }[] }`
- Returns: `200 { brands: { id: int, name: str, gsprpinfo: str, pics: T24[] }[] }`
#### Upsert brand — `PUT /brand`
- Params: `body: { name: str, gsprpinfo?: str }`
- Returns: `200 { brand: { id: int, name: str, gsprpinfo: str, pics: { id: int, sort: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str }[] } }`
- Returns: `200 { brand: { id: int, name: str, gsprpinfo: str, pics: T24[] } }`
#### 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: T24[] } }`
#### 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: T24[] } }`
#### Create category — `POST /category`
- Params: `body: { parentId: int, name: str }`
- Returns: `201 { category: { id: int, parentId: int, sort: int, name: str } }`
@@ -249,10 +256,10 @@ _none_
- Returns: `200`
#### List companies — `GET /company`
_none_
- Returns: `200 { companies: T25[] }`
- Returns: `200 { companies: T26[] }`
#### Create company — `POST /company`
- Params: `body: { iso639: str, name: str, taxrate: num, reducedtaxrate: num }`
- Returns: `201 { company: T25, user: T28 }`
- Returns: `201 { company: T26, user: T29 }`
#### Get company history — `GET /company/history`
- Params: `query: limit?: int`
- Returns: `200 { history: { id: int, companyuserId: int, date: str, text: str }[], truncated: bool }`
@@ -273,13 +280,13 @@ _none_
- Returns: `204 void`
#### Update company — `PUT /company/{id}`
- Params: `id: int, body: { iso639: str, name: str, taxrate: num, reducedtaxrate: num }`
- Returns: `200 { company: T25 }`
- Returns: `200 { company: T26 }`
#### List customer groups — `GET /customergroup`
_none_
- Returns: `200 { customergroups: { id: int, name: str, sort: int, editable: bool }[] }`
#### Create customer group — `POST /customergroup`
- Params: `body: { name: str }`
- Returns: `201 { customergroup: T36 }`
- Returns: `201 { customergroup: T37 }`
#### Reorder customer groups — `PUT /customergroup/order`
- Params: `body: { customergroupIds: int[] }`
- Returns: `200 { customergroupIds: int[] }`
@@ -288,10 +295,10 @@ _none_
- Returns: `204 void`
#### Update customer group — `PATCH /customergroup/{id}`
- Params: `id: int, body: { name: str }`
- Returns: `200 { customergroup: T36 }`
- Returns: `200 { customergroup: T37 }`
#### List deliveries — `GET /delivery`
_none_
- Returns: `200 { deliveries: { id: int, number: str, type: str, supplierId: int, externalNumber: str, date: str, createdAt: str, ledger: T32 }[] }`
- Returns: `200 { deliveries: { id: int, number: str, type: str, supplierId: int, externalNumber: str, date: str, createdAt: str, ledger: T33 }[] }`
#### Create delivery — `POST /delivery`
- Params: `body: { externalNumber: str, date: str, lines: T22[], supplierId?: int, files?: { mimetype: str, name: str, content: str, sort?: int, size?: int, hash?: str, created?: str, modified?: str, meta?: obj }[] }`
- Returns: `201 T3`
@@ -333,16 +340,16 @@ _none_
- Returns: `200 { address: T12 }`
#### List entity contacts — `GET /entity/{entityId}/contact`
- Params: `entityId: int`
- Returns: `200 { contacts: T29[] }`
- Returns: `200 { contacts: T30[] }`
#### Create entity contact — `POST /entity/{entityId}/contact`
- Params: `entityId: int, body: { contactType: str, contact: str }`
- Returns: `201 { contact: T29 }`
- Returns: `201 { contact: T30 }`
#### 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: T29 }`
- Returns: `200 { contact: T30 }`
#### Delete entity — `DELETE /entity/{id}`
- Params: `id: int`
- Returns: `204 void`
@@ -444,16 +451,16 @@ _none_
- Returns: `204 void`
#### Disable all categories on terminal — `DELETE /posterminal/{id}/all`
- Params: `id: int`
- Returns: `200 T37`
- Returns: `200 T38`
#### Enable all categories on terminal — `PUT /posterminal/{id}/all`
- Params: `id: int`
- Returns: `200 T37`
- Returns: `200 T38`
#### Disable category on terminal — `DELETE /posterminal/{id}/category/{categoryId}`
- Params: `id: int, categoryId: int`
- Returns: `200 T37`
- Returns: `200 T38`
#### Enable category on terminal — `PUT /posterminal/{id}/category/{categoryId}`
- Params: `id: int, categoryId: int`
- Returns: `200 T37`
- Returns: `200 T38`
#### List printers — `GET /printer`
_none_
- Returns: `200 { printers: T21[] }`
@@ -477,10 +484,10 @@ _none_
- Returns: `200 T15`
#### List property names — `GET /propertyname`
_none_
- Returns: `200 { propertynames: T33[] }`
- Returns: `200 { propertynames: T34[] }`
#### Create property name — `POST /propertyname`
- Params: `body: { name: str, sort?: int, exclusive?: bool }`
- Returns: `201 { propertyname: T33 }`
- Returns: `201 { propertyname: T34 }`
#### Reorder property names — `PUT /propertyname/order`
- Params: `body: { propertynameIds: int[] }`
- Returns: `200`
@@ -489,7 +496,7 @@ _none_
- Returns: `200`
#### Update property name — `PATCH /propertyname/{id}`
- Params: `id: int, body: { name?: str, sort?: int, exclusive?: bool }`
- Returns: `200 { propertyname: T33 }`
- Returns: `200 { propertyname: T34 }`
#### List public articles — `GET /public/{companyId}/articles`
- Params: `companyId: int, query: categoryId?: int, search?: str, limit?: int, offset?: int`
- Returns: `200 { articles: { id: int, sku: str, name: str, slug: str, net: num, taxRate: num, gross: num, trackStock: bool, brand: { id: int, name: str }, fullHash: str, thumbW: int, thumbH: int, thumbHash: str }[] }`
@@ -525,22 +532,22 @@ _none_
- Returns: `201 { manifest: { id: int, number: str, type: str, date: str, createdAt: str }, lines: obj[], ledger: T11[] }`
#### List suppliers — `GET /supplier`
_none_
- Returns: `200 { suppliers: T31[] }`
- Returns: `200 { suppliers: T32[] }`
#### Create supplier — `POST /supplier`
- Params: `body: { name: str }`
- Returns: `201 { supplier: T31 }`
- Returns: `201 { supplier: T32 }`
#### 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: T31 }`
- Returns: `200 { supplier: T32 }`
#### 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: T35, 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: T36, 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: T35, 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: T36, article: { id: int, sku: str, name: str, slug: str, photos: { sort: int, fullHash: str, thumbW: int, thumbH: int, thumbHash: str }[], eans: str[] } }[] }`
#### Thumb image by hash — `GET /thumb/{fullHash}`
- Params: `fullHash: str`
- Returns: `200 avif`
@@ -570,10 +577,10 @@ _none_
- Returns: `200 str`
#### List warehouses — `GET /warehouse`
_none_
- Returns: `200 { warehouses: T36[] }`
- Returns: `200 { warehouses: T37[] }`
#### Create warehouse — `POST /warehouse`
- Params: `body: { name: str, sort?: int }`
- Returns: `201 T34`
- Returns: `201 T35`
#### Reorder warehouses — `PUT /warehouse/order`
- Params: `body: { warehouseIds: int[] }`
- Returns: `200 { warehouseIds: int[] }`
@@ -582,10 +589,10 @@ _none_
- Returns: `204 void`
#### Get warehouse by ID — `GET /warehouse/{id}`
- Params: `id: int`
- Returns: `200 T34`
- Returns: `200 T35`
#### Update warehouse (partial) — `PATCH /warehouse/{id}`
- Params: `id: int, body: { name?: str, sort?: int }`
- Returns: `200 T34`
- Returns: `200 T35`
#### Update warehouse — `PUT /warehouse/{id}`
- Params: `id: int, body: { name?: str, sort?: int }`
- Returns: `200 T34`
- Returns: `200 T35`