Jobs

Create a job stock

Create a new job stock. Job stock cannot be created for a job with cancelled status (required scope jobs:write)

post/v1/jobs/{jobId}/stock

Path parameters

jobIdinteger required

Headers

Customer-Idinteger required

The customer identifier

Request body

stockDetailsIdinteger

The identifier of the type of stock associated with the planned stock usage on the job. Only one job stock can be created per stock detail if stock item id is null

stockItemIdinteger nullable

The identifier of the specific stock item associated with the planned stock usage on the job. Must be null when stock detail is consumable. Only one job stock can be created per stock item

action'noMovement' | 'broughtAndLeft' | 'broughtAndTakenBack' | 'onSiteAndTakenBack' | 'onSiteAndLeft' | 'usedInStock'

Represents the actions that can be performed on a job stock<p>Possible values:</p><ul><li><b>noMovement</b>: No movement. Can not use when job is completed or cancelled</li><li><b>broughtAndLeft</b>: Brought to job and left at location. Can not use when job is completed or cancelled. When this action is selected, the drop off contact id will be set to the job contact id automatically</li><li><b>broughtAndTakenBack</b>: Brought to job and taken back. Can not use when job is completed or cancelled</li><li><b>onSiteAndTakenBack</b>: Taken from job location. Can not use when job is completed or cancelled. When this action is selected, the pickup contact id will be set to the job contact id automatically</li><li><b>onSiteAndLeft</b>: Already on site and left at location. Can not use when job is cancelled</li><li><b>usedInStock</b>: Used on equipment. Can not use when job is completed or cancelled</li></ul>

quantityPlannednumber double nullable

The anticipated quantity of stock units that will be used on a job. Must be null or 1 when stock detail is not consumable. Can't be null when stock detail is consumable

pickupContactIdinteger nullable

The identifier for the contact at the pickup location during the planned stock usage

dropOffContactIdinteger nullable

The identifier for contact at the drop-off location during the planned stock usage

isDeliveredToBeSoldboolean

A flag indicating whether the stock is delivered to be sold

isEquipmentAtDropOffboolean

A flag indicating whether the stock equipment is at the drop-off location

Example request

{
  "stockDetailsId": 7775,
  "stockItemId": 5954,
  "action": "noMovement",
  "quantityPlanned": 10.5,
  "pickupContactId": 1234,
  "dropOffContactId": 676,
  "isDeliveredToBeSold": true,
  "isEquipmentAtDropOff": true
}

Response

Created

idinteger

Identifier of the newly created record