PORTOS Developers
  • πŸ‘‹Introduction
  • πŸ“–Glossary
  • HTTP Status codes
  • Error models
  • Error codes
  • Validation constraints
  • Resource names
  • πŸ”’User rights
  • Device environments
  • 🌍Localization
  • πŸ”NData query syntax
  • OpenAPI specification
  • Data models
  • Authentication
    • πŸ”Authentication schemes
      • JWT Bearer Authentication
      • HMAC Authentication
  • ⚑Notifications
    • SignalR
    • Webhooks
  • API reference
    • πŸ”‘API keys
    • πŸ›οΈArticle categories
    • πŸ’ΌCompanies
    • πŸ’±Currencies
    • πŸ‘«Customers
    • πŸ“ˆDaily sales reports
    • πŸ–₯️Devices
    • πŸ–¨οΈFiscals
    • ❀️Health check
    • πŸ“ƒLicense
    • 🎚️Modifiers
    • πŸ‘¨β€πŸ³Order endpoints
    • πŸ›ŽοΈOrders
    • πŸͺ™Payment types
    • β˜•Plus
    • πŸ”Roles
    • πŸ”Sessions
    • βš™οΈSettings
    • πŸ”ŽStock takings
    • πŸ”’Stock transfer numbering
    • 🚚Stock transfers
    • πŸ“¦Stocks
    • 🧾Tickets
      • Ticket Model States
      • Ticket Operations and User Rights
      • Ticket Model Mathematics
    • πŸ‘¨β€πŸ’ΌUsers
    • βš–οΈVats
    • πŸͺ‘Zones
  • 3rd Party Integrations
    • Introduction
    • Online orders API
    • Rewards API
    • PDA Files
  • Previous versions
    • Migration to V4.1
    • Migration to V4
    • Legacy documentation
Powered by GitBook
On this page
  • API methods
  • Get stocks
  • Get stock by name
  • Create stock
  • Create or update stock
  • Delete stock by name

Was this helpful?

  1. API reference

Stocks

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

PreviousStock transfersNextTickets

Last updated 10 months ago

Was this helpful?

Each Product (represented by model) is associated with stock through its StockName property. Stocks are represented by 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 .

Query Parameters

Name
Type
Description

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

Name
Type
Description

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}

Path Parameters

Name
Type
Description

name*

string

Unique stock name.

Headers

Name
Type
Description

Authorization*

string

Authorization header with authorization token.

{
    "name": "S01",
    "description": "Menu",
    "_v": 1
}
{
    "title": "Zdroj nebol nΓ‘jdenΓ½",
    "status": 404
}

Create stock

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

Required rights

Headers

Name
Type
Description

Authorization*

string

Authorization header with authorization token.

Request Body

Name
Type
Description

(body)*

Stock

Model to create

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

Create or update stock

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

Required rights

Path Parameters

Name
Type
Description

name*

string

Unique stock name.

Headers

Name
Type
Description

Authorization*

string

Authorization header with authorization token.

Request Body

Name
Type
Description

(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

Path Parameters

Name
Type
Description

name*

string

Unique stock name.

Headers

Name
Type
Description

Authorization*

string

Authorization header with authorization token.

{
    "name": "S01",
    "description": "Menu",
    "_v": 2
}
{
    "title": "Zdroj nebol nΓ‘jdenΓ½",
    "status": 404
}

Result is of type .

Creates new stock. Result is of type .

Authorized user must have StockCreate assigned.

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

Authorized user must have assigned StockCreate or StockUpdate .

Authorized user must have StockDelete assigned.

πŸ“¦
right
right
right
Plu
Stock
QueryResult<Stock>
Stock
Stock
Stock