API: movements
General conventions in How the API works.
Reading what the devices record. Read only.
| Endpoint | What it is | Permission |
|---|---|---|
GET /api/v1/deliveries | Deliveries, successful and failed | reports:read |
GET /api/v1/returns | Recorded returns (EAS) | reports:read |
GET /api/v1/recharges | Manual balance recharges (VENDING) | reports:read |
GET /api/v1/balances | Available balance per code (VENDING) | reports:read |
Common rules
- Only the key's account records. An EAS key sees EAS deliveries; a VENDING key, VENDING
deliveries. An
operationId,deviceId,productId,codeIdoruserIdthat does not exist in the account is not an error: the page is empty (total: 0). - Filters by id or natural key:
operationIdaccepts the operation's id or name,deviceIdthe id or serial,productIdthe id or SKU anduserIdthe id or identification (see References). - Immutable records: no
createdAt/updatedAt. Their date isoccurredAt, the event's date at the machine. - Embedded references, frozen at the event. Each reference is an object with the standard
shape from Format, taken from what the record stored at the time of
the event: if the product was renamed or deleted afterwards, the movement keeps the name and SKU
of that moment. A field with no value is
null, and the whole object isnullif the older record does not carry the data.useris the frozen holder:name,identification,code({ codeId, codeType }) andtags. The record does not store the user id, so it has noid. Match it againstcodes[].codeIdin users.- Amounts (
amount,balancePaid,rechargePaid,balanceAfter): what was charged at that time.
- Money: integer in minor units of
currency; the value isamount / 10^minorUnitDecimals(COP:minorUnitDecimals=2,250000= $2,500.00).
Common filters for deliveries, returns and recharges
| 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 | to minus 30 days | Inclusive. |
to | ISO 8601 | no | now | Exclusive. from must be before to and the range cannot exceed 366 days. |
operationId | string | no | — | That operation only: its id or its name. |
deviceId | string | no | — | That device only: its id or its serial. |
userId | string | no | — | A user from users: their id or their identification. Unknown or from another account → empty page. |
codeId | string | no | — | Max 100. Exact code value. |
To walk a long period, request windows of up to 366 days.
Deliveries
GET /api/v1/deliveries
Permission: reports:read. Common filters plus:
| Query | Type | Required | Default | Values |
|---|---|---|---|---|
productId | string | no | — | That product only: its id or its SKU. |
isDelivered | boolean | no | — (both) | true = successful, false = failed. |
method | enum | no | — (all) | CASH, CARD, WALLET, BRE_B, CASHLESS, REMOTE, DELIVERY (lowercase accepted). |
curl 'https://back.inssacs.com/api/v1/deliveries?from=2026-10-01T05:00:00Z&to=2026-10-09T05:00:00Z&isDelivered=true' \
-H 'x-api-key: ics_a1b2c3d4_e5f6...'
Response 200:
{
"data": [
{
"id": "00000000-0000-7000-8000-a100000001d8",
"occurredAt": "2026-10-08T00:37:48.000Z",
"isDelivered": true,
"failureReason": null,
"method": "CASHLESS",
"operation": { "id": "00000000-0000-7000-8000-0000000000a2", "name": "TEST INGENIERÍA" },
"device": { "id": "00000000-0000-7000-8000-0000000000d2", "serial": "UN20W103447", "name": "Vending Corferias 2" },
"selection": "3",
"product": { "id": "00000000-0000-7000-8000-0000000000b4", "sku": "AGUA-600", "name": "Agua 600 ml" },
"serialNumber": null,
"user": {
"name": "Juan Pérez",
"identification": "1010150461",
"code": { "codeId": "1010150461", "codeType": "NFC" },
"tags": [{ "key": "departamento", "value": "Marketing" }]
},
"ticket": null,
"currency": "COP",
"minorUnitDecimals": 2,
"amount": 250000,
"balancePaid": 125000,
"rechargePaid": 125000,
"isReturnable": false,
"returnedAt": null
}
],
"pagination": { "page": 1, "pageSize": 50, "total": 480 }
}
| Field | Type | Description |
|---|---|---|
id | uuid | Delivery id. |
occurredAt | ISO 8601 | Event date. |
isDelivered | boolean | true: the product left the machine. false: failed delivery, it did not leave (payment declined, motor failure, timeout…). A failed delivery is not a sale: in VENDING amount carries the price it tried to charge, but it does not add to what was sold. |
failureReason | string | null | Reason reported by the device on failed deliveries (free text). |
method | enum | null | Payment or accreditation method: CASH, CARD, WALLET (QR or wallet), BRE_B, CASHLESS (code balance), REMOTE (remote sale), DELIVERY (EAS delivery with no charge). |
operation | object | null | Where it happened: { id, name }, with the name at the event. |
device | object | null | Device: { id, serial, name }, with the serial and name at the event. |
selection | string | null | Selection. |
product | object | null | Delivered product: { id, sku, name } at the time of the event. sku is null on older records. |
serialNumber | string | null | Serial number of the delivered unit (EAS). |
user | object | null | Frozen holder: { name, identification, code, tags }. code is { codeId, codeType } or null on payments with no code (cash, card) or with a ticket; tags is { key, value }[]. No id. |
ticket | object | null | Ticket used (EAS): { id, code, name }; mutually exclusive with user.code. |
currency | string ISO 4217 | Currency of the account. |
minorUnitDecimals | integer | null | Decimals of the currency (COP = 2). Value = amount / 10^minorUnitDecimals. |
amount | integer | Amount charged; on a failed VENDING delivery, the price it tried to charge. 0 when there is no charge (EAS DELIVERY). |
balancePaid / rechargePaid | integer | CASHLESS only: part covered by subsidy and by recharge. 0 for other methods. |
isReturnable | boolean | null | EAS: the product had to be returned. |
returnedAt | ISO 8601 | null | Date of this delivery's return; null = not returned. |
Pending returns: deliveries with isReturnable: true, isDelivered: true and returnedAt: null.
Returns
GET /api/v1/returns
Permission: reports:read. Common filters plus productId (id or SKU).
Recorded returns: the source of truth for "returned". They only exist in EAS: a VENDING key always
gets an empty page. Includes returns of a delivery (delivery) and of a ticket (ticket, no
delivery). Sorted by the return date.
{
"data": [
{
"id": "00000000-0000-7000-8000-ad000000004b",
"occurredAt": "2026-10-03T17:54:20.000Z",
"delivery": { "id": "00000000-0000-7000-8000-a2000000004b", "occurredAt": "2026-10-02T16:10:00.000Z" },
"ticket": null,
"operation": { "id": "00000000-0000-7000-8000-0000000000a4", "name": "Sede Norte" },
"device": { "id": "00000000-0000-7000-8000-e30000000002", "serial": "LK20W000002", "name": "Locker Devoluciones" },
"product": { "id": "00000000-0000-7000-8000-e10000000002", "sku": "EPP-CAS", "name": "Casco de seguridad" },
"serialNumber": null,
"user": {
"name": "Ana Gómez",
"identification": "1010071271",
"code": { "codeId": "1010071271", "codeType": "NFC" },
"tags": []
}
}
],
"pagination": { "page": 1, "pageSize": 50, "total": 36 }
}
| Field | Type | Description |
|---|---|---|
id | uuid | Return id. |
occurredAt | ISO 8601 | When it was returned. |
delivery | object | null | Delivery being returned: { id, occurredAt } (see deliveries). null for a ticket return. |
ticket | object | null | Ticket, if it is a ticket return: { id, code, name }. |
operation / device | object | null | Where it was returned: { id, name } and { id, serial, name } at the event. It can be a different device from the delivery's (e.g. a RETURN module). |
product | object | null | Returned product: { id, sku, name } at the event. |
serialNumber | string | null | Serial number of the returned unit. |
user | object | null | Who returned it: frozen holder { name, identification, code, tags }, same as in deliveries. |
Recharges
GET /api/v1/recharges
Permission: reports:read. Only the common filters (no productId).
Manual balance recharges made at the machine (VENDING). An EAS key gets an empty page.
{
"data": [
{
"id": "00000000-0000-7000-8000-a3000000004e",
"occurredAt": "2026-10-07T17:14:35.000Z",
"operation": { "id": "00000000-0000-7000-8000-0000000000a2", "name": "TEST INGENIERÍA" },
"device": { "id": "00000000-0000-7000-8000-0000000000d2", "serial": "UN20W103447", "name": "Vending Corferias 2" },
"user": {
"name": "Luis Rojas",
"identification": "1010110866",
"code": { "codeId": "1010110866", "codeType": "NFC" },
"tags": []
},
"currency": "COP",
"minorUnitDecimals": 2,
"amount": 4500000,
"balanceAfter": 5000000
}
],
"pagination": { "page": 1, "pageSize": 50, "total": 110 }
}
| Field | Type | Description |
|---|---|---|
id | uuid | Recharge id. |
occurredAt | ISO 8601 | When it was recharged. |
operation / device | object | null | Where it was recharged: { id, name } and { id, serial, name } at the event. |
user | object | null | Frozen holder of the recharged code: { name, identification, code, tags }. |
currency | string ISO 4217 | Currency of the account. |
minorUnitDecimals | integer | null | Decimals of the currency (COP = 2). Value = amount / 10^minorUnitDecimals. |
amount | integer | Amount recharged. |
balanceAfter | integer | null | The code's recharge balance right after (snapshot, not recomputed). null on old records without the data. |
Balances
GET /api/v1/balances
Permission: reports:read.
Available balance per code: one row per VENDING code of the account (deleted users do not appear). EAS codes carry no balance and do not appear: an EAS key gets an empty page.
| Query | Type | Required | Default | Limits / values |
|---|---|---|---|---|
page | integer | no | 1 | ≥ 1 |
pageSize | integer | no | 50 | 1–200 |
sortBy | enum | no | createdAt | createdAt (only value): user creation, then code creation. |
sortOrder | enum | no | desc | Only desc (asc → 422). |
search | string | no | — | Max 100. "Contains" on name, identification or code. |
isEmpty | boolean | no | — (all) | true = only codes with no balance and no recharge (cannot buy). |
{
"data": [
{
"user": {
"id": "00000000-0000-7000-8000-0000000000c1",
"identification": "1010110866",
"name": "Luis Rojas",
"isActive": true
},
"code": { "codeId": "1010110866", "codeType": "NFC", "isActive": true },
"profile": { "id": "00000000-0000-7000-8000-e20000000002", "name": "Subsidio planta" },
"currency": "COP",
"minorUnitDecimals": 2,
"balance": 500000,
"recharge": 5000000,
"available": 5500000,
"lastAccreditation": "2026-10-01T05:00:00.000Z",
"lastReload": "2026-10-07T17:14:35.000Z"
}
],
"pagination": { "page": 1, "pageSize": 50, "total": 21 }
}
| Field | Type | Description |
|---|---|---|
user | object | The code's owner: { id, identification, name, isActive } (GET /users/:id). isActive: user is active. |
code | object | Code: { codeId, codeType, isActive }. isActive: code is active. |
profile | object | null | Profile of the code: { id, name }. null only on old codes without a profile. |
currency | string | null | The account's currency. null only on old codes without a profile. |
minorUnitDecimals | integer | null | Decimals of the currency (COP = 2). Value of balance, recharge and available = amount / 10^minorUnitDecimals. |
balance | integer | Available subsidy. Refilled according to the profile. |
recharge | integer | Balance manually recharged at the machine. |
available | integer | balance + recharge: what the code can spend now. A purchase takes from balance first, then recharge. |
lastAccreditation | ISO 8601 | null | Last time the code was presented at a device to buy. |
lastReload | ISO 8601 | null | Last automatic subsidy reload. |
Errors
| HTTP | code | When |
|---|---|---|
| 400 | transactions.invalid_filter | from is not before to, or the range exceeds 366 days. |
| 401 | http.unauthorized | The key is missing, invalid, revoked or expired. |
| 403 | http.forbidden | The key lacks reports:read. |
| 422 | validation.failed | Invalid query: malformed date, invalid uuid, enum out of range, pageSize above 200, sortOrder=asc on balances, unknown parameter. |
| 429 | http.too_many_requests | The key's rate limit was exceeded. |