Skip to main content

API: devices

General conventions in How the API works.

Devices of the key's account. Read only: the detail, the planogram and the selection movements. A device from another account returns 404.

Inventory only moves through stock orders

The API has no writes for devices, planograms, selections or loads. To load or remove units from a machine, create and confirm a stock order: it is the only way to change stock through the API, and every change is recorded in the selection movements.

EndpointPermission
GET /api/v1/devicesdevices:read
GET /api/v1/devices/:iddevices:read
GET /api/v1/devices/:id/planogramdevice_inventory:read
GET /api/v1/devices/:id/movementsdevice_stock:read

:id is the device's id or serial (see References).

The device​

{
"id": "00000000-0000-7000-8000-0000000000d2",
"serial": "UN20W103447",
"name": "Vending Corferias 2",
"type": "SPRING",
"brand": "IKA",
"model": "IKA 5 COMBI",
"operation": { "id": "00000000-0000-7000-8000-0000000000a2", "name": "TEST INGENIERÍA" },
"location": {
"country": "Colombia",
"city": "Bogotá",
"address": "Corferias",
"sublocation": null,
"coordinates": { "lat": 4.669026666666666, "lon": -74.06439333333333 }
},
"isActive": true,
"lastTransmissionAt": "2026-10-07T14:17:49.309Z",
"createdAt": "2026-09-28T14:44:53.060Z",
"updatedAt": "2026-10-07T14:17:49.309Z"
}
FieldTypeDescription
iduuidDevice id.
serialstringDevice serial.
namestringName.
typeenumSPRING, LOCKER, BELT, LIQUID, COFFEE, ICE_CREAM, RETURN.
brand / modelstring | nullBrand and model.
operationobject | nullOperation where it is installed: { id, name }.
locationobjectcountry (country name), city, address, sublocation (string | null), coordinates ({ lat, lon } | null).
isActiveboolean
lastTransmissionAtISO 8601 | nullLast communication received from the device.
createdAt / updatedAtISO 8601 UTC

The detail only carries the device's own attributes. The planogram has its own endpoint.

List devices​

GET /api/v1/devices

Permission: devices:read.

QueryTypeRequiredDefaultLimits / values
pageintegerno1≥ 1
pageSizeintegerno501–200
sortByenumnocreatedAtcreatedAt, name
sortOrderenumnodescasc, desc
searchstringno—Max 100. Case-insensitive "contains" on name or serial.
operationIdstringno—Only that operation's devices: its id or its name. If it does not exist in the account → empty page.
typeenumno—A type value (lowercase accepted).
isActivebooleanno— (all)true / false

Example​

curl 'https://back.inssacs.com/api/v1/devices?operationId=00000000-0000-7000-8000-0000000000a2&type=SPRING' \
-H 'x-api-key: ics_a1b2c3d4_e5f6...'

Response 200​

{
"data": [
{
"id": "00000000-0000-7000-8000-0000000000d2",
"serial": "UN20W103447",
"name": "Vending Corferias 2",
"type": "SPRING",
"brand": "IKA",
"model": "IKA 5 COMBI",
"operation": { "id": "00000000-0000-7000-8000-0000000000a2", "name": "TEST INGENIERÍA" },
"location": {
"country": "Colombia",
"city": "Bogotá",
"address": "Corferias",
"sublocation": null,
"coordinates": { "lat": 4.669026666666666, "lon": -74.06439333333333 }
},
"isActive": true,
"lastTransmissionAt": "2026-10-07T14:17:49.309Z",
"createdAt": "2026-09-28T14:44:53.060Z",
"updatedAt": "2026-10-07T14:17:49.309Z"
}
],
"pagination": { "page": 1, "pageSize": 50, "total": 1 }
}

Get a device​

GET /api/v1/devices/:id

Permission: devices:read.

Path paramTypeDescription
idstringDevice id or serial.
curl https://back.inssacs.com/api/v1/devices/ICS595DDE99B \n -H 'x-api-key: ics_a1b2c3d4_e5f6...'

Response 200: the device.

Planogram​

GET /api/v1/devices/:id/planogram

Permission: device_inventory:read. Path param id (id or serial). No query params.

Response 200​

