Zurück zu den Upload-Möglichkeiten
ItemController API Documentation
Base URL: https://{host}/
Most endpoints require a Bearer token in the Authorization header .
Authorization header format:
Authorization: Bearer {token}
Endpoints
1. POST /Items
Inserts a batch of spare parts into [tmp].[item_WS_inbox], one row per part, inside a single SQL transaction on the session's own connection (rolled back if any row fails).
Method: POST
URL: {{baseUrl}}/Items
Headers:
| Key | Value |
|---|---|
| Authorization | Bearer {{token}} |
| Content-Type | application/json |
Request Body: StockPost (see Model Reference)
{
"DealerID": "DEALER01",
"total": 1,
"parts": [
{
"rec_id": 0,
"department": "01",
"partnumber": "ABC-12345",
"description": "Filter, oil",
"description2": "",
"price": 123.45,
"inventory": 10,
"brand": "CASE",
"binlocation": "A-01-02",
"discount_pct": 5,
"supplieritemno": "SUP-99",
"suppliercode": "SC01",
"reorderpoint": 2,
"Lastdateofpurchase": "2024-01-15",
"Lastdateofsales": "2024-03-01"
}
]
}
Note: there is no per-part
dealer_idfield —ArticlePostdoesn't have one (see Model Reference). The dealer for every row in the batch comes from the single top-levelDealerIDfield above.
Note:
rec_id,description2, andsuppliercodeare accepted by the model but silently ignored .
Response:
0
Always returns 0 on success; this is not an affected-row count. Throws (HTTP 500) on failure, after rolling back the transaction.
2. POST /ItemsUpd
Identical request/response shape to POST /Items.
Method: POST
URL: {{baseUrl}}/ItemsUpd
Headers: Same as /Items.
Request Body: Same as /Items.
Response: 0 on success.
Model Reference
Article (shared base fields)
Base class for (ArticlePost) .
| Field | Type | Description |
|---|---|---|
| rec_id | integer | Database record ID. On ArticlePost this is accepted but ignored — the insert statement has no identity column, so any value sent is discarded. |
| department | string | Department code |
| partnumber | string | Part number |
| description | string | Part description |
| price | decimal | Unit sales price |
| inventory | decimal | Quantity on hand |
| brand | string | Manufacturer/brand code |
| binlocation | string | Bin/shelf location |
| discount_pct | integer | Discount/realisation percentage |
| supplieritemno | string | Supplier item number |
ArticlePost (extends Article) — request rows
Used for parts in the request body of POST /Items and POST /ItemsUpd.
| Field | Type | Description |
|---|---|---|
| description2 | string | Accepted but silently ignored — ItemSqlInsert always writes [description2] as an empty string regardless of what's sent. |
| reorderpoint | decimal | Reorder point quantity. Used. |
| Lastdateofpurchase | date | Date of last purchase (YYYY-MM-DD). Used. |
| Lastdateofsales | date | Date of last sale (YYYY-MM-DD). Used. |
| suppliercode | string | Accepted but silently ignored — always written as an empty string, same as description2. |
(plus all fields inherited from Article above — note rec_id is ignored, and there is no dealer_id field.)
StockPost (request body for POST /Items and POST /ItemsUpd)
| Field (JSON key) | C# property | Type | Description |
|---|---|---|---|
| DealerID | dealerID | string | Dealer identifier applied to every part in the batch (there is no per-part override — see ArticlePost above). |
| total | totalrecs | integer | Informational part count; not validated against the actual length of parts. |
| parts | Parts | ArticlePost[] | Array of parts to insert. |
Error Handling
| Scenario | Message |
|---|---|
Missing Authorization header (/Items, /ItemsUpd, GET /Items, /Item) |
Missing Token. |
Item insert/update failure (/Items, /ItemsUpd) |
Transaction rolled back, original exception rethrown (HTTP 500) |
All uncaught exceptions surface as an HTTP 500 response containing the exception message, unless otherwise noted.
Postman Environment Variables
| Variable | Description |
|---|---|
| baseUrl | Base URL, e.g. https://api.example.com |
| token | Bearer token from login |