Bank and corrections
Three things the store staff do move the safe directly: they send cash to the bank, fetch cash from the bank, and count the safe. In Hii InStore these are To Bank, From Bank and Count Safe.
| In Hii InStore | API call | Event type | The safe |
|---|---|---|---|
| To Bank | POST …/repositories/{repositoryId}:bank-deposit | BankDeposit | − the amount |
| From Bank | POST …/repositories/{repositoryId}:bank-withdrawal | BankWithdrawal | + the amount |
| Count Safe | POST …/repositories/{repositoryId}:corrections | Correction | + or − the difference |
Each path starts with /api/v1/business-units/{businessUnitId}. The body is a list with one line per currency:
[
{ "currencyId": "NOK", "amount": 2625, "referenceId": "BAG-1042" },
{ "currencyId": "EUR", "amount": 150, "referenceId": "BAG-1042" }
]
The bank drop at the end of a safe audit is a bank deposit too, booked from the audit itself.
Bank deposits and withdrawals
referenceIdis the bag reference, the number printed on the bank bag. It is optional, and is published on the transaction so that your accounting can match the bag with the bank's statement.- Two bags in the same currency can be sent as two lines with their own references. Each is booked and published as its own transaction.
- Name the amount as a positive number for an ordinary deposit or withdrawal. The event type says which direction the cash went.
Reversing a mistake: negative amounts
A deposit or withdrawal recorded by mistake is reversed with a negative amount of the same kind: a deposit of −500 puts 500 back into the safe. A negative amount needs two things the positive one does not:
- A separate permission.
cmm.repositories.bank-dep-negfor a negative deposit andcmm.repositories.bank-withdr-negfor a negative withdrawal, on top of the ordinary permission. Without it the request is refused with 401. - A reason code. Each negative line must carry a
reasonCodethat is configured in Customer Controlled Configuration (rco.reason-codes.v1) for the store and belongs to the groupCashManagement. A missing or unknown reason code is refused with 400. If the reason codes cannot be read at that moment, the request is refused with 503 and can be sent again.
The reason code is published on the transaction, as reasonCode. The published amount keeps the minus sign: a
BankDeposit of −500 puts 500 back into the safe. See Receiving the events.
Counting the safe
Count Safe is a count of the safe outside the safe audit. The manager counts each currency, and Hii InStore sends the difference between the count and the safe's balance as a correction: a count of 9 980 against a balance of 10 000 sends −20.
The API takes the difference, not the counted amount. A positive correction puts cash into the safe, a negative one
takes it out. The published transaction carries the difference as a positive amount, with the direction in
repositoryIdTo or repositoryIdFrom.
A correction does not need a reason code. Most stores count the safe in the safe audit instead, which also checks the cash that came from the tills that day.