CustomerGroups resource (Data API 23.2)

Summary

Http Method Resource Description
GET /sites/{site_id}/customer_groups Action to get all the customer groups with no filtering.
GET /sites/{site_id}/customer_groups/{id} Action to get customer group information.
PATCH /sites/{site_id}/customer_groups/{id} Updates the customer group with the specified information.
DELETE /sites/{site_id}/customer_groups/{id} Triggers customer group deletion by ID. Be aware that the deletion happens via asynchronous batch process which is the reason the deletion itself is not necessarily finished after the call to this resource returned. The customer group that is in deletion will be provided in the response.
PUT /sites/{site_id}/customer_groups/{id} Creates a customer group using the information provided.
POST /sites/{site_id}/customer_groups/{id}/member_search

Searches for customer group members. For dynamic customer groups and the system groups "Everyone" and "Unregistered" no result is returned (Status Code: 204 - No Content).

The query attribute specifies a complex query that can be used to narrow down the search. Attributes are grouped into different buckets. These are the list of searchable attributes with their corresponding buckets:

Main:

  • login - String
  • active - Boolean

Customer Profile:

  • customer_no - String
  • first_name - String
  • last_name - String
  • email - String
  • zip - String

Only attributes in the same bucket can be joined using a disjunction (OR). For instance, when joining login and customer_no above, only a conjunction is allowed (AND), whereas customer_no and email can be joined using a disjunction because they are in the same bucket. If an attribute is used in a disjunction (OR) that violates this rule, an exception will be thrown.

The output of the query can also be sorted. These are the list of sortable attributes:

  • customer_no - String
  • login - String
If the Business manager customer search is configured to use the new Search Service, the following differences apply:
  • all attributes can be used for sorting (except for 'active')
  • searching for 'zip' will only search in the customers default address
  • logical operators can be used without limits (but may result in degraded performance, depending on how they are combined)
  • new assignments might not be found immediately via the search service, and removed assignments might also not be in effect immediately (there is a slight delay in updating the index)
GET /sites/{site_id}/customer_groups/{id}/members Action to get all the customer group members with no filtering. For dynamic customer groups and the system groups "Everyone" and "Unregistered" no result is returned (Status Code: 204 - No Content).
GET /sites/{site_id}/customer_groups/{id}/members/{customer_no} Action to get customer group member information.
PUT /sites/{site_id}/customer_groups/{id}/members/{customer_no} Action to add customer to (static) customer group.
DELETE /sites/{site_id}/customer_groups/{id}/members/{customer_no} Action to remove a customer from a (static) customer group.

Get Customer Groups

Action to get all the customer groups with no filtering.

Url

GET https://hostname:port/dw/data/v23_2/sites/{site_id}/customer_groups?start={Integer}&count={Integer}&select={String}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Response Document

CustomerGroups

Path Parameters

Parameter Type Description Constraints
site_id String The site context. minLength=1

Query Parameters

Parameter Type Description Constraints
count Integer Optional count for retrieving only a subset of the items (default is 25).  
select String The property selector.  
start Integer Optional start index for retrieving the items from a given index (default 0).  

Sample

REQUEST:
GET /s/-/dw/data/v23_2/sites/SiteGenesis/customer_groups HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Content-Type: application/json; charset=UTF-8

# in case of success:

RESPONSE:
HTTP/1.1 200 OK
Content-Length: 67
Content-Type: application/json; charset=UTF-8
{
  "_v" : "23.2",
  "count" : 2,
  "data" : [
    {
        "_v" : "23.2",
        "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5",
        "_type" : "customer_group",
       "_resource_state":"c2309jd239jdrifj3ui4fn",
        "description" : "Test group 1",
        "id" : "test_customergroup_1",
        "link" : "https://example.com/s/-/dw/data/v23_2/sites/SiteGenesis/customer_groups/test_customergroup_1",
        "member_count" : 5,
        "type" : "static"
    },
    {
        "_v" : "23.2",
        "_resource_state" : "847f9c3c5867f641470b3046aeec31f07757991b792d722e10079926f7a289fb",
        "_type" : "customer_group",
       "_resource_state":"82jhch39saxn23denx93e8",
        "description" : "Test group 2",
        "id" : "test_customergroup_2",
        "link" : "https://example.com/s/-/dw/data/v23_2/sites/SiteGenesis/customer_groups/test_customergroup_2",
        "member_count" : 15,
        "type" : "static"
    }
  ],
  "select": "**",
  "start" : 0,
  "total" : 2
}

