(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:

NameDescriptionTypeRequiredExamples values
itemIdreference of the itemStringYeseliteBook_820
unitIdreference of the unitStringYesPiéce
warehouseIdreference of the warehouseStringYesVETEMENT-001
supplyDate Dateno2017-05-17T07:00:00Z
resetReservedQty Booleannotrue, false
quantity Integerno 

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."
}