Add or Update a Stock Item
Add or update stock details on a stock item record.
Query String Parameters
Name | Type | Description | Required |
---|---|---|---|
Action | String | StockItemSave | Required |
StockItemId | Int | Filter by Stock Item Id. | Required |
ItemSerialNumber | String | Filter by Item Serial Number. | Required |
Quantity | Int | Quantity of the consumable stock item, where the item is set to consumable. | Optional |
NewItemSerialNumber | String | Enter a new item serial number. Modifies an existing stock items serial number. | Optional |
CustomerSerialNumber | String | Record the customer serial number. | Optional |
SupplierSerialNumber | String | Record the supplier serial number. | Optional |
AltSerialNumber | String | Record the alt serial number. | Optional |
Usage | Double | Modified the current usage of the stock item. Only available where the item is a serialised item. | Optional |
Notes | String | Change the notes of the stock item record. Overwrites the existing stock note. | Optional |
IsEquipment | Bool | Modifies the switch to determine whether the stock item record is set as equipment or stock. | Optional |
cust_custom field name | string | Pass cust_ followed by the caption of an existing custom field. | Optional |
Response Codes
Code | Message | Information |
---|---|---|
0 | Response Data | See 'Response' example tab |
2 | Missing Parameter - routine requires at least stockitemid or serialnumber | Mandatory parameter was not supplied |
2 | Invalid parameter format - stockItemId | Integer value is invalid or was not specified (when required) |
2 | The stock item does not exist in JobWatch for the supplied parameters | No record found using the specified parameters |
2 | The stock record associated with this stock item does not exist in JobWatch | No record found using the specified parameters |
2 | Invalid parameter format - quantity | Double value is invalid or was not specified (when required) |
2 | Invalid parameter format - usage | Double value is invalid or was not specified (when required) |
2 | misc_noRight | You do not have the permissions to edit stock. |
Example
- Request
- Response
Request URL
https://webservice.bigchange.com/v01/services.ashx?action=StockItemSave&StockItemId=1660704&Quantity=5
Response Data
{ "Code": 0, "Result": { "StockItemId": 1660704, "StockId": 579756, "StockItemCurrentContactId": null, "StockItemCurrentContactName": null, "StockItemCurrentAssetId": null, "StockItemCurrentAssetRegistration": "", "StockItemIsEquipment": false, "StockItemUsage": null, "StockItemNote": "", "StockItemCondition": 0, "StockItemQuantity": 5, "StockItemCreationDate": "2018-02-05 13:50:34", "StockItemSoldDate": null, "StockItemCustomFields": {}, "StockItemAltReference": "", "StockItemSupplierReference": "", "StockItemCustReference": "", "StockItemReference": "" } }