(Quick Reference)
Service: Upsert a warehouse stock
Description: This web service is used to insert a warehouse stock to the database if it does not already exist, or update it.
URL with external_id:
https://BASE_URL/api/VERSION/warehouseStocks/reference/{itemId}/{unitId}/{warehouseId}
Method: POST
Parameters:
Name | Description | Type | Required | Examples values |
---|
itemId | reference of the item | String | Yes | eliteBook_820 |
unitId | reference of the unit | String | Yes | Piéce |
warehouseId | reference of the warehouse | String | Yes | VETEMENT-001 |
supplyDate | | Date | no | 2017-05-17T07:00:00Z |
resetReservedQty | | Boolean | no | true, false |
quantity | | Integer | no | |
Success Output
Success case: response.status=200
{
"id": 1,
"warehouseReference": "entrepotA",
"warehouse": {
"id": 4,
"reference": "entrepotA",
"name": "entrepot A",
"href": "/api/v1.0/warehouses/4"
},
"itemReference": "bracelet-GRP09062",
"unitReference": "pcs",
"item": {
"id": 495,
"reference": "bracelet-GRP09062",
"name": "Knot Band Bracelet",
"href": "/api/v1.0/items/495"
},
"unit": {
"id": 1,
"reference": "pcs",
"name": "pieces",
"href": "/api/v1.0/units/1"
},
"quantity": 2659,
"reservedSerialNumbers": null,
"supplyDate": null,
"organization": "entity1",
"dateCreated": "2015-12-17T08:21:27Z",
"lastUpdated": "2016-04-18T15:51:19Z"
}
Failure Output
Failure case:response.status = 404
{
"error": "not_found",
"error_description": "The warehouse stock with the id 199 doesn't exist."
}