MobiariDocs
Admin APIInventory

Adjust a variant's stock

POST
/stores/{store_id}/variants/{variant_id}/stock/adjust

Changes the units on hand at one location by a signed delta, or sets them to an absolute count with set_to, with a reason and an optional note. Writes an adjustment entry to the ledger and answers with the variant's new levels. Emits the inventory.updated webhook (inventory.out_of_stock / inventory.low_stock too when the location reaches 0 / 5 or fewer).

Safe on a flaky network: send an Idempotency-Key and retry with the same key until you get an answer; a set_to is idempotent even without one.

Refused while an ERP owns the store's stock (409 inventory_managed_externally, unless force: true) and for kits (409 logical_stock_readonly).

Authorization

bearer_auth
AuthorizationBearer <token>

Authorization: Bearer <token>. Either a session access token from POST /auth/login (refresh it with POST /auth/refresh) or a store API token (mobi_st_…). A store API token works only for the store it was issued in, and can do at most what its issuing user can there, narrowed to the scopes it was issued with.

In: header

Path Parameters

store_id*string

Store id

Formatuuid
variant_id*string

Variant id

Formatuuid

Header Parameters

Idempotency-Key?string

A unique value (e.g. a UUID) per logical request. Retrying with the same key within 24 hours replays the first response instead of repeating the side effect; the replay carries Idempotent-Replayed: true. Reusing a key for a different request is a 422 idempotency_key_reused; retrying while the first is still running is a 409 idempotency_request_in_progress. JSON bodies up to 1 MB.

Lengthlength <= 255

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/stores/497f6eca-6276-4993-bfeb-53cbbbba6f08/variants/497f6eca-6276-4993-bfeb-53cbbbba6f08/stock/adjust" \  -H "Content-Type: application/json" \  -d '{}'
{
  "location_id": "46910cc3-ab41-4b80-b4a7-94dab9f1b795",
  "movement_id": "91f31a1e-b7f2-4510-b623-c550715ad5a8",
  "stock": {
    "available": 0,
    "barcode": "string",
    "buildable": 0,
    "incoming": 0,
    "limiting_sku": "string",
    "name": "string",
    "on_hand": 0,
    "product_id": "0d012afa-f885-4e65-aeca-37e27701e2d1",
    "product_title": "string",
    "reorder_point": 0,
    "reorder_quantity": 0,
    "reserved": 0,
    "sku": "string",
    "stock_by_location": [
      {
        "available": 0,
        "is_active": true,
        "is_default": true,
        "location_id": "46910cc3-ab41-4b80-b4a7-94dab9f1b795",
        "location_name": "string",
        "on_hand": 0,
        "reserved": 0
      }
    ],
    "stock_owner": "string",
    "stock_owner_name": "string",
    "uses_components": true,
    "variant_id": "8a2d415d-59aa-4132-bef3-011f97c4a0f6"
  }
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}
{
  "code": "not_found",
  "details": {},
  "error": "Order not found"
}