API section
Product marking
Marking module: checking codes in Chestny Znak (TS PIoT, the local module, GIS MT) before the sale and codes in the receipt.
Checking marking codes in Chestny Znak (permissive mode)
| GET | /api/v1/marking/settings | Marking module settings |
| PUT | /api/v1/marking/settings | Change marking module settings |
| POST | /api/v1/marking/check | Check marking codes: can the item be sold |
| GET | /api/v1/marking/status | Marking module status |
| GET | /api/v1/marking/recent | Latest code checks |
Marking module settings#
/api/v1/marking/settingsPassword and tokens — «********» if set
Response 200 application/json
Fields · MarkingSettings
enabledbooleansourcesarray of stringpiotUrlstringlmUrlstringlmLoginstringlmPasswordstringtokenstringsandboxbooleanfnNumberstringtimeoutMsinteger int32offlineSalebooleanclientIdstringclientTokenstring
Errors — problem+json with a code field, see error codes.
Request example
curl 'http://localhost:7790/api/v1/marking/settings'curl 'https://cloud.hw-connector.ru/agent/api/v1/marking/settings' \
-H 'X-Api-Key: hwk_…' \
-H 'X-Device-Id: 42'Change marking module settings#
/api/v1/marking/settings«********» in the password and tokens — keep the previous ones
Request body application/json required
Fields · MarkingSettings
enabledbooleansourcesarray of stringpiotUrlstringlmUrlstringlmLoginstringlmPasswordstringtokenstringsandboxbooleanfnNumberstringtimeoutMsinteger int32offlineSalebooleanclientIdstringclientTokenstring
{
"enabled": false,
"sources": [
"string"
],
"piotUrl": "string",
"lmUrl": "string",
"lmLogin": "string",
"lmPassword": "string",
"token": "string",
"sandbox": false,
"fnNumber": "string",
"timeoutMs": 1,
"offlineSale": false,
"clientId": "string",
"clientToken": "string"
}Response 200 application/json
Fields · MarkingSettings
enabledbooleansourcesarray of stringpiotUrlstringlmUrlstringlmLoginstringlmPasswordstringtokenstringsandboxbooleanfnNumberstringtimeoutMsinteger int32offlineSalebooleanclientIdstringclientTokenstring
Errors — problem+json with a code field, see error codes.
Request example
curl -X PUT 'http://localhost:7790/api/v1/marking/settings' \
-H 'Content-Type: application/json' \
--data '{"enabled":false,"sources":["string"],"piotUrl":"string","lmUrl":"string","lmLogin":"string","lmPassword":"string","token":"string","sandbox":false,"fnNumber":"string","timeoutMs":1,"offlineSale":false,"clientId":"string","clientToken":"string"}'curl -X PUT 'https://cloud.hw-connector.ru/agent/api/v1/marking/settings' \
-H 'X-Api-Key: hwk_…' \
-H 'X-Device-Id: 42' \
-H 'Content-Type: application/json' \
--data '{"enabled":false,"sources":["string"],"piotUrl":"string","lmUrl":"string","lmLogin":"string","lmPassword":"string","token":"string","sandbox":false,"fnNumber":"string","timeoutMs":1,"offlineSale":false,"clientId":"string","clientToken":"string"}'Check marking codes: can the item be sold#
/api/v1/marking/checkAsks TS PIoT, the local Chestny Znak module or GIS MT (per settings) and applies the permissive-mode rules. The response has, per code, allowed, refusal reasons and industryProps — pass them into the receipt item (marking.industryProps) and the agent will not check the code again
Request body application/json required
Fields · CheckRequest
typestringvalues:SELLSELL_RETURNBUYBUY_RETURNregisterIdinteger int32- from 1
3 fields · CodeRequest
codestringrequiredfrom 1priceinteger int64fractionstring
{
"type": "SELL",
"registerId": 1,
"codes": [
{
"code": "string",
"price": 1,
"fraction": "string"
}
]
}Response 200 application/json
Fields · Check
allowedbooleanitemsarray of Result11 fields · Result
codestringcisstringgtinstringallowedbooleanreasonsarray of stringwarningsarray of stringsourcestringofflinebooleanindustryPropsstringinfoCodeInfo20 fields · CodeInfo
cisstringgtinstringfoundbooleanvalidbooleanutilisedbooleanverifiedbooleanrealizablebooleansoldbooleanblockedbooleanogvsarray of stringgrayZonebooleanexpireDatestring dategroupIdsarray of integer int32mrpinteger int64smpinteger int64innerUnitCountinteger int32errorCodeinteger int32messagestringpackageTypestringownerboolean
checkedAtstring date-time
Errors — problem+json with a code field, see error codes.
Request example
curl -X POST 'http://localhost:7790/api/v1/marking/check' \
-H 'Content-Type: application/json' \
--data '{"type":"SELL","registerId":1,"codes":[{"code":"string","price":1,"fraction":"string"}]}'curl -X POST 'https://cloud.hw-connector.ru/agent/api/v1/marking/check' \
-H 'X-Api-Key: hwk_…' \
-H 'X-Device-Id: 42' \
-H 'Content-Type: application/json' \
--data '{"type":"SELL","registerId":1,"codes":[{"code":"string","price":1,"fraction":"string"}]}'Marking module status#
/api/v1/marking/statusWhether it is enabled, licensed, and whether TS PIoT, the local module and GIS MT are reachable
Response 200 application/json
Type: map → any value
Errors — problem+json with a code field, see error codes.
Request example
curl 'http://localhost:7790/api/v1/marking/status'curl 'https://cloud.hw-connector.ru/agent/api/v1/marking/status' \
-H 'X-Api-Key: hwk_…' \
-H 'X-Device-Id: 42'Latest code checks#
/api/v1/marking/recentUp to 50 latest, newest first
Response 200 application/json
Array · Result
codestringcisstringgtinstringallowedbooleanreasonsarray of stringwarningsarray of stringsourcestringofflinebooleanindustryPropsstringinfoCodeInfo20 fields · CodeInfo
cisstringgtinstringfoundbooleanvalidbooleanutilisedbooleanverifiedbooleanrealizablebooleansoldbooleanblockedbooleanogvsarray of stringgrayZonebooleanexpireDatestring dategroupIdsarray of integer int32mrpinteger int64smpinteger int64innerUnitCountinteger int32errorCodeinteger int32messagestringpackageTypestringownerboolean
checkedAtstring date-time
Errors — problem+json with a code field, see error codes.
Request example
curl 'http://localhost:7790/api/v1/marking/recent'curl 'https://cloud.hw-connector.ru/agent/api/v1/marking/recent' \
-H 'X-Api-Key: hwk_…' \
-H 'X-Device-Id: 42'