Get Customer Group

Action to get customer group information.

Url

GET https://hostname:port/dw/data/v23_2/sites/{site_id}/customer_groups/{id}?select={String}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Response Document

CustomerGroup

Path Parameters

Parameter Type Description Constraints
id String The id of the requested customer group. minLength=1
site_id String The id of the site. minLength=1

Query Parameters

Parameter Type Description Constraints
select String The attribute selector. Include 'member_count' explicitly if member count per customer group is required.  

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
404 CustomerGroupNotFoundException

customerGroupId (String)

siteId (String)

Thrown in case the customer group does not exist matching the given id

Sample

REQUEST:
GET  /s/-/dw/data/v23_2/sites/SiteGenesis/customer_groups/test_customergroup?select=(**,member_count) HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Content-Type: application/json; charset=UTF-8

# in case of success (static customer group) :
 
RESPONSE:
HTTP/1.1 200 OK
Expires: Thu, 01-Aug-2014 00:00:00 GMT
{
  "_v" : "23.2",
  "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5",
  "_type" : "customer_group",
  "description" : "Test group",
  "id" : "test_customergroup",
  "link" : "https://example.com/s/-/dw/data/v23_2/sites/SiteGenesis/customer_groups/test_customergroup",
  "member_count" : 5,
  "type" : "static"
}

# in case of success (dynamic customer group) :

RESPONSE:
HTTP/1.1 200 OK
Expires: Thu, 01-Aug-2014 00:00:00 GMT
{
  "_v" : "23.2",
  "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5",
  "_type" : "customer_group",
  "description" : "Test group",
  "id" : "test_customergroup",
  "link" : "https://example.com/s/-/dw/data/v23_2/sites/SiteGenesis/customer_groups/test_customergroup",
  "rule" : {
    "_type" : "rule",
    "description" : "'session.referrerURL' starts with [http://www.google.de]"
  },
  "type" : "dynamic"
}

# in case of failure:
 
RESPONSE:
HTTP/1.1 400 Not Found
Expires: Thu, 01-Jan-1970 00:00:00 GMT
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v" : "23.2",
  "fault":{
    "type":"CustomerGroupNotFoundException",
    "message":"No customer group with ID 'test_customergroup' was found."
  }
}

Update Customer Group

Updates the customer group with the specified information.

Url

PATCH https://hostname:port/dw/data/v23_2/sites/{site_id}/customer_groups/{id}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Request Document

CustomerGroup

Response Document

CustomerGroup

Path Parameters

Parameter Type Description Constraints
id String The id of the requested customer group. minLength=1
site_id String The id of the site. minLength=1

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
403 SystemCustomerGroupUpdateForbiddenException

customerGroupId (String)

Thrown when attempting to update the system customer group.
404 CustomerGroupNotFoundException

customerGroupId (String)

siteId (String)

Thrown in case the customer group does not exist matching the given id

Sample

REQUEST:
PATCH  /s/-/dw/data/v23_2/sites/SiteGenesis/customer_groups/test_customergroup HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
{
   "_resource_state" : "847f9c3c5867f641470b3046aeec31f07757991b792d722e10079926f7a289fb",
   "id" : "test_customergroup",
   "description" : "Test group",
   "type" : "dynamic"
}

# in case of success:

RESPONSE:
HTTP/1.1 200 OK
Content-Length: 67
Content-Type: application/json; charset=UTF-8
{
   "_v" : "23.2",
   "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5",
   "_type" : "customer_group",
   "description" : "Test group",
   "id" : "test_customergroup",
   "link" : "https://example.com/s/-/dw/data/v23_2/sites/SiteGenesis/customer_groups/test_customergroup",
   "type" : "dynamic"
}

# in case of failure:

RESPONSE:
HTTP/1.1 404 Not Found
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v" : "23.2",
  "fault":{
    "type":"CustomerGroupNotFoundException",
    "message":"No customer group with ID 'test_customergroup' was found."
  }
}

