Stock item, in/out movement and critical-level alert. Movements are on record; the balance is derived from movements.
Endpoints for this resource. Every endpoint is scoped to the clinic data the API key is bound to; write endpoints support the Idempotency-Key header.
/v1/stock
Lists stock items
All authorized roles
/v1/stock/critical
Lists stock at critical level
All authorized roles
/v1/stock
Creates a stock item
admin
/v1/stock/{id}
Updates the stock item
admin
/v1/stock/{id}/movement
Adds a stock movement (in/out)
admin · secretary
/v1/stock/{id}/movements
Lists stock movements
All authorized roles
Pull critical stock
curl https://api.udentiva.com/v1/stock/critical \ -H "Authorization: Bearer udk_live_xxx"
HTTP/1.1 200 OK
[
{
"id": "itm-12",
"name": "Kompozit A2",
"on_hand": 3,
"critical_level": 5
}
]
Security isn't a feature, it's the architecture itself. The guarantees that apply to this resource:
Errors are returned in a consistent envelope; the code is for the machine, the message for the user. Internal error/stack is never leaked.
{
"error": {
"code": "validation_failed",
"message": "Invalid field: email"
}
}
We use cookies necessary for core functionality; analytics and marketing cookies are enabled only with your consent. Cookie ポリシー