Get All Customer Groups
GET /stores/{store_hash}/v2/customer_groups
Request
Returns a list of Customer Groups. Default sorting is by customer-group id, from lowest to highest.
Authentication
- X-Auth-Token in header - required
Parameters
- store_hash in path - string
- Accept in header with default of application/json - string - required
The MIME type of the response body.
- page in query - number
Number of pages
- limit in query - number
Count per page
- name in query - string
Filter customer groups by exact name match. Can use
name:like
to filter using a fuzzy matching method. This is good for implementing search. - is_default in query - boolean
Whether customers who sign up are added to this group by default.
- is_group_for_guests in query - boolean
If the groups is for guests. There can only be one customer group for guests at a time.
example
curl --request GET \ --url 'https://api.bigcommerce.com/stores/[store_hash]/v2/customer_groups' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'X-Auth-Token: xxxxxxxxxxxxxxxxx'
Response
Body
idinteger
Id of the customer group
Example: 1
namestring
Name of the group
Example: Wholesale
is_defaultboolean
Determines whether new customers are assigned to this group by default.
Example: false
category_accessobject
discount_rulesarray[object]
A collection of discount rules that are automatically applied to customers who are members of the group
is_group_for_guestsboolean
If the groups is for guests. There can only be one customer group for guests at a time.
example
{ "id": 1, "name": "Wholesale", "is_default": false, "category_access": { "type": "all", "categories": [ 18, 19, 23, 34 ] }, "discount_rules": [ { "type": "price_list", "method": "percent", "amount": "\"5.0000\" (Float, Float as String, Integer)", "price_list_id": 3 } ], "is_group_for_guests": true }
Create a Customer Group
POST /stores/{store_hash}/v2/customer_groups
Request
Creates a Customer Group. Required Fields
- name
Authentication
- X-Auth-Token in header - required
Parameters
- store_hash in path - string
- Content-Type in header with default of application/json - string - required
The MIME type of the request body.
Body
When creating a customer group category discount using the API it defaults to "products in this category and its subcategories". In the Control Panel this can be changed to either "products in this category only" or "products in this category and its subcategories". There are currently no settings to change this behavior via API.
namestring
Name of the group
Example: Wholesale
is_defaultboolean
Determines whether new customers are assigned to this group by default.
Example: false
category_accessobject
discount_rulesarray[object]
A collection of discount rules that are automatically applied to customers who are members of the group
is_group_for_guestsboolean
If the groups is for guests. There can only be one customer group for guests at a time.
example
{ "name": "Wholesale", "is_default": false, "category_access": { "type": "all", "categories": [ 18, 19, 23, 34 ] }, "discount_rules": [ { "type": "price_list", "method": "percent", "amount": "\"5.0000\" (Float, Float as String, Integer)", "price_list_id": 3 } ], "is_group_for_guests": true }
Response
Body
When creating a customer group category discount using the API it defaults to "products in this category and its subcategories". In the Control Panel this can be changed to either "products in this category only" or "products in this category and its subcategories". There are currently no settings to change this behavior via API.
idinteger
Id of the customer group
Example: 1
namestring
Name of the group
Example: Wholesale
is_defaultboolean
Determines whether new customers are assigned to this group by default.
Example: false
category_accessobject
discount_rulesarray[object]
A collection of discount rules that are automatically applied to customers who are members of the group
is_group_for_guestsboolean
If the groups is for guests. There can only be one customer group for guests at a time.
example
{ "id": 1, "name": "Wholesale", "is_default": false, "category_access": { "type": "all", "categories": [ 18, 19, 23, 34 ] }, "discount_rules": [ { "type": "price_list", "method": "percent", "amount": "\"5.0000\" (Float, Float as String, Integer)", "price_list_id": 3 } ], "is_group_for_guests": true }
Delete Customer Groups
DELETE /stores/{store_hash}/v2/customer_groups
Request
By default, it deletes all Customer Groups. All existing customers are unassigned from the group when it is deleted.
Authentication
- X-Auth-Token in header - required
Parameters
- store_hash in path - string
- Accept in header with default of application/json - string - required
The MIME type of the response body.
example
curl --request DELETE \ --url 'https://api.bigcommerce.com/stores/[store_hash]/v2/customer_groups' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'X-Auth-Token: xxxxxxxxxxxxxxxxx'
Response
Get a Customer Group
GET /stores/{store_hash}/v2/customer_groups/{customer_group_id}
Request
Returns a Customer Group.
Authentication
- X-Auth-Token in header - required
Parameters
- store_hash in path - string
- Accept in header with default of application/json - string - required
The MIME type of the response body.
- customer_group_id in path - integer - required
The ID of the customer group.
- page in query - number
Number of pages
- limit in query - number
Count per page
- name in query - string
Name of the customer groups
- is_default in query - boolean
Whether customers who sign up are added to this group by default.
example
curl --request GET \ --url 'https://api.bigcommerce.com/stores/[store_hash]/v2/customer_groups/[customer_group_id]' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'X-Auth-Token: xxxxxxxxxxxxxxxxx'
Response
The request was successful.
Body
When creating a customer group category discount using the API it defaults to "products in this category and its subcategories". In the Control Panel this can be changed to either "products in this category only" or "products in this category and its subcategories". There are currently no settings to change this behavior via API.
idinteger
Id of the customer group
Example: 1
namestring
Name of the group
Example: Wholesale
is_defaultboolean
Determines whether new customers are assigned to this group by default.
Example: false
category_accessobject
discount_rulesarray[object]
A collection of discount rules that are automatically applied to customers who are members of the group
is_group_for_guestsboolean
If the groups is for guests. There can only be one customer group for guests at a time.
example
{ "id": 1, "name": "Wholesale", "is_default": false, "category_access": { "type": "all", "categories": [ 18, 19, 23, 34 ] }, "discount_rules": [ { "type": "price_list", "method": "percent", "amount": "\"5.0000\" (Float, Float as String, Integer)", "price_list_id": 3 } ], "is_group_for_guests": true }
Update a Customer Group
PUT /stores/{store_hash}/v2/customer_groups/{customer_group_id}
Request
Updates a Customer Group.
Notes
Any combination of fields can be updated at once. Discount rules are treated in bulk. The entire set of rules is overwritten when a request is sent.
Authentication
- X-Auth-Token in header - required
Parameters
- store_hash in path - string
- Content-Type in header with default of application/json - string - required
The MIME type of the request body.
Body
When creating a customer group category discount using the API it defaults to "products in this category and its subcategories". In the Control Panel this can be changed to either "products in this category only" or "products in this category and its subcategories". There are currently no settings to change this behavior via API.
idinteger
Id of the customer group
Example: 1
namestring
Name of the group
Example: Wholesale
is_defaultboolean
Determines whether new customers are assigned to this group by default.
Example: false
category_accessobject
discount_rulesarray[object]
A collection of discount rules that are automatically applied to customers who are members of the group
is_group_for_guestsboolean
If the groups is for guests. There can only be one customer group for guests at a time.
example
{ "id": 1, "name": "Wholesale", "is_default": false, "category_access": { "type": "all", "categories": [ 18, 19, 23, 34 ] }, "discount_rules": [ { "type": "price_list", "method": "percent", "amount": "\"5.0000\" (Float, Float as String, Integer)", "price_list_id": 3 } ], "is_group_for_guests": true }
Response
Body
When creating a customer group category discount using the API it defaults to "products in this category and its subcategories". In the Control Panel this can be changed to either "products in this category only" or "products in this category and its subcategories". There are currently no settings to change this behavior via API.
idinteger
Id of the customer group
Example: 1
namestring
Name of the group
Example: Wholesale
is_defaultboolean
Determines whether new customers are assigned to this group by default.
Example: false
category_accessobject
discount_rulesarray[object]
A collection of discount rules that are automatically applied to customers who are members of the group
is_group_for_guestsboolean
If the groups is for guests. There can only be one customer group for guests at a time.
example
{ "id": 1, "name": "Wholesale", "is_default": false, "category_access": { "type": "all", "categories": [ 18, 19, 23, 34 ] }, "discount_rules": [ { "type": "price_list", "method": "percent", "amount": "\"5.0000\" (Float, Float as String, Integer)", "price_list_id": 3 } ], "is_group_for_guests": true }
Delete a Customer Group
DELETE /stores/{store_hash}/v2/customer_groups/{customer_group_id}
Request
Deletes a Customer Group. Notes All existing customers are unassigned from the group when it is deleted.
Authentication
- X-Auth-Token in header - required
Parameters
- store_hash in path - string
- Accept in header with default of application/json - string - required
The MIME type of the response body.
- customer_group_id in path - integer - required
The ID of the customer group.
example
curl --request DELETE \ --url 'https://api.bigcommerce.com/stores/[store_hash]/v2/customer_groups/[customer_group_id]' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'X-Auth-Token: xxxxxxxxxxxxxxxxx'
Response
No content. Request was successful but produced no response.
Get a Count of Customer Groups
GET /stores/{store_hash}/v2/customer_groups/count
Request
Returns a count of all Customer Groups.
Authentication
- X-Auth-Token in header - required
Parameters
- store_hash in path - string
- Accept in header with default of application/json - string - required
The MIME type of the response body.
example
curl --request GET \ --url 'https://api.bigcommerce.com/stores/[store_hash]/v2/customer_groups/count' \ --header 'Accept: application/json' \ --header 'Content-Type: application/json' \ --header 'X-Auth-Token: xxxxxxxxxxxxxxxxx'
Response
Body
countnumber
Example: 27
example
{ "count": 27 }