HTTP/1.1 403 Request Forbidden
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
Content-Type: application/json;charset=UTF-8
{
   "_v" : "23.2",
   "fault" : 
   {
      "type" : "SystemCustomerGroupUpdateForbiddenException",
      "message" : "The update on system customer group with ID 'test_customergroup' is not allowed."
   }
}

HTTP/1.1 409 Conflict
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
Content-Type: application/json;charset=UTF-8
{
   "_v" : "23.2",
   "fault" :
   {
      "type" : "ObjectInDeletionConflictException",
      "message" : "The request on object 'test_customergroup' cannot be executed since it is already in the process of being deleted."
   }
}

Delete Customer Group

Triggers customer group deletion by ID. Be aware that the deletion happens via asynchronous batch process which is the reason the deletion itself is not necessarily finished after the call to this resource returned. The customer group that is in deletion will be provided in the response.

Url

DELETE https://hostname:port/dw/data/v23_2/sites/{site_id}/customer_groups/{id}?select={String}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Response Document

CustomerGroup

Path Parameters

Parameter Type Description Constraints
id String One customer group id to remove  
site_id String The id of the site. minLength=1

Query Parameters

Parameter Type Description Constraints
select String The attribute selector for the customer group which is now in deletion  

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
403 SystemCustomerGroupDeleteForbiddenException

customerGroupId (String)

Thrown when attempting to delete the system customer group.

Sample

REQUEST:
DELETE /s/-/dw/data/v23_2/sites/SiteGenesis/customer_groups/test_customergroup HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
x-dw-resource-state: 860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5

# in case of success:

RESPONSE:
HTTP/1.1 200 OK
Content-Type: application/json;charset=UTF-8
{
   "_v" : "23.2",
   "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5",
   "_type" : "customer_group",
   "id" : "test_customergroup",
   "in_deletion" : true
}

# in case failure

RESPONSE:
HTTP/1.1 403 Request Forbidden
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v" : "23.2",
  "fault":{
    "type":"SystemCustomerGroupDeleteForbiddenException",
    "message":"Deletion of the system customer group with ID 'everyone' is not allowed."
  }
}

Create Customer Group

Creates a customer group using the information provided.

Url

PUT https://hostname:port/dw/data/v23_2/sites/{site_id}/customer_groups/{id}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Request Document

CustomerGroup

Response Document

CustomerGroup

Path Parameters

Parameter Type Description Constraints
id String The id of the customer group to create. minLength=1
site_id String The id of the site. minLength=1

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
400 CustomerGroupCreateException

customerGroupId (String)

Thrown when there are system error in creating the customer group.
400 IdConflictException

bodyID (String)

urlID (String)

Thrown when id in query parameter is different from the id in the body.
403 SystemCustomerGroupCreateForbiddenException

customerGroupId (String)

Thrown when attempting to create the system customer group.
409 CustomerGroupAlreadyExistsException

customerGroupId (String)

if a customer group exists already in the site with the given identifier.

Sample

REQUEST:
PUT /s/-/dw/data/v23_2/sites/SiteGenesis/customer_groups/test_customergroup HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
{
   "_v" : "23.2",
   "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5",
   "id" : "test_customergroup",
   "description" : "Test group",
   "type" : "dynamic"
}

# in case of success:
RESPONSE:
HTTP/1.1 201 CREATED
Location: https://example.com/s/-/dw/data/v23_2/sites/SiteGenesis/customer_groups/test_customergroup
Expires: Thu, 01-Aug-2014 00:00:00 GMT
{
   "_v" : "23.2",
   "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5",
   "_type" : "customer_group",
   "description" : "Test group",
   "id" : "test_customergroup",
   "link" : "https://example.com/s/-/dw/data/v23_2/sites/SiteGenesis/customer_groups/test_customergroup",
   "type" : "dynamic"
}

# in case of failure:
 
RESPONSE:
HTTP/1.1 403 Request Forbidden
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
Content-Type: application/json;charset=UTF-8
{
   "_v" : "23.2",
   "fault" : 
   {
      "type" : "SystemCustomerGroupCreateForbiddenException",
      "message" : "The creation of system customer group with ID 'test_customergroup' is not allowed."
   }
}

