Skip to main content

API: movements

General conventions in How the API works.

Reading what the devices record. Read only.

EndpointWhat it isPermission
GET /api/v1/deliveriesDeliveries, successful and failedreports:read
GET /api/v1/returnsRecorded returns (EAS)reports:read
GET /api/v1/rechargesManual balance recharges (VENDING)reports:read
GET /api/v1/balancesAvailable 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, codeId or userId that does not exist in the account is not an error: the page is empty (total: 0).
  • Filters by id or natural key: operationId accepts the operation's id or name, deviceId the id or serial, productId the id or SKU and userId the id or identification (see References).
  • Immutable records: no createdAt/updatedAt. Their date is occurredAt, 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 is null if the older record does not carry the data.
    • user is the frozen holder: name, identification, code ({ codeId, codeType }) and tags. The record does not store the user id, so it has no id. Match it against codes[].codeId in users.
    • Amounts (amount, balancePaid, rechargePaid, balanceAfter): what was charged at that time.
  • Money: integer in minor units of currency; the value is amount / 10^minorUnitDecimals (COP: minorUnitDecimals = 2, 250000 = $2,500.00).

Common filters for deliveries, returns and recharges​

QueryTypeRequiredDefaultLimits / values
pageintegerno1≥ 1
pageSizeintegerno501–200
sortByenumnooccurredAtoccurredAt (only value)
sortOrderenumnodescasc, desc
fromISO 8601noto minus 30 daysInclusive.
toISO 8601nonowExclusive. from must be before to and the range cannot exceed 366 days.
operationIdstringno—That operation only: its id or its name.
deviceIdstringno—That device only: its id or its serial.
userIdstringno—A user from users: their id or their identification. Unknown or from another account → empty page.
codeIdstringno—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:

QueryTypeRequiredDefaultValues
productIdstringno—That product only: its id or its SKU.
isDeliveredbooleanno— (both)true = successful, false = failed.
methodenumno— (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 }
}
FieldTypeDescription
iduuidDelivery id.
occurredAtISO 8601Event date.
isDeliveredbooleantrue: 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.
failureReasonstring | nullReason reported by the device on failed deliveries (free text).
methodenum | nullPayment or accreditation method: CASH, CARD, WALLET (QR or wallet), BRE_B, CASHLESS (code balance), REMOTE (remote sale), DELIVERY (EAS delivery with no charge).
operationobject | nullWhere it happened: { id, name }, with the name at the event.
deviceobject | nullDevice: { id, serial, name }, with the serial and name at the event.
selectionstring | nullSelection.
productobject | nullDelivered product: { id, sku, name } at the time of the event. sku is null on older records.
serialNumberstring | nullSerial number of the delivered unit (EAS).
userobject | nullFrozen 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.
ticketobject | nullTicket used (EAS): { id, code, name }; mutually exclusive with user.code.
currencystring ISO 4217Currency of the account.
minorUnitDecimalsinteger | nullDecimals of the currency (COP = 2). Value = amount / 10^minorUnitDecimals.
amountintegerAmount charged; on a failed VENDING delivery, the price it tried to charge. 0 when there is no charge (EAS DELIVERY).
balancePaid / rechargePaidintegerCASHLESS only: part covered by subsidy and by recharge. 0 for other methods.
isReturnableboolean | nullEAS: the product had to be returned.
returnedAtISO 8601 | nullDate 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 }
}
FieldTypeDescription
iduuidReturn id.
occurredAtISO 8601When it was returned.
deliveryobject | nullDelivery being returned: { id, occurredAt } (see deliveries). null for a ticket return.
ticketobject | nullTicket, if it is a ticket return: { id, code, name }.
operation / deviceobject | nullWhere 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).
productobject | nullReturned product: { id, sku, name } at the event.
serialNumberstring | nullSerial number of the returned unit.
userobject | nullWho 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 }
}
FieldTypeDescription
iduuidRecharge id.
occurredAtISO 8601When it was recharged.
operation / deviceobject | nullWhere it was recharged: { id, name } and { id, serial, name } at the event.
userobject | nullFrozen holder of the recharged code: { name, identification, code, tags }.
currencystring ISO 4217Currency of the account.
minorUnitDecimalsinteger | nullDecimals of the currency (COP = 2). Value = amount / 10^minorUnitDecimals.
amountintegerAmount recharged.
balanceAfterinteger | nullThe 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.

QueryTypeRequiredDefaultLimits / values
pageintegerno1≥ 1
pageSizeintegerno501–200
sortByenumnocreatedAtcreatedAt (only value): user creation, then code creation.
sortOrderenumnodescOnly desc (asc → 422).
searchstringno—Max 100. "Contains" on name, identification or code.
isEmptybooleanno— (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 }
}
FieldTypeDescription
userobjectThe code's owner: { id, identification, name, isActive } (GET /users/:id). isActive: user is active.
codeobjectCode: { codeId, codeType, isActive }. isActive: code is active.
profileobject | nullProfile of the code: { id, name }. null only on old codes without a profile.
currencystring | nullThe account's currency. null only on old codes without a profile.
minorUnitDecimalsinteger | nullDecimals of the currency (COP = 2). Value of balance, recharge and available = amount / 10^minorUnitDecimals.
balanceintegerAvailable subsidy. Refilled according to the profile.
rechargeintegerBalance manually recharged at the machine.
availableintegerbalance + recharge: what the code can spend now. A purchase takes from balance first, then recharge.
lastAccreditationISO 8601 | nullLast time the code was presented at a device to buy.
lastReloadISO 8601 | nullLast automatic subsidy reload.

Errors​

HTTPcodeWhen
400transactions.invalid_filterfrom is not before to, or the range exceeds 366 days.
401http.unauthorizedThe key is missing, invalid, revoked or expired.
403http.forbiddenThe key lacks reports:read.
422validation.failedInvalid query: malformed date, invalid uuid, enum out of range, pageSize above 200, sortOrder=asc on balances, unknown parameter.
429http.too_many_requestsThe key's rate limit was exceeded.