(Quick Reference)
Service: Update
Description: This web service is used to update an existing assigned customer group object to the database
Method: PUT
Request content type: application/json
URL:
https://BASE_URL/api/VERSION/customerGroupAssign
Parameters:
Name | Description | Type | Required | Example values |
---|
id | id of the customer group to update | Long | Yes | 111 |
groupId | the id of the customer group | Long | Yes | 777 |
customerId | the id of the customer to assign | Long | Yes | 123 |
URL with external_id:
https://BASE_URL/api/VERSION/customerGroupAssign/reference/{customerId}/{groupId}
Parameters:
Name | Description | Type | Required | Examples values |
---|
customerId | reference of the customer | String | Yes | C-002 |
groupId | reference of the customer group | String | Yes | CG-001 |
Success Output
Success case: response.status=201
{
"id": 101,
"customerReference": "C-003",
"customerGroupReference": "CG-002",
"customer": {
"id": 1336,
"reference": "C-003",
"name": "cus3",
"href": "/api/v1.0/customers/1336"
},
"customerGroup": {
"id": 6,
"reference": "CG-002",
"name": "CusG2",
"href": "/api/v1.0/customerGroups/6"
},
"organization": "Lyon",
"dateCreated": "2016-08-22T11:13:12Z",
"lastUpdated": "2016-08-22T12:44:42Z"
}
Failure Output
Failure case:response.status = 400
{
"error": "missing_param",
"error_description": "groupId parameter is missing"
}
{
"error": "already_assigned",
"error_description": "customer is already assigned to customerGroup."
}
{
"error": "save_failed",
"error_description": "Failed to save instance"
}
Failure case:response.status = 404
{
"error": "not_found",
"error_description": "The customer group with the id 999 doesn't exist."
}
Failure case:response.status = 500
{
"error": "server_error",
"error_description": "Oops! Something went wrong..."
}