RESPONSE:
HTTP/1.1 409 Conflict
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
Content-Type: application/json;charset=UTF-8
{
   "_v" : "23.2",
   "fault" : 
   {
      "type" : "CustomerGroupAlreadyExistsException",
      "message" : "The customer group with ID 'test_customergroup' already exists."
   }
}

RESPONSE:
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v" : "23.2",
  "fault":{
    "type":"CustomerGroupCreateException",
    "message":"The customer group with ID test_customergroup' could not be created."
  }
}

Search CustomerGroupMembers

Searches for customer group members. For dynamic customer groups and the system groups "Everyone" and "Unregistered" no result is returned (Status Code: 204 - No Content).

The query attribute specifies a complex query that can be used to narrow down the search. Attributes are grouped into different buckets. These are the list of searchable attributes with their corresponding buckets:

Main:

  • login - String
  • active - Boolean

Customer Profile:

  • customer_no - String
  • first_name - String
  • last_name - String
  • email - String
  • zip - String

Only attributes in the same bucket can be joined using a disjunction (OR). For instance, when joining login and customer_no above, only a conjunction is allowed (AND), whereas customer_no and email can be joined using a disjunction because they are in the same bucket. If an attribute is used in a disjunction (OR) that violates this rule, an exception will be thrown.

The output of the query can also be sorted. These are the list of sortable attributes:

  • customer_no - String
  • login - String
If the Business manager customer search is configured to use the new Search Service, the following differences apply:
  • all attributes can be used for sorting (except for 'active')
  • searching for 'zip' will only search in the customers default address
  • logical operators can be used without limits (but may result in degraded performance, depending on how they are combined)
  • new assignments might not be found immediately via the search service, and removed assignments might also not be in effect immediately (there is a slight delay in updating the index)

Url

POST https://hostname:port/dw/data/v23_2/sites/{site_id}/customer_groups/{id}/member_search

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Request Document

SearchRequest

Response Document

CustomerGroupMemberSearchResult

Path Parameters

Parameter Type Description Constraints
id String The id of the requested members customer group. minLength=1
site_id String The id of the site. minLength=1

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
400 MalformedSearchParameterException   Thrown if the query is ill-formed.
404 CustomerGroupNotFoundException

customerGroupId (String)

siteId (String)

Thrown in case the customer group does not exist matching the given id

Sample

REQUEST:
POST /s/-/dw/data/v23_2/sites/SiteGenesis/customer_groups/test_customergroup/member_search HTTP/1.1
Host: example.com
Authorization: Bearer d8d5c3f0-e3ab-4117-8f26-4cf0ce777c75
Accept: application/json

{
    "query" : {
        "term_query": {
            "fields": ["active"],
            "operator": "is",
            "values": [true]
        }
    }
}

RESPONSE:
HTTP/1.1 200 OK
Content-Type: application/json; charset=UTF-8

{
   "_v" : "23.2",
   "_type" : "customer_group_member_search_result",
   "count" : 1,
   "hits" : 
   [
      {
         "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5",
         "_type" : "customer_group_member",
         "customer_no" : "0001",
         "login" : "test_customer",
         "first_name" : "Robin",
         "last_name" : "Hood",
         "email" : "[email protected]",
         "active" : true,
         "link" : "https://example.com/s/-/dw/data/v23_2/sites/SiteGenesis/customer_groups/test_customergroup/members/test_customer"
      }
   ],
   "query" : 
   {
      "term_query" : 
      {
         "_type" : "term_query",
         "fields" : 
         [
            "active"
         ],
         "operator" : "is",
         "values" : 
         [
            true
         ]
      }
   },
   "start" : 0,
   "total" : 1
}

Get Customer Group Members

Action to get all the customer group members with no filtering. For dynamic customer groups and the system groups "Everyone" and "Unregistered" no result is returned (Status Code: 204 - No Content).

Url

GET https://hostname:port/dw/data/v23_2/sites/{site_id}/customer_groups/{id}/members?start={Integer}&count={Integer}&select={String}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Response Document

