(Quick Reference) Service: Update

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

Method: PUT

Request content type: application/json

URL:

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

Parameters:

NameDescriptionTypeRequiredExample values
priceListIdthe id of the priceList to assignLongYes777
customerIdthe id of the customer to assignLongYes111

URL with external_id:

https://BASE_URL/api/VERSION/customerPriceLists/reference/{customerId}/{priceListId}

Parameters:

NameDescriptionTypeRequiredExamples values
customerIdreference of the customerStringYesC-002
priceListIdreference of the price listStringYesPL-001

Success Output

Success case: response.status=201
{
    "id": 139,
    "customerReference": "C-002",
    "priceListReference": "PL-008",
    "customer": {
        "id": 1335,
        "reference": "C-002",
        "name": "cus2",
        "href": "/api/v1.0/customers/1335"
    },
    "priceList": {
        "id": 9,
        "reference": "PL-008",
        "name": "AddedPriceLIst2",
        "href": "/api/v1.0/priceLists/9"
    },
    "organization": "Lyon",
    "dateCreated": "2016-08-22T13:42:20Z",
    "lastUpdated": "2016-08-22T13:49:56Z"
}

Failure Output

Failure case:response.status = 400
{
    "error": "missing_param",
    "error_description": "priceListId parameter is missing"
}
{
{
    "error": "invalid_param_type",
    "error_description": "The type of parameter id you provided is not valid for this request."
}
}
{
    "error": "already_assigned",
    "error_description": "customer is already assigned to priceList."
}
{
     "error": "save_failed",
     "error_description": "Failed to save instance"
}

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

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