{
"device": { "id": "00000000-0000-7000-8000-0000000000d2", "serial": "UN20W103447", "name": "Vending Corferias 2" },
"slotMode": "STOCK",
"updatedAt": "2026-10-07T14:17:49.309Z",
"slots": [
{
"selection": "4",
"product": { "id": "00000000-0000-7000-8000-0000000000b4", "sku": "EPP-GAF", "name": "Gafas de seguridad" },
"serialNumber": "GAF-0001",
"isAvailable": false,
"maxQty": 20,
"minQty": 3,
"currentQty": 17
},
{
"selection": "5",
"product": null,
"serialNumber": null,
"isAvailable": true,
"maxQty": null,
"minQty": null,
"currentQty": null
}
]
}
FieldTypeDescription
deviceobjectDevice: { id, serial, name }.
slotModeenum | nullSTOCK: the machine counts units. OPEN: sold on screen (liquids, coffee, ice cream) and quantities are null. null if the device has no planogram.
updatedAtISO 8601 | nullLast planogram change.
slotsarraySelections, ordered by selection number. Empty with no planogram.
slots[].selectionstringSelection code.
slots[].productobject | nullProduct set in the selection: { id, sku, name } (sku is null if the product has no SKU). null = empty selection.
slots[].serialNumberstring | nullLocker: serial number of the unit in the slot (one per selection).
slots[].isAvailablebooleanLocker: false = the unit is loaded but not available: a return of a non-reusable product came in and the slot must be cleaned. Such a unit cannot be requested for pick-up in a ticket (tickets.serial_unavailable). It goes back to true when the machine reloads the slot.
slots[].maxQtyinteger | nullCapacity.
slots[].minQtyinteger | nullMinimum for the restock alert.
slots[].currentQtyinteger | nullCurrent stock (null in OPEN).

Selection movements​

GET /api/v1/devices/:id/movements

Permission: device_stock:read. Path param id (id or serial).

The ledger of every stock change, whether it came from the app, a stock order or the machine itself (deliveries, returns).

QueryTypeRequiredDefaultLimits / values
pageintegerno1≥ 1
pageSizeintegerno501–200
sortByenumnooccurredAtoccurredAt (only value)
sortOrderenumnodescasc, desc
fromISO 8601no— (no limit)Inclusive.
toISO 8601no— (no limit)Exclusive.
selectionstringno—Max 16. A single selection ("07" = "7").
movementenumno— (all)LOAD, UNLOAD, DELIVERY, RETURN, ADJUST (lowercase accepted).

Example​

curl 'https://back.inssacs.com/api/v1/devices/00000000-0000-7000-8000-0000000000d2/movements?movement=LOAD&from=2026-10-01T00:00:00Z' \
-H 'x-api-key: ics_a1b2c3d4_e5f6...'

Response 200​

{
"data": [
{
"id": "e307878c-98bc-494b-8e75-794943940672",
"occurredAt": "2026-10-09T15:28:45.179Z",
"selection": "10",
"movement": "LOAD",
"product": { "id": "00000000-0000-7000-8000-0000000000b4", "sku": "EPP-GAF", "name": "Gafas de seguridad" },
"quantity": 1,
"qtyBefore": 19,
"qtyAfter": 20,
"source": "STOCK_ORDER",
"reason": null,
"stockOrder": { "id": "01a12147-f059-7342-93b9-c5b051226b3f", "number": 5 },
"delivery": null,
"return": null,
"serialNumber": null
}
],
"pagination": { "page": 1, "pageSize": 50, "total": 1 }
}
FieldTypeDescription
iduuidMovement id.
occurredAtISO 8601When it happened.
selectionstringSelection.
movementenumLOAD, UNLOAD (removal), DELIVERY (out through a delivery), RETURN (in through a return), ADJUST (count correction).
productobject | nullProduct in the selection at that moment: { id, sku, name }.
quantityintegerSigned units: positive in, negative out.
qtyBefore / qtyAfterinteger | nullStock before and after.
sourceenumAPP (an operator in the app), STOCK_ORDER (a confirmed stock order), DEVICE (reported by the machine).
reasonenum | nullRemoval reason: EXPIRED, DAMAGED, ROTATION, PRODUCT_CHANGE, RECOUNT, OTHER.
stockOrderobject | nullStock order that caused it: { id, number }.
delivery / returnobject | nullDelivery or return that moved the selection (DEVICE rows): { id, occurredAt }.
serialNumberstring | nullSerialized unit that went in or out (lockers).

Movements are immutable records: they have no createdAt/updatedAt; their date is occurredAt.

Errors​

HTTPcodeWhen
401http.unauthorizedThe key is missing, invalid, revoked or expired.
403http.forbiddenThe key lacks the endpoint's permission.
404devices.not_found(:id) No device with that id or serial in the account (does not exist, was deleted or belongs to another account).
422validation.failedInvalid query: enum out of range, pageSize above 200, malformed date, unknown parameter.
429http.too_many_requestsThe key's rate limit was exceeded.