O.Z.O.R.A. Items API (0.0.1)

Download OpenAPI specification:

Item management service.

Git Commit ID: d14e0d5e25b97b49cc9cd4e667800f701236d40d
Software Version: 0.0.1
Build: 2026-08-13 09:13:51

Items

Create or update item

Creates a new item, updates an existing item by item_id, or finds an existing item by stock, position, and number.

For new items, stock, position, and item_name are required. If no number is supplied for a new item, an available item number is generated automatically.

Request Body schema: application/json
required
item_id
integer or null

Existing item ID to update

stock
string or null <= 3 characters

Stock code. Required when creating a new item.

position
string or null [ 1 .. 8 ] characters

Stock position. Required when creating a new item.

number
integer or null

Item number used with stock and position to find an existing item

item_name
string or null

Item name. Required when creating a new item.

item_qty
integer or null
status
string or null
condition
string or null
item_image
string or null

Item image as a data URI (e.g. data:image/jpeg;base64,...)

id_account
integer or null

Account ID to link the item to

id_ticket
integer or null

Ticket ID to link the item to

object or null

Key/value metadata to sync for the item

Responses

Request samples

Content type
application/json
Example
{
  • "stock": "A",
  • "position": "B12",
  • "item_name": "Laptop charger",
  • "item_qty": 1,
  • "status": "in",
  • "condition": "working"
}

Response samples

Content type
application/json
{
  • "message": "Item updated.",
  • "item": { },
  • "pdf": "data:application/pdf;base64,JVBERi0xLjQK..."
}

Search items

Searches for items by integer ID, id_ticket, id_account, full item number, or free text (item name). Normal text search terms are trimmed and must be 3-30 characters long. Numeric search terms (plain integers) bypass the 3-character minimum length requirement.

Requires Priv items_search_stocks for non-service calls. Accepts comma-separated stock codes (e.g. "NAU,GEP") or all. Items whose stock does not match the user's allowed values are removed from results (except for id_ticket and id_account searches, which return all matching items unfiltered).

search_term formats:

  • Number in the search term (e.g. "42"): searches by items.id.
  • JSON object with id_ticket (e.g. {"id_ticket": 31090}): searches items linked to that ticket. No stock permission filtering is applied!!! Intended for internal service calls.
  • JSON object with id_account (e.g. {"id_account": 500}): searches items linked to that account. No stock permission filtering is applied!!! Intended for internal service calls.
  • Item number (e.g. "NAUB1200042"): parsed into stock, position, number components.
  • Free text: matched against item_name using accent-insensitive ILIKE.

Response items include all fields from the items table plus related metas.

Authorizations:
bearerAuth
Request Body schema: application/json
required
required
string or object

Responses

Request samples

Content type
application/json
{
  • "search_term": "NAUB1200042"
}

Response samples

Content type
application/json
{
  • "message": "string",
  • "items": [
    ]
}

Get logs for an item

Returns all log entries associated with the given item ID.

Requires the Priv items_search_stocks permission, and the item's stock must be included in the user's allowed stock list.

Privilege name Sample values Description
Priv items_search_stocks * NAU,GEP / all Grants access to retrieve item logs. The item's stock must match the allowed stocks. Without it, the request is denied with 403.
* required permission.
Authorizations:
bearerAuth
Request Body schema: application/json
required
id
required
integer

Item ID to retrieve logs for

Responses

Request samples

Content type
application/json
{
  • "id": 42
}

Response samples

Content type
application/json
{
  • "logs": [
    ]
}

Get ticket IDs linked to items

Returns the distinct non-null ticket IDs referenced by items.

This is a service endpoint - it can only be called by other microservices using a service JWT.

Authorizations:
None

Responses

Response samples

Content type
application/json
{
  • "ticket_ids": [
    ]
}

Defaults

Receive and store the distributed defaults (internal only)

Internal endpoint. Receives the current defaults ({ keyword: value } map) from the emails service and writes them to this service's local defaults.json, but only if the content changed (or the file does not exist yet). Only service-to-service calls (service JWT) are accepted.

Authorizations:
bearerAuth
Request Body schema: application/json
required
required
object

Map of keyword to value

revision
required
integer <int64> >= 0

DB-clock revision of the distributed defaults; older revisions are ignored!

Responses

Request samples

Content type
application/json
{
  • "defaults": {
    },
  • "revision": 1786190488163
}

Response samples

Content type
application/json
{
  • "message": "Defaults file updated.",
  • "created": false,
  • "changed": true,
  • "rejected": false
}