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 stock takings
  • Get stock taking
  • Create stock taking
  • Create or update stock taking
  • Delete stock taking

Was this helpful?

  1. API reference

Stock takings

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

PreviousSettingsNextStock transfer numbering

Last updated 1 year ago

Was this helpful?

Stock taking (represented by class) is a method to adjust stock quantities for various stock items (Plu of type StockItem). These adjustments can be made multiple times until the stock taking is marked as closed by providing values for the ClosedBy and ClosedAt fields. Once a stock taking is closed, it becomes read-only and cannot be reopened. To close a stock taking, ActualQuantity must be provided for each item element (represented by class).

After a stock taking is closed, the API server automatically generates a new stock transfer (represented by class) with the type correction. This stock transfer is used to execute the necessary stock quantity corrections for the items involved in the stock taking process.

API methods

Get stock takings

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

Returns all stocks that matches query parameters. Result is of type .

Query Parameters

Name
Type
Description

id

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.

createdAt

DateTime

Supports NData syntax.

createdByUserName

string

Only stock takings containing item with matching StockTaking.CreatedBy.UserName property are returned. Supports NData syntax.

closedAt

DateTime

Supports NData syntax.

closedByUserName

string

Only stock takings containing item with matching StockTaking.ClosedBy.UserName property are returned. Supports NData syntax.

currencyLabel

string

Supports NData syntax.

itemPluStockName

string

Only stock takings containing item with matching StockTakingItem.Plu.StockName property are returned. Supports NData syntax.

itemPluCode

int

Only stock takings containing item with matching StockTakingItem.Plu.Code property are returned. Supports NData syntax.

Headers

Name
Type
Description

Authorization*

string

Authorization header with authorization token.

{
    "items":
    [
        {
            "id": "64cfa2153a6484c761208b8c",
            "createdAt": "2023-08-06T13:37:25.728Z",
            "closedAt": null,
            "createdBy":
            {
                "name": "MajiteΔΎ",
                "userName": "999",
                "featureName": null
            },
            "closedBy": null,
            "currencyLabel": "EUR",
            "items":
            [
                {
                    "expectedQuantity":
                    {
                        "amount": 15.0,
                        "unit": "ks"
                    },
                    "actualQuantity":
                    {
                        "amount": 12.0,
                        "unit": "ks"
                    },
                    "plu":
                    {
                        "name": "Coca Cola 0,33l",
                        "code": 5,
                        "codes":
                        [],
                        "stockName": "S01",
                        "articleCategoryLabel": "DRI",
                        "vat":
                        {
                            "category": 1,
                            "rate": 20.0
                        },
                        "unitPurchasePrice":
                        {
                            "amount": 0.0,
                            "currencyLabel": "EUR"
                        },
                        "unitRetailPrice":
                        {
                            "amount": 3.491667,
                            "currencyLabel": "EUR"
                        }
                    }
                },
                {
                    "expectedQuantity":
                    {
                        "amount": 6.0,
                        "unit": "ks"
                    },
                    "actualQuantity":
                    {
                        "amount": 5.0,
                        "unit": "ks"
                    },
                    "plu":
                    {
                        "name": "Fanta 0.33l",
                        "code": 6,
                        "codes":
                        [],
                        "stockName": "S01",
                        "articleCategoryLabel": "DRI",
                        "vat":
                        {
                            "category": 1,
                            "rate": 20.0
                        },
                        "unitPurchasePrice":
                        {
                            "amount": 0.0,
                            "currencyLabel": "EUR"
                        },
                        "unitRetailPrice":
                        {
                            "amount": 3.491667,
                            "currencyLabel": "EUR"
                        }
                    }
                },
                {
                    "expectedQuantity":
                    {
                        "amount": 11.0,
                        "unit": "ks"
                    },
                    "actualQuantity": null,
                    "plu":
                    {
                        "name": "Sprite 0.33l",
                        "code": 7,
                        "codes":
                        [],
                        "stockName": "S01",
                        "articleCategoryLabel": "DRI",
                        "vat":
                        {
                            "category": 1,
                            "rate": 20.0
                        },
                        "unitPurchasePrice":
                        {
                            "amount": 0.0,
                            "currencyLabel": "EUR"
                        },
                        "unitRetailPrice":
                        {
                            "amount": 3.491667,
                            "currencyLabel": "EUR"
                        }
                    }
                }
            ],
            "_v": 1
        }
    ],
    "count": 1,
    "totalCount": 1
}

