(Quick Reference) Service: Save

Description: This web service is used to add a new customerCategoryDiscountLists object into the database

URL:

https://BASE_URL/api/VERSION/customerCategoryDiscountLists

Method: POST

Request content type: application/json

Parameters:

NameDescriptionTypeRequiredExample values
discountListIdthe discount id to be assignedLong/StringYes777
customerCategoryIdthe id of the customer category to assignInteger/StringYes 
useExternalIdBy default, it is set to false. set it to true if you want to use external ids.Booleannotrue , false

Success Output

Success case: response.status=201
{
    "id": 4,
    "discountListReference": "RDis-001",
    "customerCategoryReference": "102",
    "customerCategory": {
        "id": 60,
        "reference": "102",
        "name": "Preferred Customers",
        "href": "/api/v1/customerCategories/60"
    },
    "discountList": {
        "id": 4,
        "reference": "RDis-001",
        "name": "discount1",
        "href": "/api/v1/discountLists/4"
    },
    "organization": "Lyon",
    "dateCreated": "2016-08-24T10:11:58Z",
    "lastUpdated": "2016-08-24T10:11:58Z"
}

Failure Output

Failure case:response.status = 400
{
    "error": "missing_param",
    "error_description": "discountListId parameter is missing"
}
{
    "error": "already_assigned",
    "error_description": "customerCategory is already assigned to discountList."
}
{
     "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..."
}