(Quick Reference) Service: Update a serial number

Description: Returns the updated serial number in json format when successful. Returns a json response, describing the failure condition when unsuccessful.

URL:

https://BASE_URL/api/VERSION/serialNumbers/{id}

Method: PUT

Request content type: application/json

Parameters:

NameDescriptionTypeRequiredExample values
idThe ID of the desired serial numberLong/Stringyes123
value Stringyes 
useExternalIdBy default, it is set to false. set it to true if you want to use external ids.Booleannotrue , false

Success Output

Status: HTTP/1.1 200 OK

{
  "id": 2704563,
  "value": "4562P109E",
  "status": "NEW",
  "itemId": 771,
  "item": {
    "id": 771,
    "reference": "LENOVO-A7010-WHITE",
    "href": "/api/v1.0/items/771"
  },
  "warehouseStockId": null,
  "organization": "entity1",
  "dateCreated": "2016-11-08T08:15:34Z",
  "lastUpdated": "2016-11-08T08:15:34Z"
}

Failure Output

Status: HTTP/1.1 400 Bad Request

{
  "error": "save_failed",
  "error_description": "Failed to save instance."
}

{
  "error": "not_unique",
  "error_description": "value already used"
}

{
  "error": "not_unique",
  "error_description": "Serial number must be unique"
}
{
  "error": "not_unique",
  "error_description": "serial number value already used"
}

Status: HTTP/1.1 404 Not Found

{
  "error": "not_found",
  "error_description": "The serial number with the id 89 doesn't exist."
}

{
  "error": "not_found",
  "error_description": "The item with the id 77 doesn't exist."
}