/close_shift
Request body:
| Field | Type | Required | Format / constraints |
|---|---|---|---|
employeeName | string | No | Cashier name |
openOrdersOperation | string | No | See value map below |
genPreview | boolean | No | If true, requests a fiscal receipt preview (see preview_data in the response) |
Specific values:
openOrdersOperation = delete: delete unclosed orders and continue closing shift.openOrdersOperation = renew: transfer unclosed orders and continue closing shift.openOrdersOperation = checkor missing: do not force action, return error (code = 24,SHIFT_HAS_OPEN_DOCS) if unclosed orders exist.- Any other value is treated the same as
check.
If openOrdersOperation is delete or renew and the delete/transfer of unclosed checks itself fails (forbidden by cashbox settings, a
check could not be deleted because it has a terminal payment, or a lower-level delete/transfer error), the response has no code field (or
code: null) — this is a known business-rule error, not an unexpected failure, so the client should show message to the user as-is. Where
possible message names the specific check that is blocking the close (e.g. by its receipt number); when the whole operation is forbidden
by settings, no specific check is named. See §12.3 for the general rule behind the missing code.
Success response:
| Field | Type | Required | Notes |
|---|---|---|---|
shiftID | integer (int32) | No | Shift id |
fiscalShiftID | string | No | Fiscal shift id |
fiscalShiftNum | string | No | Fiscal shift number |
shiftOpenAt | string | No | Shift open time |
cash | integer (int64) | No | Cash balance |
saleCount | integer (int32) | No | Sale count |
saleSum | integer (int64) | No | Sale sum |
saleCashSum | integer (int64) | No | Cash sale sum |
saleCashlessSum | integer (int64) | No | Cashless sale sum |
saleCreditSum | integer (int64) | No | Credit sale sum |
saleBonusSum | integer (int64) | No | Bonus sale sum |
saleVatAmounts | array of VAT entries | No | Sale VAT totals |
depositCount | integer (int32) | No | Deposit count |
depositSum | integer (int64) | No | Deposit sum |
withdrawCount | integer (int32) | No | Withdraw count |
withdrawSum | integer (int64) | No | Withdraw sum |
moneyBackCount | integer (int32) | No | Refund count |
moneyBackSum | integer (int64) | No | Refund sum |
moneyBackCashSum | integer (int64) | No | Cash refund sum |
moneyBackCashlessSum | integer (int64) | No | Cashless refund sum |
moneyBackCreditSum | integer (int64) | No | Credit refund sum |
moneyBackBonusSum | integer (int64) | No | Bonus refund sum |
moneyBackVatAmounts | array of VAT entries | No | Refund VAT totals |
currency_name | string | No | Currency |
fiscalData | string | No | Fiscal raw data JSON, when available |
preview_data | string | No | Receipt/report preview text; present only when genPreview=true was requested |
openOrdersOperation | string | No | Echoes the request's openOrdersOperation value |