(Quick Reference)
Service: Update a price
Description: Returns the updated price in json format when successful. Returns a json response, describing the failure condition when unsuccessful.
Method: PUT
Request content type: application/json
URL:
https://BASE_URL/api/VERSION/prices/{id}
Parameters:
Name | Description | Type | Required | Example values |
---|
id | The numerical ID of the desired price | Long | yes | 123 |
itemId | The numerical ID of item | Long | yes | |
unitId | The numerical ID of unit | Long | yes | |
priceListId | The numerical ID of price-list | Long | yes | |
value | The price value | Double | yes | |
unitPrice | The unit price value | Double | no | |
marginRate | Margin percentage | Double | no | |
URL with external_id:
https://BASE_URL/api/VERSION/prices/reference/{itemId}/{unitId}/{priceListId}
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 |
priceListId | reference of the price list | String | Yes | DL-001 |
value | The price value | Double | yes | |
unitPrice | The unit price value | Double | no | |
marginRate | Margin percentage | Double | no | |
Success Output
Status: HTTP/1.1 200 OK
{
"id": 1,
"priceList": {
"id": 1,
"reference": "cost_based_pricing",
"name": "Cost-based Pricing",
"href": "/api/v1.0/priceLists/1"
},
"itemReference": "bracelet-GRP09062",
"unitReference": "pcs",
"itemUnit": {
"id": 1,
"href": "/api/v1.0/itemUnits/1"
},
"value": 22,
"unitPrice": 20,
"marginRate": 10,
"organization": "entity1",
"dateCreated": "2015-12-17T08:18:27Z",
"lastUpdated": "2015-12-17T08:21:07Z"
}
Failure Output
Status: HTTP/1.1 404 Not Found
{
"error": "not_found",
"error_description": "The price with the id 70 doesn't exist."
}
{
"error": "not_found",
"error_description": "The item with the id 4945 doesn't exist."
}
{
"error": "not_found",
"error_description": "The unit with the id 123 doesn't exist."
}
Status: HTTP/1.1 400 Bad Request
{
"error": "save_failed",
"error_description": "Failed to save instance"
}
{
"error": "not_unique",
"error_description": "Price already used"
}
{
"error": "invalid_param_type",
"error_description": "An invalid value was specified for parameter: marginRate (must be positive)"
}