Set

[POST] .../v1/userstock/set

Adds user-to-warehouse assignment. Use this method to give a user access to a stock before the user works with warehouse documents, stock selectors, or POS-related stock workflows. It creates one user-to-stock assignment and returns new_id after validating positive user_id and stock_id. The caller must have user stock set permission; missing body, invalid ids, denied access, duplicate assignment rules, missing related records, and storage errors are returned as HTTP 200 ErrorResult business errors.

Request Parameters

Name Type Required Description
stock_id Int64 Required Stock ID to assign to the user.
user_id Int64 Required System user ID that receives access to the stock.

Request Example

{
  "user_id": 17,
  "stock_id": 8
}

Response Parameters

Name Type Description
ok Boolean Indicates whether the request completed successfully.
result Insert Created record result.

Response Example

{
  "ok": true,
  "result": {
    "new_id": 31
  }
}