Get stock taking

GET http://{server-address}/stocktakings/{id}

Path Parameters

Name
Type
Description

id*

string

Unique identifier.

Headers

Name
Type
Description

Authorization*

string

Authorization header with authorization token.

{
    "id": "64cfa2153a6484c761208b8c",
    "createdAt": "2023-08-06T13:37:25.728Z",
    "closedAt": null,
    "createdBy":
    {
        "name": "MajiteΔΎ",
        "userName": "999",
        "featureName": null
    },
    "closedBy": null,
    "currencyLabel": "EUR",
    "items":
    [
        {
            "expectedQuantity":
            {
                "amount": 15.0,
                "unit": "ks"
            },
            "actualQuantity":
            {
                "amount": 12.0,
                "unit": "ks"
            },
            "plu":
            {
                "name": "Coca Cola 0,33l",
                "code": 5,
                "codes":
                [],
                "stockName": "S01",
                "articleCategoryLabel": "DRI",
                "vat":
                {
                    "category": 1,
                    "rate": 20.0
                },
                "unitPurchasePrice":
                {
                    "amount": 0.0,
                    "currencyLabel": "EUR"
                },
                "unitRetailPrice":
                {
                    "amount": 3.491667,
                    "currencyLabel": "EUR"
                }
            }
        },
        {
            "expectedQuantity":
            {
                "amount": 6.0,
                "unit": "ks"
            },
            "actualQuantity":
            {
                "amount": 5.0,
                "unit": "ks"
            },
            "plu":
            {
                "name": "Fanta 0.33l",
                "code": 6,
                "codes":
                [],
                "stockName": "S01",
                "articleCategoryLabel": "DRI",
                "vat":
                {
                    "category": 1,
                    "rate": 20.0
                },
                "unitPurchasePrice":
                {
                    "amount": 0.0,
                    "currencyLabel": "EUR"
                },
                "unitRetailPrice":
                {
                    "amount": 3.491667,
                    "currencyLabel": "EUR"
                }
            }
        },
        {
            "expectedQuantity":
            {
                "amount": 11.0,
                "unit": "ks"
            },
            "actualQuantity": null,
            "plu":
            {
                "name": "Sprite 0.33l",
                "code": 7,
                "codes":
                [],
                "stockName": "S01",
                "articleCategoryLabel": "DRI",
                "vat":
                {
                    "category": 1,
                    "rate": 20.0
                },
                "unitPurchasePrice":
                {
                    "amount": 0.0,
                    "currencyLabel": "EUR"
                },
                "unitRetailPrice":
                {
                    "amount": 3.491667,
                    "currencyLabel": "EUR"
                }
            }
        }
    ],
    "_v": 1
}
{
    "title": "Zdroj nebol nΓ‘jdenΓ½",
    "status": 404
}

Create stock taking

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

Required rights

Headers

Name
Type
Description

Authorization*

string

Authorization header with authorization token.

Request Body

Name
Type
Description

(body)*

StockTaking

Model to create

