Skip to main content

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...'
SituationHTTPcode
Missing x-api-key header401http.unauthorized
Unknown, revoked or expired key401http.unauthorized
A user session (Authorization: Bearer …) is sent instead of the key401http.unauthorized
The key lacks the endpoint's permission403http.forbidden
The key is used outside /api/v1403http.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:

BehaviorVENDINGEAS
ProfilesCarry vending (subsidy and reload)Carry lines (rules per product)
Code balances (balance, recharge)YesNo: always 0
TicketsNot availableYes
Product serial numbersNot availableYes
Recharges and balancesYesEmpty page
ReturnsEmpty pageYes

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:

PermissionEndpoints
accounts:readAccount
operations:readOperations
devices:readDevices: list and detail
device_inventory:readA device's planogram
device_stock:readSelection movements and reading stock orders
device_stock:createCreate stock orders and add or remove their lines
device_stock:updateConfirm or cancel stock orders
users:read / users:create / users:update / users:deleteUsers
codes:create / codes:update / codes:deleteA user's codes
products:read / products:create / products:update / products:deleteProducts, categories and serial numbers
profiles:read / profiles:create / profiles:update / profiles:deleteProfiles
tickets:read / tickets:create / tickets:update / tickets:deleteTickets
reports:readDeliveries, returns, recharges and balances

What the API covers​

PageWhat you can do
AccountRead the key's account (currency, tag keys).
OperationsList and get. Read only.
DevicesList, get, read the planogram and the selection movements. Read only.
Stock ordersCreate, list, get, build, confirm and cancel. The only way to move inventory.
Users and codesCreate, list, get, edit, activate, deactivate and delete users, and the same with their codes.
ProductsCreate, list, get, edit and delete products and categories, and their serial numbers.
ProfilesCreate, list, get, edit, activate, deactivate and delete.
TicketsIssue, list, get, activate, deactivate, cancel and delete (EAS accounts). An issued ticket cannot be edited.
MovementsRead 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).

ResourceNatural keyExample
Deviceserial/devices/ICS595DDE99B
Useridentification/users/1016075813
User codeits value (codeId)/users/1016075813/codes/QR-0001
Ticketcode/tickets/OT-2026-00123/cancel
Productsku/products/EPP-GUA
Serial numberserialNumber/products/EPP-GUA/serial-numbers/GAF-0001
Operation, profile, categoryname/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 uuid is looked up as an id first 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 the id.
  • A product without a SKU can only be referenced by id. Stock orders and their lines have no natural key: they go by id.
  • 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 goesResponse
In the URL404 with the entity's code (devices.not_found, users.not_found…).
In a bodyThe referenced entity's error, the same as with an id that does not exist.
In a filterEmpty 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. Send Content-Type: application/json.
  • Ids: uuid in the id field. 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, from is inclusive and to is 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 in currency, with its decimals in minorUnitDecimals: value = amount / 10^minorUnitDecimals. In writes amounts are required; no price is written as 0. 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 }, not productId. The shape is the same in every endpoint. A reference with no value is null (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>Id or the natural key.
  • Every entity has createdAt and updatedAt. Movement records (deliveries, returns, recharges, selection movements) are immutable and carry occurredAt instead.

Standard shapes​

ReferenceFieldsWhere it appears
Operationid, namedevices, stock orders, movements
Deviceid, serial, nameprofiles, tickets, units, stock orders, movements
Productid, sku (| null), nameplanogram, profiles, tickets, units, stock orders, movements
Categoryid, nameproducts
Profileid, nameuser codes, balances
Ticketid, code, name (| null)EAS deliveries and returns
Stock orderid, numberselection movements
Movementid, occurredAtreturn → 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
}
Money

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 }
}
ParameterTypeRequiredDefaultLimits / values
pageintegerno1≥ 1
pageSizeintegerno501–200
sortByenumnoper listOnly the values each list documents. Anything else → 422.
sortOrderenumnodescasc, desc
  • pagination.total is the number of records matching the filters (not the page size).
  • A page past the last one returns data: [] with the real total.
  • When the sort field repeats, most lists break ties by id and 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 (also 1/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.

ActionMethodResponse
CreatePOST /api/v1/<resource>201 with the full entity
List and getGET /api/v1/<resource> · GET /api/v1/<resource>/:id200
EditPATCH /api/v1/<resource>/:id200 with the full entity
Change statePOST /api/v1/<resource>/:id/<action> (activate, deactivate, cancel, confirm…), no body unless stated200 with the entity
DeleteDELETE /api/v1/<resource>/:id204 with no body
  • PATCH is partial: only what you send changes. Each page says exactly which fields it accepts; a field that cannot be edited is rejected with 422 validation.failed, not ignored.
  • A field you send must carry a valid value. null is 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 409 with 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" }
]
}
HTTPWhen
400A data rule fails (e.g. a name shorter than 2 characters after trimming).
401The key is missing, invalid, revoked or expired.
403The key lacks the endpoint's permission.
404The resource does not exist, was deleted or belongs to another account.
409Conflict with the current state: duplicate, resource in use, state that does not allow the action.
422validation.failed: wrong type, missing required field, limit exceeded, value outside the enum, unknown or non-editable field.
429The key's rate limit was exceeded. Honor Retry-After.
500Server 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.