πŸ“¦Stocks

This page provides a description of the available API routes for managing stocks.

Each Product (represented by Plu model) is associated with stock through its StockName property. Stocks are represented by Stock class and uniquely identified by their names (stock.Name property). A stock can group multiple products (e.g. stock called "Menu" that contains products that can be listed in cash register and stock called "Material" that contains raw materials and other resources in kitchen). Each product has a unique code (plu.Code property) within its respective stock.

API methods

Get stocks

GET http://{server-address}/stocks

Returns all stocks that matches query parameters. Result is of type QueryResult<Stock>.

Query Parameters

NameTypeDescription

name

string

Supports NData syntax.

$skip

int

Pagination property. Describing number of records to skip from beginning of result collection.

$take

int

Pagination property. Maximum count of items to be returned.

$sort

string[]

Comma separated list of property names. Please see NData syntax.

$count

bool

If set to true, response will not contain items collection. Use to get resource count, not the resources themselves.

Headers

NameTypeDescription

Authorization*

string

Authorization header with authorization token.

{
    "items":
    [
        {
            "name": "S01",
            "description": "Menu",
            "_v": 2
        },
        {
            "name": "S11",
            "description": "Suroviny a zΓ‘soby",
            "_v": 2
        }
    ],
    "count": 2,
    "totalCount": 2
}

Get stock by name

GET http://{server-address}/stocks/{name}

Result is of type Stock.

Path Parameters

NameTypeDescription

name*

string

Unique stock name.

Headers

NameTypeDescription

Authorization*

string

Authorization header with authorization token.

{
    "name": "S01",
    "description": "Menu",
    "_v": 1
}

Create stock

POST http://{server-address}/stocks

Creates new stock. Result is of type Stock.

Required rights

Authorized user must have StockCreate right assigned.

Headers

NameTypeDescription

Authorization*

string

Authorization header with authorization token.

Request Body

NameTypeDescription

(body)*

Stock

Model to create

{
    "name": "S01",
    "description": "Menu",
    "_v": 2
}

Create or update stock

PUT http://{server-address}/stocks/{name}

Updates existing or creates new stock. Result is of type Stock.

Required rights

Authorized user must have assigned StockCreate or StockUpdate right.

Path Parameters

NameTypeDescription

name*

string

Unique stock name.

Headers

NameTypeDescription

Authorization*

string

Authorization header with authorization token.

Request Body

NameTypeDescription

(body)*

Stock

Model to create or update.

{
    "name": "S01",
    "description": "Menu",
    "_v": 2
}

Delete stock by name

DELETE http://{server-address}/stocks/{name}

Required rights

Authorized user must have StockDelete right assigned.

Path Parameters

NameTypeDescription

name*

string

Unique stock name.

Headers

NameTypeDescription

Authorization*

string

Authorization header with authorization token.

{
    "name": "S01",
    "description": "Menu",
    "_v": 2
}

Last updated