Skip to content

Create Selections

Creates the specified selections.

Endpoint {base-url}/selections
Verb PUT

Request Body

{
  "body": [{
    "id": 0,
    "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 IDs of the created selections.

Response Body

[
  270338
]

On Error

HTTP Code Error Code Definition
400 SPIRAL_UNIQUENESS_ERROR One or more selections have a selectionNumber that already exists on the target machine.
403 DATA_ACCESS_VIOLATION One or more of the specified selections target a machineId or productId outside your organization.
404 MISSING_RECORD One or more of the specified machineId or productId values 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).