Skip to main content

Devices

OCMS Devices

In OCMS a device is a special instance of a client that has been registered under a template that specifies device settings.

Device Settings

When creating a Registration Template, you can also choose to specify a deviceSettings property. Device settings is an object with following fields:

  • deviceKind - a string that specifies a kind of device. This is a required field, can be one of: POS, Self Checkout, Other.
  • businessUnitIdClaim - a string that specifies a claim name that contains a business unit id. This is a required field.
  • deviceIdClaim - a string that specifies a claim name that contains a device id. This is a required field.

The template itself then MUST have the claims in the schema.

You can either add these fields in the UI when creating a template or using the API call. These settings may be updated later, but cannot be removed.

Device View

Each Authorized client that was registered under the template with device settings will be shown in the device view. The device view is not available in the UI, but you can get the list of devices per store using the API call. Example call and a response:

GET /v1/tenants/CIR7nQwtS0rA6t0S6ejd/business-units/001/devices?skip=0&take=100&kind=Self%20Checkout
Host: ocms.retailsvc.com

HTTP/1.1 200 OK
[
{
"tenantId": "CIR7nQwtS0rA6t0S6ejd",
"businessUnitId": "001",
"id": "01",
"clientId": "YnVzaW5lc3NfdW5pdF9pZDogIjAwMSIKaXNvX2NjOiBzZS1TRQpzZnc6IHNjb0AyLjAKdGlkOiBDSVI3blF3dFMwckE2dDBTNmVqZAp3b3Jrc3RhdGlvbl9pZDogIjAxIgo",
"softwareId": "sco",
"softwareVersion": "2.0",
"kind": "Self Checkout"
"lastActiveDateTime": "2019-01-01T00:00:00.000Z"
}
]

The last active date time is the last time the device was seen in the system. It is updated when the device requests an access token.

Device Events

We also publish device events to Pub/Sub. There are three types of events, differentiated by Operation attribute:

  • hr.iam.device.heartbeat - a device has been seen fetching token, contains the full device object.
  • hr.iam.device.changed - a device has been updated or created, contains the full device object.
  • hr.iam.device.deleted - a device has been deleted, contains only the clientId field.