Skip to main content

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 InStoreAPI callEvent typeThe safe
To BankPOST …/repositories/{repositoryId}:bank-depositBankDeposit− the amount
From BankPOST …/repositories/{repositoryId}:bank-withdrawalBankWithdrawal+ the amount
Count SafePOST …/repositories/{repositoryId}:correctionsCorrection+ 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​

A bank deposit and a bank withdrawal side by side. On the left, a bank bag with reference BAG-1042 holding 2 625 NOK leaves the safe: the safe goes from 10 625 to 8 000 and a BankDeposit is published. On the right, 3 000 NOK fetched from the bank goes into the safe: the safe goes from 8 000 to 11 000 and a BankWithdrawal is published.

  • referenceId is 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 decision flow for one line of a bank deposit. Is the amount negative? If not, the line is accepted. If it is, does the user have the permission for negative deposits? If not, the request is refused with 401. If they do, does the line carry a reason code? If not, 400. Is the reason code configured in the CashManagement group? If not, 400. Otherwise the line is accepted, and the reason code is published with it.

  1. A separate permission. cmm.repositories.bank-dep-neg for a negative deposit and cmm.repositories.bank-withdr-neg for a negative withdrawal, on top of the ordinary permission. Without it the request is refused with 401.
  2. A reason code. Each negative line must carry a reasonCode that is configured in Customer Controlled Configuration (rco.reason-codes.v1) for the store and belongs to the group CashManagement. 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.