Update Selections
Updates the specified selections. Changes to the inventory count will result in the generation of an inventory adjustment record that will allow for historical tracking of inventory over time. Changes that impact machine operation will result in the machines planogram changed flag being set and the machine will get the changes after its next scheduled check-in - typically within 45 minutes (but depending on your organization preferences).
| Endpoint | {base-url}/selections |
|---|---|
| Verb | PATCH |
Request Body
{
"body": [{
"id": 3347,
"machineId": 418,
"productId": 441,
"price": 0.75,
"invoicePrice": 0.35,
"restockTo": 10,
"depth": 10,
"count": 5,
"isActive": false,
"alertLevel": 1,
"restockAt": 1,
"freeCount": 1,
"tax": 0.1,
"commission": 0.1,
"selectionNumber": 6,
"friendlyNumber": "5"
}]
}
Note
All changes in this request are atomic. If any item fails, the entire batch is rolled back and no changes are made.
Returns
On Success
The updated selections.
Response Body
[{
"id": 3347,
"machineId": 418,
"productId": 441,
"price": 0.75,
"invoicePrice": 0.35,
"restockTo": 10,
"depth": 10,
"count": 5,
"isActive": false,
"alertLevel": 1,
"restockAt": 1,
"freeCount": 1,
"tax": 0.1,
"commission": 0.1,
"selectionNumber": 6,
"friendlyNumber": "5"
}]
On Error
| HTTP Code | Error Code | Definition |
|---|---|---|
| 403 | DATA_ACCESS_VIOLATION | One or more of the specified selections, the target machineId, or the target productId, belong to a record outside your organization. |
| 404 | MISSING_RECORD | One or more of the specified selection id values, the target machineId, or the target productId, does not exist. |
| 422 | VALIDATION_ERROR | A required field is missing or invalid (e.g. machineId must be a positive integer, price must be positive, restockTo must be >= restockAt, restockTo must be <= depth, alertLevel must be <= restockAt). |