HW agent API 2.14.1

Reference

Error codes

A request error is HTTP 4xx or 5xx with application/problem+json (RFC 9457) and a machine code in the code field: branch on it, not on the text. A device error is in the operation itself.

Error format

problem+json
{
  "type": "about:blank",
  "title": "Conflict",
  "status": 409,
  "detail": "Device 1 is busy with another operation",
  "code": "DEVICE_BUSY"
}

Request errors

HTTPcodeWhen
400INVALID_REQUESTInvalid JSON, no Idempotency-Key, field constraints violated (the fields are in detail)
401BAD_SIGNATUREA site with a signing key sent a request without a valid signature
402LICENSE_REQUIREDA license key with this feature is needed (terminals, several registers, the document scanner or marking module)
403SITE_NOT_ALLOWEDThe site (Origin) is not allowed yet: the cashier sees a request in the tray and on the agent page — retry after approval
403SITE_DENIEDThe site was denied on this computer
404DEVICE_NOT_FOUNDNo device with this number
404NOT_FOUNDNo such operation, print job, template or file
409IDEMPOTENCY_KEY_REUSEDThe key was used for another operation
409DEVICE_BUSYThe device is busy with another operation
409INVALID_STATEThe action is not possible now (e.g. cancelling a job that is already printed)
413TOO_LARGEThe request body is too large
422VALIDATION_ERRORTotals do not match, no cashier, invalid parameter value
502DEVICE_ERRORThe device returned an error for an immediate request (weight, fiscal drive status)

Operation errors

The operation was accepted but the device failed: status: FAILED (or UNKNOWN) and error: {code, message, details}. Device error texts are in Russian.

JSON
{
  "id": "3f6c1d9e-1b2a-4c55-9e0d-6a1f0c2b7d11",
  "type": "receipt",
  "status": "FAILED",
  "error": {
    "code": "DEVICE_ERROR",
    "message": "Register: out of paper"
  }
}
codeWhat happened
DEVICE_ERRORRegister, terminal or printer error; the text is in message
PAYMENT_CANCELLEDThe receipt failed after a card payment; the payment was cancelled on the terminal
PAYMENT_NOT_CANCELLEDThe receipt failed and the payment could not be cancelled; payment data is in details
RECEIPT_FAILED_AFTER_REFUNDMoney was refunded to the card, the refund receipt was not printed
MARKING_REJECTEDA marking code may not be sold (permissive mode) — the receipt was not printed
INTERRUPTEDThe agent restarted during the operation
TIMEOUTstatus: UNKNOWN — the device did not answer in time, the result is unknown: check the device and the last document
INTERNAL_ERRORInternal agent failure; details are in the agent log

Cloud errors

When calling through the cloud, its own errors carry the X-Hw-Proxy-Error header — see Through the cloud.