POST v1/ProductInventory/MakeAdjustment
This allows you to increase or decrease Stock on Hand (SOH) quantities for a particular product with a specified type (e.g. stocktake, breakage, obsolete etc.) using the ProductCode on the body as the lookup (instead of needing the internal product ID in the URL)
Request Information
URI Parameters
None.
Body Parameters
The product code field must be populated with the SKU of the product you wish to modify
Name | Description | Type |
---|---|---|
ProductID |
The internal identifier for this product this transaction is for e.g. 3479979772705247895 |
integer |
ProductCode |
The external SKU for this product is for e.g. PR-43254 |
string |
InventoryType |
The inventory entry type lookup value |
integer |
QuantityChange |
This field is used when making a delta adjustment (e.g. -5 reduce stock, breakage) to specify the quantity to add or subtract |
decimal number |
ProductCostPrice |
For adjustments that result in additional inventory, the product cost price to use for the new inventory e.g. 5.99 (per unit) |
decimal number |
QuantityInStockSnapshot |
This field is used when specifying the total SOH to use e.g. 1000 for stocktake or EOY reconciliation or opening balance |
decimal number |
Notes |
Any notes you wish to save against this entry |
string |
WarehouseID |
The ID of the warehouse this adjustment relates to - if not supplied, the warehouse will be assumed to be your primary warehouse |
integer |
WarehouseCode |
The user defined code of the warehouse this adjustment is for (if not supplied, the transaction will default to the primary warehouse) e.g. WH3 |
string |
TransferFromWarehouseID |
If supplied along with TransferToWarehouseID, a transfer stock adjustmenbt will be done i.e moving stock from WH1 to WH2. QuantityChange needs to be supplie too. |
integer |
TransferFromWarehouseCode |
If supplied along with TransferToWarehouseCode, a transfer stock adjustmenbt will be done i.e moving stock from WH1 to WH2. QuantityChange needs to be supplie too. |
string |
TransferToWarehouseID |
If supplied along with TransferFromWarehouseID, a transfer stock adjustmenbt will be done i.e moving stock from WH1 to WH2. QuantityChange needs to be supplie too. |
integer |
TransferToWarehouseCode |
If supplied along with TransferFromWarehouseCode, a transfer stock adjustmenbt will be done i.e moving stock from WH1 to WH2. QuantityChange needs to be supplie too. |
string |
QueueInventorySummaryUpdates |
For some products like BoMs or BoM components, these updates can take a few seconds so this option queues them to be done asynchronously |
boolean |
Request Formats
application/json
Sample:
{ "ProductID": 3500531379344297372, "ProductCode": null, "InventoryType": 36015, "QuantityChange": -2.0, "ProductCostPrice": null, "QuantityInStockSnapshot": null, "Notes": "This was a test through the API", "WarehouseID": 3500765854956554, "WarehouseCode": null, "TransferFromWarehouseID": null, "TransferFromWarehouseCode": null, "TransferToWarehouseID": null, "TransferToWarehouseCode": null, "QueueInventorySummaryUpdates": false }
Response Information
Resource Description
Name | Description | Type |
---|---|---|
ProductInventoryID |
The internal identifier for this inventory transaction e.g. 347997977270547474 |
integer |
OrganisationID |
The internal identifier of this organisation in Tradevine e.g. 3451460443781171981 |
integer |
ProductID |
The internal identifier for this product this transaction is for e.g. 3479979772705247895 |
integer |
IsCurrent |
This will always be true to indicate this is the current inventory record |
boolean |
EntryDate |
The date and time (in UTC) the transaction was made |
date |
InventoryType |
The inventory entry type lookup value |
integer |
QuantityChange |
The net quantity change that occurred as a result of this transaction |
decimal number |
ProductCostPrice |
The unit cost price of each piece of inventory if this transaction was an addition |
decimal number |
QuantityInStockSnapshot |
The current total Stock on Hand (SOH) value for this product |
decimal number |
AverageFIFOCost |
The weight-average-cost (WAC) of each piece of inventory as it stands after this transaction |
decimal number |
AvailableBalance |
This is the quantity remaining of this batch of inventory (to be consumed on a FIFO basis) |
decimal number |
TotalInventoryValueSnapshot |
This is the rolled up total inventory value (summing all available balances multiplied by their respective cost prices) |
decimal number |
Currency |
The transaction currency lookup value |
integer |
Reference |
A reference to a shipment or receipt if the current transaction was caused by such a document |
string |
PurchaseOrderID |
The internal identifier to the purchase order causing this inventory transaction (will be null if used through this API call) |
integer |
SalesOrderID |
The internal identifier to the sales order causing this inventory transaction (will be null if used through this API call) |
integer |
PackListID |
The internal identifier to the shipment causing this inventory transaction (will be null if used through this API call) |
integer |
Notes |
Any notes saved against this transaction (from the input) |
string |
CreatedDate |
The date and time (in UTC) that the inventory adjustment was created |
date |
CreatedBy |
The internal Tradevine ID of the user that created the inventory adjustment |
integer |
ModifiedDate |
The date and time (in UTC) that the inventory adjustment was last modified |
date |
ModifiedBy |
The internal Tradevine ID of the user that last modified the inventory adjustment |
integer |
GoodsReceiptID |
The internal identifier to the goods receipt causing this inventory transaction (will be null if used through this API call) |
integer |
AccountingJournalID |
If Xero is integrated, this will be the guid for the manual journal created by Tradevine in Xero for this transaction |
string |
WarehouseID |
The ID of the warehouse this adjustment relates to - if not supplied, the warehouse will be assumed to be your primary warehouse |
integer |
ProductCode |
The external SKU for this product is for e.g. PR-43254 |
string |
WarehouseCode |
The user defined code of the warehouse this adjustment is for (if not supplied, the transaction will default to the primary warehouse) e.g. WH3 |
string |
Response Formats
application/json
Sample:
{ "ProductInventoryID": 3500531406670979433, "OrganisationID": 3500531373198221079, "ProductID": 3500531379344297372, "IsCurrent": true, "EntryDate": "2013-04-02T07:30:06Z", "InventoryType": 36015, "QuantityChange": -2.0, "ProductCostPrice": 45.0, "QuantityInStockSnapshot": 21029.0, "AverageFIFOCost": 45.0, "AvailableBalance": null, "TotalInventoryValueSnapshot": 946305.0, "Currency": 10109, "Reference": null, "PurchaseOrderID": null, "SalesOrderID": null, "PackListID": null, "Notes": "This was a test through the API", "CreatedDate": "2013-04-02T07:30:06Z", "CreatedBy": 1, "ModifiedDate": "2013-04-02T07:30:06Z", "ModifiedBy": 1, "GoodsReceiptID": null, "AccountingJournalID": null, "WarehouseID": null, "ProductCode": null, "WarehouseCode": null }