(Quick Reference) Service: Save

Description: This web service is used to add a new assigned customer group object to the database



Method: POST

Request content type: application/json


NameDescriptionTypeRequiredExample values
groupIdthe id of the customer groupLong/StringYes777
customerIdthe id of the customer to assignLong/StringYes123
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": 102,
    "customerReference": "C-002",
    "customerGroupReference": "CG-002",
    "customer": {
        "id": 1335,
        "reference": "C-002",
        "name": "cus2",
        "href": "/api/v1.0/customers/1335"
    "customerGroup": {
        "id": 6,
        "reference": "CG-002",
        "name": "CusG2",
        "href": "/api/v1.0/customerGroups/6"
    "organization": "Lyon",
    "dateCreated": "2016-08-22T12:24:37Z",
    "lastUpdated": "2016-08-22T12:24:37Z"

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..."