{
    "id": "64cfa2153a6484c761208b8c",
    "createdAt": "2023-08-06T13:37:25.728Z",
    "closedAt": null,
    "createdBy":
    {
        "name": "MajiteΔΎ",
        "userName": "999",
        "featureName": null
    },
    "closedBy": null,
    "currencyLabel": "EUR",
    "items":
    [
        {
            "expectedQuantity":
            {
                "amount": 15.0,
                "unit": "ks"
            },
            "actualQuantity":
            {
                "amount": 12.0,
                "unit": "ks"
            },
            "plu":
            {
                "name": "Coca Cola 0,33l",
                "code": 5,
                "codes":
                [],
                "stockName": "S01",
                "articleCategoryLabel": "DRI",
                "vat":
                {
                    "category": 1,
                    "rate": 20.0
                },
                "unitPurchasePrice":
                {
                    "amount": 0.0,
                    "currencyLabel": "EUR"
                },
                "unitRetailPrice":
                {
                    "amount": 3.491667,
                    "currencyLabel": "EUR"
                }
            }
        },
        {
            "expectedQuantity":
            {
                "amount": 6.0,
                "unit": "ks"
            },
            "actualQuantity":
            {
                "amount": 5.0,
                "unit": "ks"
            },
            "plu":
            {
                "name": "Fanta 0.33l",
                "code": 6,
                "codes":
                [],
                "stockName": "S01",
                "articleCategoryLabel": "DRI",
                "vat":
                {
                    "category": 1,
                    "rate": 20.0
                },
                "unitPurchasePrice":
                {
                    "amount": 0.0,
                    "currencyLabel": "EUR"
                },
                "unitRetailPrice":
                {
                    "amount": 3.491667,
                    "currencyLabel": "EUR"
                }
            }
        },
        {
            "expectedQuantity":
            {
                "amount": 11.0,
                "unit": "ks"
            },
            "actualQuantity": null,
            "plu":
            {
                "name": "Sprite 0.33l",
                "code": 7,
                "codes":
                [],
                "stockName": "S01",
                "articleCategoryLabel": "DRI",
                "vat":
                {
                    "category": 1,
                    "rate": 20.0
                },
                "unitPurchasePrice":
                {
                    "amount": 0.0,
                    "currencyLabel": "EUR"
                },
                "unitRetailPrice":
                {
                    "amount": 3.491667,
                    "currencyLabel": "EUR"
                }
            }
        }
    ],
    "_v": 1
}

Create or update stock taking

PUT http://{server-address}/stocktakings/{id}

Required rights

Only stock takings not marked as closed can be updated.

Path Parameters

Name
Type
Description

id*

string

Unique identifier.

Headers

Name
Type
Description

Authorization*

string

Authorization header with authorization token.

Request Body

Name
Type
Description

(body)*

StockTaking

Model to create or update.

{
    "id": "64cfa2153a6484c761208b8c",
    "createdAt": "2023-08-06T13:37:25.728Z",
    "closedAt": null,
    "createdBy":
    {
        "name": "MajiteΔΎ",
        "userName": "999",
        "featureName": null
    },
    "closedBy": null,
    "currencyLabel": "EUR",
    "items":
    [
        {
            "expectedQuantity":
            {
                "amount": 15.0,
                "unit": "ks"
            },
            "actualQuantity":
            {
                "amount": 12.0,
                "unit": "ks"
            },
            "plu":
            {
                "name": "Coca Cola 0,33l",
                "code": 5,
                "codes":
                [],
                "stockName": "S01",
                "articleCategoryLabel": "DRI",
                "vat":
                {
                    "category": 1,
                    "rate": 20.0
                },
                "unitPurchasePrice":
                {
                    "amount": 0.0,
                    "currencyLabel": "EUR"
                },
                "unitRetailPrice":
                {
                    "amount": 3.491667,
                    "currencyLabel": "EUR"
                }
            }
        },
        {
            "expectedQuantity":
            {
                "amount": 6.0,
                "unit": "ks"
            },
            "actualQuantity":
            {
                "amount": 5.0,
                "unit": "ks"
            },
            "plu":
            {
                "name": "Fanta 0.33l",
                "code": 6,
                "codes":
                [],
                "stockName": "S01",
                "articleCategoryLabel": "DRI",
                "vat":
                {
                    "category": 1,
                    "rate": 20.0
                },
                "unitPurchasePrice":
                {
                    "amount": 0.0,
                    "currencyLabel": "EUR"
                },
                "unitRetailPrice":
                {
                    "amount": 3.491667,
                    "currencyLabel": "EUR"
                }
            }
        },
        {
            "expectedQuantity":
            {
                "amount": 11.0,
                "unit": "ks"
            },
            "actualQuantity": null,
            "plu":
            {
                "name": "Sprite 0.33l",
                "code": 7,
                "codes":
                [],
                "stockName": "S01",
                "articleCategoryLabel": "DRI",
                "vat":
                {
                    "category": 1,
                    "rate": 20.0
                },
                "unitPurchasePrice":
                {
                    "amount": 0.0,
                    "currencyLabel": "EUR"
                },
                "unitRetailPrice":
                {
                    "amount": 3.491667,
                    "currencyLabel": "EUR"
                }
            }
        }
    ],
    "_v": 1
}