CustomerGroupMembers

Path Parameters

Parameter Type Description Constraints
id String   minLength=1
site_id String   minLength=1

Query Parameters

Parameter Type Description Constraints
count Integer Optional count for retrieving only a subset of the items (default is 25).  
select String The property selector.  
start Integer Optional start index for retrieving the items from a given index (default 0).  

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
404 CustomerGroupNotFoundException

customerGroupId (String)

siteId (String)

Thrown in case the customer group does not exist matching the given id

Sample

REQUEST:
GET  /s/-/dw/data/v23_2/sites/SiteGenesis/customer_groups/test_customergroup/members?select=(**) HTTP/1.1
Host: example.com
Authorization: Bearer aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaa
Content-Type: application/json; charset=UTF-8

# in case of success:
 
RESPONSE:
HTTP/1.1 200 OK
{
  "_v" : "23.2",
  "count" : 2,
  "data" : [
    {
      "_v" : "23.2",
      "_type" : "customer_group_member",
      "active" : true,
      "customer_link" : "https://example.com/s/-/dw/data/v23_2/customer_lists/SiteGenesis/customers/test_customer",
      "customer_no" : "test_customer",
      "first_name" : "John",
      "last_name" : "Doe",
      "login" : "test"
    },
    {
      "_v" : "23.2",
      "_type" : "customer_group_member",
      "active" : true,
      "customer_link" : "https://example.com/s/-/dw/data/v23_2/customer_lists/SiteGenesis/customers/bigshot_customer",
      "customer_no" : "bigshot_customer",
      "first_name" : "Big",
      "last_name" : "Shot",
      "login" : "bighsot"
    }],
   "select": "**",
   "start" : 0,
   "total" : 2
}

# in case of failure:

RESPONSE:
HTTP/1.1 404 Not Found
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
   "_v" : "23.2",
   "fault" :
   {
      "arguments" :
      {
         "customerNo" : "test_customer",
         "customergroupId" : "foobar",
         "siteId" : "SiteGenesis"
      },
      "type" : "CustomerGroupNotFoundException",
      "message" : "No customer group with ID 'test_customergroup' for site 'SiteGenesis' was found."
   }
}

Get CustomerGroupMember

Action to get customer group member information.

Url

GET https://hostname:port/dw/data/v23_2/sites/{site_id}/customer_groups/{id}/members/{customer_no}?select={String}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Response Document

CustomerGroupMember

Path Parameters

Parameter Type Description Constraints
customer_no String The customer number of the requested customer group member. minLength=1
id String The id of the requested members customer group. minLength=1
site_id String The id of the site. minLength=1

Query Parameters

Parameter Type Description Constraints
select String The selector for selective response content.  

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
404 CustomerGroupNotFoundException

customerGroupId (String)

siteId (String)

Thrown in case the customer group does not exist matching the given id
404 CustomerGroupMemberNotFoundException

customerGroupId (String)

customerNo (String)

siteId (String)

Thrown in case the customer group member did not exist, or the group is not a static group

Sample

REQUEST:
GET  /s/-/dw/data/v23_2/sites/SiteGenesis/customer_groups/test_customergroup/members/test_customer HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Content-Type: application/json; charset=UTF-8

# in case of success:
 
RESPONSE:
HTTP/1.1 200 OK
{
   "_v" : "23.2",
   "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5",
   "_type" : "customer_group_member",
   "active" : true,
   "customer_link" : "https://example.com/s/-/dw/data/v23_2/customer_lists/SiteGenesis/customers/test_customer",
   "customer_no" : "test_customer",
   "first_name" : "John",
   "last_name" : "Doe",
   "login" : "foobar"
}

# in case of failure:
 
RESPONSE:
HTTP/1.1 400 Not Found
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
   "_v" : "23.2",
   "fault" : 
   {
      "arguments" : 
      {
         "customerNo" : "foobar",
         "customergroupId" : "test_customergroup",
         "siteId" : "SiteGenesis"
      },
      "type" : "CustomerGroupMemberNotFoundException",
      "message" : "No customer group member with customer no 'foobar' for customer group 'test_customergroup' and site 'SiteGenesis' was found."
   }
}

