Mutation
mutation AddCustomerToCustomerGroups($input: AddCustomerToCustomerGroupsInput!) {
addCustomerToCustomerGroups(input: $input) {
customerGroupMemberships {
customerId
customerGroup {
id
name
key
color
externalId
createdAt {
__typename
}
}
createdAt {
unixTimestamp
iso8601
}
createdBy {
__typename
... on UserActor {
__typename
}
}
updatedAt {
unixTimestamp
iso8601
}
updatedBy {
__typename
... on UserActor {
__typename
}
}
}
error {
message
type
code
fields {
field
message
type
}
}
}
}Variables
{
"input": {
"customerId": "id",
"customerGroupIdentifiers": [
{}
]
}
}Response
{
"data": {
"addCustomerToCustomerGroups": {
"customerGroupMemberships": [
{
"customerId": "id",
"customerGroup": {
"id": "id",
"name": "string",
"key": "string",
"color": "string",
"externalId": "string",
"createdAt": {
"__typename": "DateTime"
}
},
"createdAt": {
"unixTimestamp": "string",
"iso8601": "string"
},
"createdBy": {
"__typename": "UserActor"
},
"updatedAt": {
"unixTimestamp": "string",
"iso8601": "string"
},
"updatedBy": {
"__typename": "UserActor"
}
}
],
"error": {
"message": "string",
"type": "VALIDATION",
"code": "string",
"fields": [
{
"field": "string",
"message": "string",
"type": "VALIDATION"
}
]
}
}
}
}Mutations
addCustomerToCustomerGroups
Add a customer to one or more customer groups (up to 25 at once), identified by group ID, key, or external ID. Memberships that already exist are silently skipped, making this operation safe to call repeatedly. Returns only the newly created memberships. Requires customerGroupMembership:create permission.
MUTATION
addCustomerToCustomerGroups(input: AddCustomerToCustomerGroupsInput!): AddCustomerToCustomerGroupsOutput!Arguments
input
required
customerGroupMemberships
error
Mutation
mutation AddCustomerToCustomerGroups($input: AddCustomerToCustomerGroupsInput!) {
addCustomerToCustomerGroups(input: $input) {
customerGroupMemberships {
customerId
customerGroup {
id
name
key
color
externalId
createdAt {
__typename
}
}
createdAt {
unixTimestamp
iso8601
}
createdBy {
__typename
... on UserActor {
__typename
}
}
updatedAt {
unixTimestamp
iso8601
}
updatedBy {
__typename
... on UserActor {
__typename
}
}
}
error {
message
type
code
fields {
field
message
type
}
}
}
}Variables
{
"input": {
"customerId": "id",
"customerGroupIdentifiers": [
{}
]
}
}Response
{
"data": {
"addCustomerToCustomerGroups": {
"customerGroupMemberships": [
{
"customerId": "id",
"customerGroup": {
"id": "id",
"name": "string",
"key": "string",
"color": "string",
"externalId": "string",
"createdAt": {
"__typename": "DateTime"
}
},
"createdAt": {
"unixTimestamp": "string",
"iso8601": "string"
},
"createdBy": {
"__typename": "UserActor"
},
"updatedAt": {
"unixTimestamp": "string",
"iso8601": "string"
},
"updatedBy": {
"__typename": "UserActor"
}
}
],
"error": {
"message": "string",
"type": "VALIDATION",
"code": "string",
"fields": [
{
"field": "string",
"message": "string",
"type": "VALIDATION"
}
]
}
}
}
}Was this page helpful?