Delete stock taking

DELETE http://{server-address}/stocktakings/{id}

Required rights

Only stock takings not marked as closed can be deleted.

Path Parameters

Name
Type
Description

id*

string

Unique identifier.

Headers

Name
Type
Description

Authorization*

string

Authorization header with authorization token.

{
    "id": "64cfa2153a6484c761208b8c",
    "createdAt": "2023-08-06T13:37:25.728Z",
    "closedAt": null,
    "createdBy":
    {
        "name": "MajiteΔΎ",
        "userName": "999",
        "featureName": null
    },
    "closedBy": null,
    "currencyLabel": "EUR",
    "items":
    [
        {
            "expectedQuantity":
            {
                "amount": 15.0,
                "unit": "ks"
            },
            "actualQuantity":
            {
                "amount": 12.0,
                "unit": "ks"
            },
            "plu":
            {
                "name": "Coca Cola 0,33l",
                "code": 5,
                "codes":
                [],
                "stockName": "S01",
                "articleCategoryLabel": "DRI",
                "vat":
                {
                    "category": 1,
                    "rate": 20.0
                },
                "unitPurchasePrice":
                {
                    "amount": 0.0,
                    "currencyLabel": "EUR"
                },
                "unitRetailPrice":
                {
                    "amount": 3.491667,
                    "currencyLabel": "EUR"
                }
            }
        },
        {
            "expectedQuantity":
            {
                "amount": 6.0,
                "unit": "ks"
            },
            "actualQuantity":
            {
                "amount": 5.0,
                "unit": "ks"
            },
            "plu":
            {
                "name": "Fanta 0.33l",
                "code": 6,
                "codes":
                [],
                "stockName": "S01",
                "articleCategoryLabel": "DRI",
                "vat":
                {
                    "category": 1,
                    "rate": 20.0
                },
                "unitPurchasePrice":
                {
                    "amount": 0.0,
                    "currencyLabel": "EUR"
                },
                "unitRetailPrice":
                {
                    "amount": 3.491667,
                    "currencyLabel": "EUR"
                }
            }
        },
        {
            "expectedQuantity":
            {
                "amount": 11.0,
                "unit": "ks"
            },
            "actualQuantity": null,
            "plu":
            {
                "name": "Sprite 0.33l",
                "code": 7,
                "codes":
                [],
                "stockName": "S01",
                "articleCategoryLabel": "DRI",
                "vat":
                {
                    "category": 1,
                    "rate": 20.0
                },
                "unitPurchasePrice":
                {
                    "amount": 0.0,
                    "currencyLabel": "EUR"
                },
                "unitRetailPrice":
                {
                    "amount": 3.491667,
                    "currencyLabel": "EUR"
                }
            }
        }
    ],
    "_v": 1
}
{
    "title": "Zdroj nebol nΓ‘jdenΓ½",
    "status": 404
}

Result is of type .

Creates new stock taking. Result is of type .

Authorized user must have StockTakingCreate assigned. If stock taking is marked as closed, StockTakingClose is required as well.

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

Authorized user must have assigned StockTakingCreate or StockTakingUpdate . If stock taking is marked as closed, StockTakingClose is required as well.

Authorized user must have StockTakingDelete assigned.

πŸ”Ž
right
right
right
right
right
StockTaking
StockTakingItem
StockTransfer
QueryResult<StockTaking>
StockTaking
StockTaking
StockTaking