Assign CustomerGroupMember to group

Action to add customer to (static) customer group.

Url

PUT https://hostname:port/dw/data/v23_2/sites/{site_id}/customer_groups/{id}/members/{customer_no}?select={String}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Response Document

CustomerGroupMember

Path Parameters

Parameter Type Description Constraints
customer_no String The customer number of the customer to add to the group. minLength=1
id String The id of the customer group. minLength=1
site_id String The id of the site. minLength=1

Query Parameters

Parameter Type Description Constraints
select String The selector for selective response content.  

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
403 CustomerGroupUnsupportedAssignmentException

customerGroupId (String)

siteId (String)

Thrown when the customer group is not a static group.
404 CustomerGroupNotFoundException

customerGroupId (String)

siteId (String)

Thrown in case the customer group does not exist matching the given id.
404 CustomerNotFoundException

customerNo (String)

siteId (String)

Thrown in case the customer list did not exist, or the customer does not exist in in the list.

Sample

REQUEST:
PUT  /s/-/dw/data/v23_2/sites/SiteGenesis/customer_groups/test_customergroup/members/test_customer HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Content-Type: application/json; charset=UTF-8
Content-Length: 0

# in case of success:
 
RESPONSE:
HTTP/1.1 201 CREATED
Location: https://example.com/s/-/dw/data/v23_2/sites/SiteGenesis/customer_groups/test_customergroup/members/test_customer
{
   "_v" : "23.2",
   "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5",
   "_type" : "customer_group_member",
   "active" : true,
   "customer_link" : "https://example.com/s/-/dw/data/v23_2/customer_lists/SiteGenesis/customers/test_customer",
   "customer_no" : "test_customer",
   "first_name" : "John",
   "last_name" : "Doe",
   "login" : "foobar"
}

# in case of failure:
 
RESPONSE:
HTTP/1.1 404 Not Found
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
   "_v" : "23.2",
   "fault" : 
   {
      "arguments" : 
      {
         "customerNo" : "test_customer",
         "customergroupId" : "foobar",
         "siteId" : "SiteGenesis"
      },
      "type" : "CustomerGroupNotFoundException",
      "message" : "No customer group with ID 'foobar' for site 'SiteGenesis' was found."
   }
}

Put CustomerGroupMember

Action to remove a customer from a (static) customer group.

Url

DELETE https://hostname:port/dw/data/v23_2/sites/{site_id}/customer_groups/{id}/members/{customer_no}?select={String}

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Path Parameters

Parameter Type Description Constraints
customer_no String The customer number of the customer to remove from the group. minLength=1
id String The id of the customer group. minLength=1
site_id String The id of the site. minLength=1

Query Parameters

Parameter Type Description Constraints
select String The selector for selective response content.  

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
403 CustomerGroupUnsupportedAssignmentException

customerGroupId (String)

siteId (String)

Thrown when the customer group is not a static group.
404 CustomerGroupNotFoundException

customerGroupId (String)

siteId (String)

Thrown in case the customer group does not exist matching the given id.
404 CustomerNotFoundException

customerNo (String)

siteId (String)

Thrown in case the customer list did not exist, or the customer does not exist in the list.

Sample

REQUEST:
DELETE /dw/data/v23_2/sites/SiteGenesis/customer_groups/test_customergroup/members/test_customer HTTP/1.1
Host: example.com
Content-Type: application/json; charset=UTF-8
x-dw-resource-state: 860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5

# in case of success:
 
RESPONSE:
HTTP/1.1 204 No Content

# in case of failure:
 
RESPONSE:
HTTP/1.1 400 Not Found
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
   "_v" : "23.2",
   "fault" : 
   {
      "arguments" : 
      {
         "customerNo" : "test_customer",
         "customergroupId" : "test_customergroup",
         "siteId" : "SiteGenesis"
      },
      "type" : "CustomerGroupMemberNotFoundException",
      "message" : "No customer group member with customer no 'test_customer' for customer group 'test_customergroup' and site 'SiteGenesis' was found."
   }
}
X OCAPI versions 15.x and 16.x will be retired on March 31, 2021. For dates and more information, see the OCAPI versioning and deprecation policy and this Knowledge Article.