Appearance
Goods
Get all goods
Method : GET
Endpoint : /api/goods
{
"results": [
...
{
"GOOD_ID": 3,
"SUBGROUP_ID": 2,
"MEASURE_ID": 5,
"CODE1": "",
"CODE2": "",
"CODE3": "",
"CODE4": "",
"CODE5": "",
"WEB_ORDER": 42,
"PRICE_TYPE": "C",
"GOOD_SELL_PRICE": "123",
"PROFIT_PERCENT": "0",
"STOCK_MIN": 3,
"IS_AKCIJA": true,
"DISCOUNT_PERCENT": "0.000000",
"NEW_PRODUCT": false,
"IS_REVERSE_VAT": null,
"WEB_ORDER_STEP": null,
"WEB_ORDER_MIN": null,
"MANUFACTURER_ID": null,
"POPULAR_ITEM": false,
"ONLY_REGISTERED_USERS": false,
"SIZE": "",
"MAIN_GOOD": false,
"IN_STOCK": "0.000000",
"IS_SPLITABLE": false,
"CAN_ORDER": false,
"REVERSE_VAT_TYPE": null,
"PVN_RATE": 21,
"files": [],
"WEB_VISIBLE": false,
"content": [
{
"GOOD_ID": 3,
"LANG_ID": 1,
"TITLE": "Preces nosaukums",
"WEB_TITLE": null,
"WEB_ID": "preces-nosaukums",
"DESCRIPTION": null,
"META_KEYWORDS": null,
"META_DESCRIPTION": null
}
],
"duplicates": [],
"stock_amount": [],
"params": [],
"images": [],
"prices": [],
"measure": {
"MEASURE_ID": 1,
"DEFAULT_NAME": "gab",
"SORT_ORDER": null,
"ASK_FOR_AMOUNT": false
},
"packaging": [],
"web_visible": [],
"client_prices": []
}
...
],
"total": 123,
"count": 100,
"offset": 0,
"next": "/goods?offset=100"
}TIP
The request returns 100 goods by default. In order to get the next 100 goods you have to pass the offset parameter as seen below:
https://<yourdomain>/api/goods?token=<your_token>&offset=100
URL to the next page is also returned at the end of each request under the next key. You can use it to loop through and get all goods.
Get only changed goods
Method : GET
Endpoint : /api/goods/changes
TIP
Returns changed goods by default within the last hour or specified timestamp (if date is specified). Example:
https://<yourdomain>/api/goods/changes?token=<your_token>&date=1672527661
Get single good
Method : GET
Endpoint : /api/goods/{id}
{
"GOOD_ID": 3,
"SUBGROUP_ID": 2,
"MEASURE_ID": 5,
"CODE1": "",
"CODE2": "",
"CODE3": "",
"CODE4": "",
"CODE5": "",
"WEB_ORDER": 42,
"PRICE_TYPE": "C",
"GOOD_SELL_PRICE": "123",
"PROFIT_PERCENT": "0",
"STOCK_MIN": 3,
"IS_AKCIJA": true,
"DISCOUNT_PERCENT": "0.000000",
"NEW_PRODUCT": false,
"IS_REVERSE_VAT": null,
"WEB_ORDER_STEP": null,
"WEB_ORDER_MIN": null,
"MANUFACTURER_ID": null,
"POPULAR_ITEM": false,
"ONLY_REGISTERED_USERS": false,
"SIZE": "",
"MAIN_GOOD": false,
"IN_STOCK": "0.000000",
"IS_SPLITABLE": false,
"CAN_ORDER": false,
"REVERSE_VAT_TYPE": null,
"PVN_RATE": 21,
"files": [],
"WEB_VISIBLE": false,
"content": [
{
"GOOD_ID": 3,
"LANG_ID": 1,
"TITLE": "Preces nosaukums",
"WEB_TITLE": null,
"WEB_ID": "preces-nosaukums",
"DESCRIPTION": null,
"META_KEYWORDS": null,
"META_DESCRIPTION": null
}
],
"duplicates": [],
"stock_amount": [],
"params": [],
"images": [],
"prices": [],
"measure": {
"MEASURE_ID": 1,
"DEFAULT_NAME": "gab",
"SORT_ORDER": null,
"ASK_FOR_AMOUNT": false
},
"packaging": [],
"web_visible": [],
"client_prices": []
}Insert a good
Method : POST
Endpoint /api/goods
| Field | Type | Required |
|---|---|---|
| SUBGROUP_ID | Integer,Id | ✔ |
| MEASURE | String | ✔ |
| CODE1 | Integer,Id | ✔ |
| CODE2 | Integer,Id | |
| CODE3 | Integer,Id | |
| CODE4 | Integer,Id | |
| CODE5 | Integer,Id | |
| WEB_ORDER | Integer | |
| PRICE_TYPE | Integer | |
| GOOD_SELL_PRICE | Integer | |
| PROFIT_PERCENT | Integer | |
| STOCK_MIN | Integer | |
| IS_AKCIJA | Integer | |
| DISCOUNT_PERCENT | Integer | |
| NEW_PRODUCT | Integer | |
| IS_REVERSE_VAT | Integer | |
| WEB_ORDER_STEP | Integer | |
| WEB_ORDER_MIN | Integer | |
| MANUFACTURER_ID | Integer | |
| POPULAR_ITEM | Integer | |
| ONLY_REGISTERED_USERS | Integer | |
| SIZE | Integer | |
| MAIN_GOOD | Integer | |
| IN_STOCK | Integer | |
| IS_SPLITABLE | Integer | |
| CAN_ORDER | Integer | |
| REVERSE_VAT_TYPE | Integer | |
| PVN_RATE | Integer | |
| content | Object | ✔ |
| content@LANG_ID | Integer,Id | ✔ |
| content@TITLE | String | ✔ |
| content@DESCRIPTION | Text | |
| content@META_KEYWORDS | Text | |
| content@META_DESCRIPTION | Text | |
| duplicates | Object | |
| duplicates@SUBGROUP_ID | Integer,Id | |
| duplicates@CODE | String | |
| params | Object | |
| params@PARAM_ID | Integer,Id | |
| params@LANG_ID | Integer,Id | |
| params@PARAM_VALUE | String | |
| web_visible | Object | |
| web_visible@ETRADER_SITE_ID | Integer,Id |
Example
{
"SUBGROUP_ID": 2,
"MEASURE": "gab.",
"CODE1": "TEST",
"CODE2": "",
"CODE3": "",
"CODE4": "",
"CODE5": "",
"WEB_ORDER": 42,
"PRICE_TYPE": "C",
"GOOD_SELL_PRICE": "123",
"PROFIT_PERCENT": "0",
"STOCK_MIN": 3,
"IS_AKCIJA": true,
"DISCOUNT_PERCENT": "0.000000",
"NEW_PRODUCT": false,
"IS_REVERSE_VAT": null,
"WEB_ORDER_STEP": null,
"WEB_ORDER_MIN": null,
"MANUFACTURER_ID": null,
"POPULAR_ITEM": false,
"ONLY_REGISTERED_USERS": false,
"SIZE": "",
"MAIN_GOOD": false,
"IN_STOCK": "0.000000",
"IS_SPLITABLE": false,
"CAN_ORDER": false,
"REVERSE_VAT_TYPE": null,
"PVN_RATE": 21,
"content": [
{
"GOOD_ID": 3,
"LANG_ID": 1,
"TITLE": "Preces nosaukums",
"WEB_TITLE": null,
"WEB_ID": "preces-nosaukums",
"DESCRIPTION": null,
"META_KEYWORDS": null,
"META_DESCRIPTION": null
}
],
"duplicates": [],
"params": [],
"web_visible": []
}Update good
Method : PUT
Endpoint /api/goods/{id}
{
"SUBGROUP_ID": 2,
"MEASURE": "gab.",
"CODE1": "TEST",
"CODE2": "",
"CODE3": "",
"CODE4": "",
"CODE5": "",
"WEB_ORDER": 42,
"PRICE_TYPE": "C",
"GOOD_SELL_PRICE": "123",
"PROFIT_PERCENT": "0",
"STOCK_MIN": 3,
"IS_AKCIJA": true,
"DISCOUNT_PERCENT": "0.000000",
"NEW_PRODUCT": false,
"IS_REVERSE_VAT": null,
"WEB_ORDER_STEP": null,
"WEB_ORDER_MIN": null,
"MANUFACTURER_ID": null,
"POPULAR_ITEM": false,
"ONLY_REGISTERED_USERS": false,
"SIZE": "",
"MAIN_GOOD": false,
"IN_STOCK": "0.000000",
"IS_SPLITABLE": false,
"CAN_ORDER": false,
"REVERSE_VAT_TYPE": null,
"PVN_RATE": 21,
"content": [
{
"GOOD_ID": 3,
"LANG_ID": 1,
"TITLE": "Preces nosaukums",
"WEB_TITLE": null,
"WEB_ID": "preces-nosaukums",
"DESCRIPTION": null,
"META_KEYWORDS": null,
"META_DESCRIPTION": null
}
],
"duplicates": [],
"params": [],
"web_visible": []
}Get stock amounts
Method : GET Endpoint /api/goods/stocks
TIP
Returns stock amounts grouped by warehouse id (STOCK_NAME_ID), to get individual stocks (STOCK_ID) use /api/goods/amounts
To filter stock amounts by storehouse add:
https://<yourdomain>/api/goods/stocks?token=<your_token>&STOCK_NAME_ID[]=<storehouse_id>
[
{
"data": [
{
"GOOD_ID": 1,
"AMOUNT": 1,
"STOCK_NAME_ID": 1
}
],
"links": {
"first": "/api/goods/stocks?page=1",
"last": "/api/goods/stocks?page=9",
"prev": null,
"next": "/api/goods/stocks?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 9,
"path": "/api/goods/stocks",
"per_page": 1000,
"to": 1000,
"total": 8504
}
}
]Get only changed stocks
Method : GET
Endpoint : /api/goods/stocks/changes
TIP
Returns changed stocks by default within the last hour or specified timestamp (if date is specified). Example:
https://<yourdomain>/api/goods/stocks/changes?token=<your_token>&date=1672527661
Get stock amounts by STOCK_ID
Method : GET Endpoint /api/goods/amounts
TIP
To filter stock amounts by storehouse add:
https://<yourdomain>/api/goods/amounts?token=<your_token>&STOCK_NAME_ID[]=<storehouse_id>
[
{
"data": [
{
"STOCK_ID": 1,
"GOOD_ID": 1,
"AMOUNT": 1,
"STOCK_NAME_ID": 1
}
],
"links": {
"first": "/api/goods/amounts?page=1",
"last": "/api/goods/amounts?page=9",
"prev": null,
"next": "/api/goods/amounts?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 9,
"path": "/api/goods/amounts",
"per_page": 1000,
"to": 1000,
"total": 8504
}
}
]Get only changed stocks (by STOCK_ID)
Method : GET
Endpoint : /api/goods/amounts/changes
TIP
Returns changed stocks (by STOCK_ID) by default within the last hour or specified timestamp (if date is specified). Example:
https://<yourdomain>/api/goods/amounts/changes?token=<your_token>&date=1672527661