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.
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.
| Endpoint | Permission |
|---|---|
GET /api/v1/devices | devices:read |
GET /api/v1/devices/:id | devices:read |
GET /api/v1/devices/:id/planogram | device_inventory:read |
GET /api/v1/devices/:id/movements | device_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"
}
| Field | Type | Description |
|---|---|---|
id | uuid | Device id. |
serial | string | Device serial. |
name | string | Name. |
type | enum | SPRING, LOCKER, BELT, LIQUID, COFFEE, ICE_CREAM, RETURN. |
brand / model | string | null | Brand and model. |
operation | object | null | Operation where it is installed: { id, name }. |
location | object | country (country name), city, address, sublocation (string | null), coordinates ({ lat, lon } | null). |
isActive | boolean | |
lastTransmissionAt | ISO 8601 | null | Last communication received from the device. |
createdAt / updatedAt | ISO 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.
| Query | Type | Required | Default | Limits / values |
|---|---|---|---|---|
page | integer | no | 1 | ≥ 1 |
pageSize | integer | no | 50 | 1–200 |
sortBy | enum | no | createdAt | createdAt, name |
sortOrder | enum | no | desc | asc, desc |
search | string | no | — | Max 100. Case-insensitive "contains" on name or serial. |
operationId | string | no | — | Only that operation's devices: its id or its name. If it does not exist in the account → empty page. |
type | enum | no | — | A type value (lowercase accepted). |
isActive | boolean | no | — (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 param | Type | Description |
|---|---|---|
id | string | Device 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
}
]
}
| Field | Type | Description |
|---|---|---|
device | object | Device: { id, serial, name }. |
slotMode | enum | null | STOCK: the machine counts units. OPEN: sold on screen (liquids, coffee, ice cream) and quantities are null. null if the device has no planogram. |
updatedAt | ISO 8601 | null | Last planogram change. |
slots | array | Selections, ordered by selection number. Empty with no planogram. |
slots[].selection | string | Selection code. |
slots[].product | object | null | Product set in the selection: { id, sku, name } (sku is null if the product has no SKU). null = empty selection. |
slots[].serialNumber | string | null | Locker: serial number of the unit in the slot (one per selection). |
slots[].isAvailable | boolean | Locker: 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[].maxQty | integer | null | Capacity. |
slots[].minQty | integer | null | Minimum for the restock alert. |
slots[].currentQty | integer | null | Current 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).
| Query | Type | Required | Default | Limits / values |
|---|---|---|---|---|
page | integer | no | 1 | ≥ 1 |
pageSize | integer | no | 50 | 1–200 |
sortBy | enum | no | occurredAt | occurredAt (only value) |
sortOrder | enum | no | desc | asc, desc |
from | ISO 8601 | no | — (no limit) | Inclusive. |
to | ISO 8601 | no | — (no limit) | Exclusive. |
selection | string | no | — | Max 16. A single selection ("07" = "7"). |
movement | enum | no | — (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 }
}
| Field | Type | Description |
|---|---|---|
id | uuid | Movement id. |
occurredAt | ISO 8601 | When it happened. |
selection | string | Selection. |
movement | enum | LOAD, UNLOAD (removal), DELIVERY (out through a delivery), RETURN (in through a return), ADJUST (count correction). |
product | object | null | Product in the selection at that moment: { id, sku, name }. |
quantity | integer | Signed units: positive in, negative out. |
qtyBefore / qtyAfter | integer | null | Stock before and after. |
source | enum | APP (an operator in the app), STOCK_ORDER (a confirmed stock order), DEVICE (reported by the machine). |
reason | enum | null | Removal reason: EXPIRED, DAMAGED, ROTATION, PRODUCT_CHANGE, RECOUNT, OTHER. |
stockOrder | object | null | Stock order that caused it: { id, number }. |
delivery / return | object | null | Delivery or return that moved the selection (DEVICE rows): { id, occurredAt }. |
serialNumber | string | null | Serialized unit that went in or out (lockers). |
Movements are immutable records: they have no createdAt/updatedAt; their date is occurredAt.
Errors
| HTTP | code | When |
|---|---|---|
| 401 | http.unauthorized | The key is missing, invalid, revoked or expired. |
| 403 | http.forbidden | The key lacks the endpoint's permission. |
| 404 | devices.not_found | (:id) No device with that id or serial in the account (does not exist, was deleted or belongs to another account). |
| 422 | validation.failed | Invalid query: enum out of range, pageSize above 200, malformed date, unknown parameter. |
| 429 | http.too_many_requests | The key's rate limit was exceeded. |