API for integrations
The public API v1 lets an external system (ERP, BI, your own integration) read and write INSSACS data with an API key, without using anyone's session. This section is the full contract: every endpoint, what it accepts, what it returns and which errors it can answer with.
Keys are created in the app: API Keys.
Base URL
https://back.inssacs.com/api/v1
Every endpoint in this section lives under /api/v1. API keys only work there: outside /api/v1
a key gets 403.
Authentication
Send the key in the x-api-key header on every request:
curl https://back.inssacs.com/api/v1/products \
-H 'x-api-key: ics_a1b2c3d4_e5f6...'
| Situation | HTTP | code |
|---|---|---|
Missing x-api-key header | 401 | http.unauthorized |
| Unknown, revoked or expired key | 401 | http.unauthorized |
A user session (Authorization: Bearer …) is sent instead of the key | 401 | http.unauthorized |
| The key lacks the endpoint's permission | 403 | http.forbidden |
The key is used outside /api/v1 | 403 | http.forbidden |
Scope: the key's account
Every key belongs to one account and works only inside it: everything it reads and writes (operations, devices, products, profiles, users, tickets, movements…) belongs to that account.
- You never pick the account in a request. It comes from the key. There are no fields or filters
to point at another account, and any field not documented in this section is rejected with
422 validation.failed. - Anything from another account does not exist for the key: requesting it by id or by its key
returns
404, just like something that does not exist. In list filters, a reference from another account gives an empty page. - If an integration works with several accounts, use one key per account.
The account has a business line, VENDING or EAS, and the API behaves accordingly:
| Behavior | VENDING | EAS |
|---|---|---|
| Profiles | Carry vending (subsidy and reload) | Carry lines (rules per product) |
Code balances (balance, recharge) | Yes | No: always 0 |
| Tickets | Not available | Yes |
| Product serial numbers | Not available | Yes |
| Recharges and balances | Yes | Empty page |
| Returns | Empty page | Yes |
The line is something you observe in the resources: it is not a field you send, and it is not returned in responses.
Permissions
When you create the key you choose what it can do (see API Keys). A key has no role: its permission list is everything it can do. Each endpoint requires one:
| Permission | Endpoints |
|---|---|
accounts:read | Account |
operations:read | Operations |
devices:read | Devices: list and detail |
device_inventory:read | A device's planogram |
device_stock:read | Selection movements and reading stock orders |
device_stock:create | Create stock orders and add or remove their lines |
device_stock:update | Confirm or cancel stock orders |
users:read / users:create / users:update / users:delete | Users |
codes:create / codes:update / codes:delete | A user's codes |
products:read / products:create / products:update / products:delete | Products, categories and serial numbers |
profiles:read / profiles:create / profiles:update / profiles:delete | Profiles |
tickets:read / tickets:create / tickets:update / tickets:delete | Tickets |
reports:read | Deliveries, returns, recharges and balances |
What the API covers
| Page | What you can do |
|---|---|
| Account | Read the key's account (currency, tag keys). |
| Operations | List and get. Read only. |
| Devices | List, get, read the planogram and the selection movements. Read only. |
| Stock orders | Create, list, get, build, confirm and cancel. The only way to move inventory. |
| Users and codes | Create, list, get, edit, activate, deactivate and delete users, and the same with their codes. |
| Products | Create, list, get, edit and delete products and categories, and their serial numbers. |
| Profiles | Create, list, get, edit, activate, deactivate and delete. |
| Tickets | Issue, list, get, activate, deactivate, cancel and delete (EAS accounts). An issued ticket cannot be edited. |
| Movements | Read deliveries, returns, recharges and available balances. |
A key only works inside its account. Anything not in this table is not in the API: the account, operations and devices are not edited, the planogram is not written directly, and a key does not manage API keys.
References: id or natural key
Every resource can be pointed at by its id or by its natural key, the one your system already
knows: in the URL (GET /api/v1/devices/ICS595DDE99B), in list filters (?deviceId=ICS595DDE99B)
and in body references ("allowedDeviceIds": ["ICS595DDE99B"]). In requests the fields are named <entity>Id and accept either value. Responses return the reference as an object (see Format).
| Resource | Natural key | Example |
|---|---|---|
| Device | serial | /devices/ICS595DDE99B |
| User | identification | /users/1016075813 |
| User code | its value (codeId) | /users/1016075813/codes/QR-0001 |
| Ticket | code | /tickets/OT-2026-00123/cancel |
| Product | sku | /products/EPP-GUA |
| Serial number | serialNumber | /products/EPP-GUA/serial-numbers/GAF-0001 |
| Operation, profile, category | name | /profiles/Plant%20Gear |
- Everything is looked up within the key's account: a key from another account responds like one that does not exist.
- A value shaped like a
uuidis looked up as anidfirst and, if not found, as a key. - Names are compared ignoring case and repeated spaces (
plant gear=Plant Gear). Since a name can be edited, if your system stores the reference for long, store theid. - A product without a SKU can only be referenced by
id. Stock orders and their lines have no natural key: they go byid. - URL-encode the key if it has spaces or special characters (
%20,%2F…). - Responses always carry the
id.
What happens when the reference does not exist in the account:
| Where it goes | Response |
|---|---|
| In the URL | 404 with the entity's code (devices.not_found, users.not_found…). |
| In a body | The referenced entity's error, the same as with an id that does not exist. |
| In a filter | Empty page. |
Rate limit
Each key has a requests per minute limit (fixed 1-minute window): 120 by default, or the
key's Rate limit value. Beyond it the API answers 429 http.too_many_requests with a Retry-After
header (seconds until the window frees up).
Space out batch processes and, on a 429, wait what Retry-After says before retrying.
Format
- JSON in
camelCase, in requests and responses. SendContent-Type: application/json. - Ids:
uuidin theidfield. In requests (filters, bodies,:id) references stay flat,<entity>Id, and accept the id or the natural key (see References). - Dates: ISO 8601 in UTC (
2026-10-09T14:05:00.000Z). In filters,fromis inclusive andtois exclusive. - Money: integer in minor units of the account's currency (COP with 2 decimals:
150000= $1,500.00),≥ 0, never decimal. The currency is not sent: it is the account's and is read incurrency, with its decimals inminorUnitDecimals: value =amount/ 10^minorUnitDecimals. In writes amounts are required; no price is written as0. See Amounts and currency. - Empty fields: come as
null, never omitted from responses. - Enums for states and types are UPPERCASE (
ACTIVE,CONFIRMED,LOAD). - References are embedded. When a record points to another entity, the response carries an
object with that entity's fixed shape (see standard shapes), not a bare id: a
delivery carries
product: { id, sku, name }, notproductId. The shape is the same in every endpoint. A reference with no value isnull(the whole object, never{ "id": null }) and a list of references is an array of objects (allowedDevices: [{ … }]).- Movements (deliveries, returns, recharges, selection movements): the object comes from what was frozen at the time of the event, with the name it had then.
- Catalogs (devices, products, profiles, tickets, stock orders, units, codes): the object carries the current name, even if the referenced entity was deleted since.
- What is not a reference (
selection,serialNumber, amounts, dates, states) stays flat. - Inputs (filters, bodies,
:id) do not change: they stay flat with<entity>Idor the natural key.
- Every entity has
createdAtandupdatedAt. Movement records (deliveries, returns, recharges, selection movements) are immutable and carryoccurredAtinstead.
Standard shapes
| Reference | Fields | Where it appears |
|---|---|---|
| Operation | id, name | devices, stock orders, movements |
| Device | id, serial, name | profiles, tickets, units, stock orders, movements |
| Product | id, sku (| null), name | planogram, profiles, tickets, units, stock orders, movements |
| Category | id, name | products |
| Profile | id, name | user codes, balances |
| Ticket | id, code, name (| null) | EAS deliveries and returns |
| Stock order | id, number | selection movements |
| Movement | id, occurredAt | return → delivery; selection movement → delivery or return |
| Holder (movements only) | name, identification, code ({ codeId, codeType } | null), tags ({ key, value }[]) | deliveries, returns, recharges |
The holder has no id: the movements ledger freezes the identification and the code, not the user id.
Example, a reference with and without a value:
{
"product": { "id": "00000000-0000-7000-8000-0000000000b4", "sku": "AGUA-600", "name": "Agua 600 ml" },
"ticket": null
}
Every amount is an integer in minor units. To get the value, divide by 10^minorUnitDecimals:
with currency: "COP" and minorUnitDecimals: 2, amount: 250000 is 2,500.00.
minorUnitDecimals travels next to currency on the account, products, user codes, deliveries,
recharges and balances. Profiles carry currency; their amounts use the
account's decimals.
Lists
All lists share the same parameters and the same envelope:
GET /api/v1/users?page=2&pageSize=50&sortBy=name&sortOrder=asc&isActive=true
{
"data": [ { "id": "01a1213b-17ec-70be-9897-a55b5ea19962", "...": "..." } ],
"pagination": { "page": 2, "pageSize": 50, "total": 120 }
}
| Parameter | Type | Required | Default | Limits / values |
|---|---|---|---|---|
page | integer | no | 1 | ≥ 1 |
pageSize | integer | no | 50 | 1–200 |
sortBy | enum | no | per list | Only the values each list documents. Anything else → 422. |
sortOrder | enum | no | desc | asc, desc |
pagination.totalis the number of records matching the filters (not the page size).- A page past the last one returns
data: []with the realtotal. - When the sort field repeats, most lists break ties by
idand pagination is stable. Selection movements and stock orders in descending order, serial numbers and categories do not: to page them without gaps, narrow the date range. - Boolean filters accept
true/false(also1/0). A boolean filter with an unrecognized value is ignored. - An unknown parameter returns
422 validation.failed.
Create, read, edit and delete
Every page documents its endpoints in that order: create, list, get, edit (and change state) and
delete. :id is the id or the natural key.
| Action | Method | Response |
|---|---|---|
| Create | POST /api/v1/<resource> | 201 with the full entity |
| List and get | GET /api/v1/<resource> · GET /api/v1/<resource>/:id | 200 |
| Edit | PATCH /api/v1/<resource>/:id | 200 with the full entity |
| Change state | POST /api/v1/<resource>/:id/<action> (activate, deactivate, cancel, confirm…), no body unless stated | 200 with the entity |
| Delete | DELETE /api/v1/<resource>/:id | 204 with no body |
PATCHis partial: only what you send changes. Each page says exactly which fields it accepts; a field that cannot be edited is rejected with422 validation.failed, not ignored.- A field you send must carry a valid value.
nullis accepted only where the page says so (e.g. to clear a description). - A business rule that blocks the action (a duplicate name, a product in use, an already confirmed
order) returns
409with its code.
Errors
Errors come as application/problem+json:
{
"type": "https://api.inssa.com.co/errors/products-code-exists",
"title": "Code Exists",
"status": 409,
"detail": "Product code 'EPP-CAS' already exists in this account",
"instance": "/api/v1/products",
"code": "products.code_exists",
"traceId": "4f0c2a7e-6c1d-4f5b-9a3e-1d2c3b4a5f60"
}
A validation error carries one item per field in errors:
{
"type": "https://api.inssa.com.co/errors/validation-failed",
"title": "Validation Failed",
"status": 422,
"detail": "One or more fields are invalid",
"instance": "/api/v1/products",
"code": "validation.failed",
"traceId": "9b1e4c3d-2a5f-4e6b-8c7d-0f1e2d3c4b5a",
"errors": [
{ "field": "sellPrice", "issue": "sellPrice must not be less than 0", "rule": "min" },
{ "field": "currency", "issue": "property currency should not exist", "rule": "whitelistValidation" }
]
}
| HTTP | When |
|---|---|
400 | A data rule fails (e.g. a name shorter than 2 characters after trimming). |
401 | The key is missing, invalid, revoked or expired. |
403 | The key lacks the endpoint's permission. |
404 | The resource does not exist, was deleted or belongs to another account. |
409 | Conflict with the current state: duplicate, resource in use, state that does not allow the action. |
422 | validation.failed: wrong type, missing required field, limit exceeded, value outside the enum, unknown or non-editable field. |
429 | The key's rate limit was exceeded. Honor Retry-After. |
500 | Server error. The traceId is what to give support. |
code is stable and is what an integration should read; detail is text for people and may change.
Each page lists the codes of its endpoints.