Skip to content

Apply Delta to Selections

This route lets you apply deltas (inventory count changes) to selections in the machine. This is useful for handling shipment scenarios where you don't care what the starting on-hand count is, only that you want to add or remove inventory from whatever is currently reported. Changes done this way will generate inventory adjustment records that will allow you to accurately track changes over time.

Endpoint {base-url}/selections/apply-delta
Verb POST

Request Body

{
  "body": [{
    "selectionId": 3345,
    "delta": -2
  }]
}

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": 3345,
    "machineId": 418,
    "productId": 424,
    "price": 0.7,
    "invoicePrice": 0.0,
    "restockTo": 10,
    "depth": 10,
    "count": 7,
    "isActive": false,
    "alertLevel": 2,
    "restockAt": null,
    "freeCount": 0,
    "tax": 0.0,
    "commission": 0.0,
    "selectionNumber": 1,
    "friendlyNumber": "1"
  }
]

On Error

HTTP Code Error Code Definition
403 DATA_ACCESS_VIOLATION One or more of the specified selectionId values belong to a machine outside your organization.
404 MISSING_RECORD One or more of the specified selectionId values does not exist.