(Quick Reference) Service: Update

Description: This web service is used to update an existing customerDiscount object to the database

Method: PUT

Request content type: application/json

URL:

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

Parameters:

NameDescriptionTypeRequiredExample values
idid of the customer discount to updateLongYes123
discountListIdthe discount id to be assignedLongYes777
customerIdthe id of the customer to assignLongYes111

URL with external_id:

https://BASE_URL/api/VERSION/customerDiscountLists/reference/{customerId}/{discountListId}

Parameters:

NameDescriptionTypeRequiredExamples values
customerIdreference of the customerStringYesC-002
discountListIdreference of the discount listStringYesDL-001

Success Output

Success case: response.status=200
{
    "id": 331,
    "customerReference": "C-002",
    "discountListReference": "RDis-001",
    "customer": {
        "id": 1335,
        "reference": "C-002",
        "name": "cus2",
        "href": "/api/v1.0/customers/1335"
    },
    "discountList": {
        "id": 4,
        "reference": "RDis-001",
        "name": "discount1",
        "href": "/api/v1.0/discountLists/4"
    },
    "organization": "Lyon",
    "dateCreated": "2016-08-23T15:49:48Z",
    "lastUpdated": "2016-08-23T15:49:48Z"
}

Failure Output

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

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

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