(Quick Reference) Service: Update

Description: This web service is used in order to update an existing price list object to the database

URL:

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

URL with external_id:

https://BASE_URL/api/VERSION/priceLists/reference/{id}

Method: PUT

Request content type: application/json

Parameters:

NameDescriptionTypeRequiredExample values
referencethe new reference of the price listStringYes 
namethe new name of the price listStringYes 
cumulateWithPromotionSet to true by defaultBooleanNotrue, false
cumulateWithDiscountSet to true by defaultBooleanNotrue, false
reference must be unique

Success Output

Success case: response.status=201
{
    "id": 10,
    "name": "AddedPriceLIst12 new",
    "reference": "PL-009",
    "cumulateWithPromotion": false,
    "cumulateWithDiscount": true,
    "isDefaultInOtherMobileOperation": false,
    "organization": "Lyon",
    "dateCreated": "2016-08-18T15:23:47Z",
    "lastUpdated": "2016-08-18T15:43:23Z"
}

Failure Output

Failure case:response.status = 400
{
    "error": "missing_param",
    "error_description": "reference parameter is missing"
}
{
    "error": "not_unique",
    "error_description": "reference already used"
}
{
    "error": "invalid_param_type",
    "error_description": "An invalid value was specified for parameter: cumulateWithDiscount (must be Boolean)"
}
{
     "error": "save_failed",
     "error_description": "Failed to save instance"
}

Failure case:response.status = 404
{
    "error": "not_found",
    "error_description": "The price list with the id 100 doesn't exist."
}

Failure case:response.status = 500
{
    "error": "server_error",
    "error_description": "Oops! Something went wrong..."
}