Skip to main content

The Cash Management API

Hii InStore does everything through this API, and so can your own client. This page groups the endpoints by what they are for. The API reference has the request and response schemas.

Base URL: https://cash-management.retailsvc.com

Calls need a Hii Retail IAM token with the permission named for each endpoint, and access to the store. Paths take the store's businessUnitId, and the safe's repositoryId where it applies. Unknown fields in a request body are refused with 400.

Writes are booked a moment later​

A bank deposit through the API. The client sends POST bank-deposit and gets 200 straight away: the request is accepted. Cash Management then books the deposit: the safe goes from 10 625 to 8 000, and a BankDeposit transaction is published. A GET of the safe's contents made after that shows 8 000.

Bank deposits, withdrawals, corrections and safe audits are accepted by the API and booked a moment later. A 200 means the request was valid and accepted, not that the balance has changed yet. To act on the result, subscribe to the transactions event, or read the balance again after a short wait.

Creating, renaming and deleting a safe take effect at once.

The safe and its balance​

Each path starts with /api/v1/business-units/{businessUnitId}.

EndpointPermissionAnswers / does
POST …/repositoriescmm.repositories.createcreate the store's safe: { "name": "Main safe", "type": "Safe" }. type is Safe or CashChanger, one active of each per store. Returns repositoryId.
GET …/repositoriescmm.repositories.getthe store's active repositories, id and name
PATCH …/repositories/{repositoryId}/namecmm.repositories.updaterename it
DELETE …/repositories/{repositoryId}cmm.repositories.deletedelete it. Refused with 400 for the store's only safe.
GET …/repositories/{repositoryId}/contentscmm.repositories.get-contentthe balance per currency
GET …/repositories/contentscmm.repositories.get-contentthe total across the store's repositories, per currency
GET …/currenciescmm.currencies.getthe currencies the store handles: those of its cash tenders, and any currency with a balance

See The safe.

Bank deposits, withdrawals and corrections​

Each body is a list of { currencyId, amount, referenceId?, reasonCode? }, one line per currency or bag.

EndpointPermissionDoes
POST …/repositories/{repositoryId}:bank-depositcmm.repositories.bank-deposit; for a negative amount also cmm.repositories.bank-dep-negcash from the safe to the bank
POST …/repositories/{repositoryId}:bank-withdrawalcmm.repositories.bank-withdrawal; for a negative amount also cmm.repositories.bank-withdr-negcash from the bank into the safe
POST …/repositories/{repositoryId}:correctionscmm.repositories.correctionschange the balance by the difference between a count and the balance

A negative bank amount needs a reasonCode. See Bank and corrections.

The safe audit​

EndpointPermissionAnswers / does
GET /api/v2/business-units/{businessUnitId}/repositories/{repositoryId}/audits/auditcmm.audits.getthe values to audit per currency, the limits, and the store's screen settings and customer-defined fields
POST /api/v2/business-units/{businessUnitId}/repositories/{repositoryId}/auditscmm.audits.commitsubmit the audit. Refused with 400 if the till cash has changed since the GET.
POST /api/v1/business-units/{businessUnitId}/repositories/audits:search?skip=&take=cmm.audits.searchearlier audits of one safe. Body: repositoryId (required), and createdDateTime or businessDate as { from, to }. Newest first.

See The safe audit.

The history​

EndpointPermissionAnswers
POST …/repositories/transactions:search?skip=&take=cmm.transactions.searchthe store's transactions, newest first. Filter by repositoryId, eventType (a list), referenceId (a bag reference), and createdDateTime or businessDate as { from, to }.
GET …/transactions/event-typescmm.transactions.get-event-typesthe event types that occur in the store's history, including its customer-defined fields. Any of them can be used as a search filter.
GET …/repositories/{repositoryId}/cash-report?businessDate=cmm.repositories.cash-reportone business date in one safe, per currency: the balance at the start and end of the day, the movements, and the corrections

skip defaults to 0 and take to 10, at most 1 000. The response carries page with total and hasMore. In search results, a transaction that took cash out of the repository you filter on has a negative amount.

The head-office overview​

EndpointPermissionAnswers
GET /api/v1/operational-status?from=&to=cmm.audits.get-statusfor every store and business date in the period that had till cash: whether the safe was audited. error: no safe audit; warning: audited, with a comment explaining a deviation; ok: audited. Add businessUnitId for one store, and doSkipOk, doSkipWarning or doSkipError to leave a status out.

This endpoint covers the whole tenant and is not addressed by store.