HW agent API 2.15.3

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/settingsMarking module settings
PUT/api/v1/marking/settingsChange marking module settings
POST/api/v1/marking/checkCheck marking codes: can the item be sold
GET/api/v1/marking/statusMarking module status
GET/api/v1/marking/recentLatest code checks

Marking module settings#

GET/api/v1/marking/settings

Password and tokens — «********» if set

Response 200 application/json

Fields · MarkingSettings
  • enabledboolean
  • sourcesarray of string
  • piotUrlstring
  • lmUrlstring
  • lmLoginstring
  • lmPasswordstring
  • tokenstring
  • sandboxboolean
  • fnNumberstring
  • timeoutMsinteger int32
  • offlineSaleboolean
  • clientIdstring
  • clientTokenstring

Errors — problem+json with a code field, see error codes.

Request example

curl
curl 'http://localhost:7790/api/v1/marking/settings'
curl
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#

PUT/api/v1/marking/settings

«********» in the password and tokens — keep the previous ones

Request body application/json required

Fields · MarkingSettings
  • enabledboolean
  • sourcesarray of string
  • piotUrlstring
  • lmUrlstring
  • lmLoginstring
  • lmPasswordstring
  • tokenstring
  • sandboxboolean
  • fnNumberstring
  • timeoutMsinteger int32
  • offlineSaleboolean
  • clientIdstring
  • clientTokenstring
JSON
{
  "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
  • enabledboolean
  • sourcesarray of string
  • piotUrlstring
  • lmUrlstring
  • lmLoginstring
  • lmPasswordstring
  • tokenstring
  • sandboxboolean
  • fnNumberstring
  • timeoutMsinteger int32
  • offlineSaleboolean
  • clientIdstring
  • clientTokenstring

Errors — problem+json with a code field, see error codes.

Request example

curl
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
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#

POST/api/v1/marking/check

Asks 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
  • typestring
    values: SELL SELL_RETURN BUY BUY_RETURN
  • registerIdinteger int32
  • codesarray of CodeRequestrequired
    from 1
    3 fields · CodeRequest
    • codestringrequired
      from 1
    • priceinteger int64
    • fractionstring
JSON
{
  "type": "SELL",
  "registerId": 1,
  "codes": [
    {
      "code": "string",
      "price": 1,
      "fraction": "string"
    }
  ]
}

Response 200 application/json

Fields · Check
  • allowedboolean
  • itemsarray of Result
    11 fields · Result
    • codestring
    • cisstring
    • gtinstring
    • allowedboolean
    • reasonsarray of string
    • warningsarray of string
    • sourcestring
    • offlineboolean
    • industryPropsstring
    • 20 fields · CodeInfo
      • cisstring
      • gtinstring
      • foundboolean
      • validboolean
      • utilisedboolean
      • verifiedboolean
      • realizableboolean
      • soldboolean
      • blockedboolean
      • ogvsarray of string
      • grayZoneboolean
      • expireDatestring date
      • groupIdsarray of integer int32
      • mrpinteger int64
      • smpinteger int64
      • innerUnitCountinteger int32
      • errorCodeinteger int32
      • messagestring
      • packageTypestring
      • ownerboolean
    • checkedAtstring date-time

Errors — problem+json with a code field, see error codes.

Request example

curl
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
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#

GET/api/v1/marking/status

Whether 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
curl 'http://localhost:7790/api/v1/marking/status'
curl
curl 'https://cloud.hw-connector.ru/agent/api/v1/marking/status' \
  -H 'X-Api-Key: hwk_…' \
  -H 'X-Device-Id: 42'

Latest code checks#

GET/api/v1/marking/recent

Up to 50 latest, newest first

Response 200 application/json

Array · Result
  • codestring
  • cisstring
  • gtinstring
  • allowedboolean
  • reasonsarray of string
  • warningsarray of string
  • sourcestring
  • offlineboolean
  • industryPropsstring
  • 20 fields · CodeInfo
    • cisstring
    • gtinstring
    • foundboolean
    • validboolean
    • utilisedboolean
    • verifiedboolean
    • realizableboolean
    • soldboolean
    • blockedboolean
    • ogvsarray of string
    • grayZoneboolean
    • expireDatestring date
    • groupIdsarray of integer int32
    • mrpinteger int64
    • smpinteger int64
    • innerUnitCountinteger int32
    • errorCodeinteger int32
    • messagestring
    • packageTypestring
    • ownerboolean
  • checkedAtstring date-time

Errors — problem+json with a code field, see error codes.

Request example

curl
curl 'http://localhost:7790/api/v1/marking/recent'
curl
curl 'https://cloud.hw-connector.ru/agent/api/v1/marking/recent' \
  -H 'X-Api-Key: hwk_…' \
  -H 'X-Device-Id: 42'