Skip to content
Esc
↑↓navigate↵open⌘Jpreview

Create customer groups

Bulk-creates customer groups. Successful entities are returned in data; per-item failures in errors keyed by the customer group slug.

POST/api/v2/{team_slug}/{app_slug}/customer-groups
Authorization
AuthorizationBearer token · headerrequired

Management API token, sent as Authorization: Bearer <token>.

Path parameters
team_slugstringrequired
app_slugstringrequired
Request body
requiredapplication/json
customer_groupsCreateCustomerGroupItem[]required
min items 1 · max items 20
Show properties
Array of CreateCustomerGroupItem
store_group_idUUIDrequired
namestringrequired
slugstringrequired
typestringrequired
discount_percentageinteger | null
discount_percentage_decimalsinteger | null
Responses
201

Created (partial success possible)

dataCustomerGroup[]required
Show properties
Array of CustomerGroup
idUUIDrequired
app_idUUIDrequired
store_group_idUUIDrequired
namestringrequired
slugstringrequired
typestringrequired
discount_percentageinteger | null
discount_percentage_decimalsinteger | null
created_atstring<date-time>required
updated_atstring<date-time>required
errorsCustomerGroupError[]required
Show properties
Array of CustomerGroupError
slugstring
idUUID | null
Show properties
Any of:
UUID
string<uuid>
null
null
messagestringrequired
400

Request-level failure

errorErrorBodyrequired
Show properties
messagestringrequired
detailsstring[]required
401

Request-level failure

errorErrorBodyrequired
Show properties
messagestringrequired
detailsstring[]required
403

Request-level failure

errorErrorBodyrequired
Show properties
messagestringrequired
detailsstring[]required
500

Request-level failure

errorErrorBodyrequired
Show properties
messagestringrequired
detailsstring[]required
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST 'https://api.enad.io/api/v2/string/string/customer-groups' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "customer_groups": [
    {
      "store_group_id": "6c760e36-a704-4b09-93bb-c191a46ca67f",
      "name": "string",
      "slug": "string",
      "type": "string",
      "discount_percentage": 0,
      "discount_percentage_decimals": 0
    }
  ]
}'
Response
{
  "data": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "app_id": "affd1d10-9538-4fc8-9e0b-4594a28c1335",
      "store_group_id": "6c760e36-a704-4b09-93bb-c191a46ca67f",
      "name": "string",
      "slug": "string",
      "type": "string",
      "discount_percentage": 0,
      "discount_percentage_decimals": 0,
      "created_at": "2019-08-24T14:15:22Z",
      "updated_at": "2019-08-24T14:15:22Z"
    }
  ],
  "errors": [
    {
      "slug": "string",
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "message": "string"
    }
  ]
}