Search Documentation

Search API endpoints, webhooks, tools, and guides

On this page6 sections
Is this helpful?
Quick Actions
Download OpenAPI.json
POST/api/inventory/update-inventoryInventoryPermission: inventory.update

Update Inventory Level

Performs an idempotent stock adjustment (`SET`, `IN`, or `OUT`) inside a database transaction using `idempotencyKey`. Rejects negative stock outcomes with `409 Conflict`.

Authentication: Requires Authorization: Bearer <ACCESS_TOKEN> (Supabase JWT, OAuth2 M2M token, or integration token).

Outlet Scope Enforcement: Results and mutations are automatically scoped to the actor's accessible outlets when the inventory module restriction applies.

Request

Provide the following fields in the request payload.

Body application/json
outletIdstring (uuid)required

outlet Id parameter.

productIdstring (uuid)required

product Id parameter.

variantIdstring (uuid)optional

variant Id parameter.

operationenum('SET' | 'IN' | 'OUT')required

operation parameter.

quantityinteger | nullrequired

quantity parameter.

minimumStockinteger | nulloptional

minimum Stock parameter.

reasonstringrequired

reason parameter.

idempotencyKeystring (uuid)required

idempotency Key parameter.

Responses

Select a status code to inspect schema.

OK — Inventory adjusted (or existing idempotent result returned).application/json
successenum('true')

Success (true).

messagestring

Message.

dataobject | null

Response payload or null.

POST/api/inventory/update-inventory
curl -X POST "https://api.invoger.com/api/inventory/update-inventory" \
  -H "Authorization: Bearer <ACCESS_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{ "outletId": "o1a2b3c4-d5e6-7f8a-9b0c-1d2e3f4a5b6c", "productId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "operation": "IN", "quantity": 25, "reason": "Restock shipment #PO-104", "idempotencyKey": "11111111-2222-4333-8444-555555555555" }'
Interactive playground

Response

application/json
{
  "success": true,
  "message": "Inventory updated successfully",
  "data": {
    "quantityAfter": 70,
    "Duplicate": false
  }
}