HW cloud API v1

API section

Register fleet

Register fleet: an inventory of every register of every workplace (model, firmware, fiscal drive and expiry, registration, client INN) and bulk operations on a group of workplaces — clock, VAT rate, receipt details, X report, close shift, with a result per workplace. Needs agent 2.26+.

GET/api/v1/bulk-operationsBulk operations
POST/api/v1/bulk-operationsStart a bulk operation
GET/api/v1/inventoryFiscal register inventory
GET/api/v1/bulk-operations/{id}Bulk operation

Bulk operations#

GET/api/v1/bulk-operations

Recent account operations: what, when, how many workplaces are done, failed, still running

Parameters

NameInTypeDescription
limitqueryinteger int32

Response 200 application/json

Array · Operation
  • idinteger int64
  • actionstring
    values: INFO CLOCK VAT REQUISITES X_REPORT CLOSE_SHIFT
  • paramsobject
  • createdAtstring date-time
  • finishedAtstring date-time
  • statusstring
  • totalinteger int32
  • okinteger int32
  • partialinteger int32
  • failedinteger int32
  • pendinginteger int32
  • itemsarray of Item
    6 fields · Item
    • deviceIdinteger int64
    • deviceNamestring
    • statusstring
    • messagestring
    • resultobject
    • finishedAtstring date-time

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

Request example

curl
curl 'https://cloud.hw-connector.ru/api/v1/bulk-operations' \
  -H 'X-Api-Key: hwk_…'

Start a bulk operation#

POST/api/v1/bulk-operations

One fiscal register service command to a group of workplaces: INFO — refresh details, CLOCK — set the register clock from the computer (shift closed), VAT — main VAT rate (vatRate 20 or 22; Shtrih-M), REQUISITES — workplace receipt details, X_REPORT, CLOSE_SHIFT. deviceIds — workplaces, all enabled if omitted; registers — register numbers on the workplace. Returns at once (202), the per-workplace result — GET /api/v1/bulk-operations/{id}. Needs agent 2.26+

Request body application/json required

Fields · Request
  • actionstringrequired
    values: INFO CLOCK VAT REQUISITES X_REPORT CLOSE_SHIFT
  • deviceIdsarray of integer int64
    from 0
    to 2000
  • registersarray of integer int32
  • vatRateinteger int32
    from 20
    to 22
  • requisitesRequisites
    5 fields · Requisites
    • cashierNamestring
      from 0
      to 64
    • cashierInnstring
      from 0
      to 12
    • senderEmailstring
      from 0
      to 64
    • settlementPlacestring
      from 0
      to 128
    • taxationstring
JSON
{
  "action": "INFO",
  "deviceIds": [
    1
  ],
  "registers": [
    1
  ],
  "vatRate": 20,
  "requisites": {
    "cashierName": "string",
    "cashierInn": "string",
    "senderEmail": "string",
    "settlementPlace": "string",
    "taxation": "string"
  }
}

Response 200 application/json

Fields · Operation
  • idinteger int64
  • actionstring
    values: INFO CLOCK VAT REQUISITES X_REPORT CLOSE_SHIFT
  • paramsobject
  • createdAtstring date-time
  • finishedAtstring date-time
  • statusstring
  • totalinteger int32
  • okinteger int32
  • partialinteger int32
  • failedinteger int32
  • pendinginteger int32
  • itemsarray of Item
    6 fields · Item
    • deviceIdinteger int64
    • deviceNamestring
    • statusstring
    • messagestring
    • resultobject
    • finishedAtstring date-time

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

Request example

curl
curl -X POST 'https://cloud.hw-connector.ru/api/v1/bulk-operations' \
  -H 'X-Api-Key: hwk_…' \
  -H 'Content-Type: application/json' \
  --data '{"action":"INFO","deviceIds":[1],"registers":[1],"vatRate":20,"requisites":{"cashierName":"string","cashierInn":"string","senderEmail":"string","settlementPlace":"string","taxation":"string"}}'

Fiscal register inventory#

GET/api/v1/inventory

Every fiscal register of every account workplace: model, serial number, firmware, FFD, fiscal drive and its expiry, registration number, INN and company — from the details agent 2.26+ sends once a day and on change. Drives that expire sooner come first; the total is in X-Total-Count

Parameters

NameInTypeDescription
qquerystring

Search: workplace, model, serial number, fiscal drive, registration number, INN, company, firmware

innquerystring

Client INN

fnDaysqueryinteger int32

Fiscal drive expires within this many days

deviceIdqueryinteger int64

Only this register

limitqueryinteger int32
offsetqueryinteger int32

Response 200 application/json

Array · Kkt
  • deviceIdinteger int64
  • deviceNamestring
  • registerinteger int32
  • typestring
  • namestring
  • modelstring
  • serialNumberstring
  • firmwarestring
  • ffdstring
  • fnNumberstring
  • fnValidUntilstring date
  • fnDaysLeftinteger int64
  • registrationNumberstring
  • innstring
  • organizationstring
  • errorstring
  • updatedAtstring date-time

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

Request example

curl
curl 'https://cloud.hw-connector.ru/api/v1/inventory' \
  -H 'X-Api-Key: hwk_…'

Bulk operation#

GET/api/v1/bulk-operations/{id}

Summary and a result per workplace: OK, PARTIAL (not on every register), FAILED, PENDING — still running

Parameters

NameInTypeDescription
idrequiredpathinteger int64

Response 200 application/json

Fields · Operation
  • idinteger int64
  • actionstring
    values: INFO CLOCK VAT REQUISITES X_REPORT CLOSE_SHIFT
  • paramsobject
  • createdAtstring date-time
  • finishedAtstring date-time
  • statusstring
  • totalinteger int32
  • okinteger int32
  • partialinteger int32
  • failedinteger int32
  • pendinginteger int32
  • itemsarray of Item
    6 fields · Item
    • deviceIdinteger int64
    • deviceNamestring
    • statusstring
    • messagestring
    • resultobject
    • finishedAtstring date-time

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

Request example

curl
curl 'https://cloud.hw-connector.ru/api/v1/bulk-operations/42' \
  -H 'X-Api-Key: hwk_…'