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
Name | Type | Description | Required |
---|---|---|---|
Action | String | JobAddStock | Required |
StockId | Int | The unique identifier of the stock item. Stock Item Id can be retrieved using findstock | Required |
JobId | Int | The unique identifier of the job, which can be retrieved using any of the methods listed under add something here. | Required |
JobRef | String | The reference of the job that is input as free text. | Optional - see tip |
StockMovement | Int | Describes the movement of stock
| Optional |
StockQuantity | Int | When populated, this field adds the quantity of stock on the job. | Optional |
PickupRef | String | Contact reference of the pickup location for a stock movement. | Optional |
PickupId | Int | Contact Id of the pickup location for a stock movement. | Optional |
DropOffRef | String | Contact reference of the drop off location for a stock movement. | Optional |
DropOffId | Int | Contact Id of the drop off location for a stock movement. | Optional |
DeliveredToBeSold | Bool | If set to true, the tick box "Delivered to be sold" will be ticked. | Optional |
PickupTypeId | Int | Determines 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
Code | Message | Information |
---|---|---|
0 | new { jobStockId = item.JSId | |
2 | Invalid Format - PickUpType | |
2 | Invalid Parameter value - PickUpType | |
2 | Missing Parameter - jobRef or jobId | |
2 | invalid Parameter - jobId | |
2 | Missing or Invalid Parameter - stockId | |
2 | Invalid Parameter - stockMovement | |
2 | Job not found | |
2 | Stock Item not found | |
2 | Brought And Left movement requires a valid pick-up contact | |
2 | Brought To Swap movement requires a valid drop-off contact | |
2 | On Site And Taken Back movement requires a valid pick-up contact |
Example
- Request
- Response
Request URL
https://webservice.bigchange.com/v01/services.ashx?action=jobaddstock
Response Data
{ "Code": 0, "Result": [ { "AssetCheckId": "12345" } ] }