Set
[POST] .../v1/promoprogramstock/set
Assigns a warehouse to a promotion. Set the stocks where one loyalty promotion program is available. The request body is an array of one to 250 records; every record must contain program_id and stock_id and all rows in the batch must target the same program_id. The method requires the promotion-stock set permission, checks stock access for the current request user, restores an existing deleted link or inserts a new one and returns new_id from the insert/update operation. Errors such as a missing or empty array body, batch-size violations, invalid ids, mixed program_id values, denied access, inaccessible stock, disabled retail promotion tariff or storage errors are returned as HTTP 200 ErrorResult.
Request Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| program_id | Int64 | Required | Promotion ID. |
| stock_id | Int64 | Required | Stock ID. |
Request Example
[
{
"program_id": 1,
"stock_id": 1
}
]
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": 1
}
}