Skip to main content

Add Stock to a Job

This call associates a stock item with a job, so it will appear in the stock details when viewing a job.

Query String Parameters

NameTypeDescriptionRequired
ActionStringJobAddStockRequired
StockIdIntThe unique identifier of the stock item. Stock Item Id can be retrieved using findstockRequired
JobIdIntThe unique identifier of the job, which can be retrieved using any of the methods listed under add something here.Required
JobRefStringThe reference of the job that is input as free text.Optional - see tip
StockMovementIntDescribes the movement of stock
  • No Movement = 1
  • Brought And Left = 2
  • Brought And taken Back = 3
  • Brought To Swap = 4
  • On Site And Taken back = 5
  • On Site And left = 6
Optional
StockQuantityIntWhen populated, this field adds the quantity of stock on the job.Optional
PickupRefStringContact reference of the pickup location for a stock movement.Optional
PickupIdIntContact Id of the pickup location for a stock movement.Optional
DropOffRefStringContact reference of the drop off location for a stock movement.Optional
DropOffIdIntContact Id of the drop off location for a stock movement.Optional
DeliveredToBeSoldBoolIf set to true, the tick box "Delivered to be sold" will be ticked.Optional
PickupTypeIdIntDetermines whether the pick up is an asset or a contact. The routine defaults to contact if nothing is passed. Contacts = 1, Assets = 2.Optional

note

If the StockId is not supplied job will still have stock allocated but the engineer can select the actual item used when the job is completed. i.e. "This job will require new part of type {StockId} where the actual physical item {ItemId} is not yet known.

Response Codes

CodeMessageInformation
0new { jobStockId = item.JSId
2Invalid Format - PickUpType
2Invalid Parameter value - PickUpType
2Missing Parameter - jobRef or jobId
2invalid Parameter - jobId
2Missing or Invalid Parameter - stockId
2Invalid Parameter - stockMovement
2Job not found
2Stock Item not found
2Brought And Left movement requires a valid pick-up contact
2Brought To Swap movement requires a valid drop-off contact
2On Site And Taken Back movement requires a valid pick-up contact

Example

Request URL

https://webservice.bigchange.com/v01/services.ashx?action=jobaddstock