Skip to main content

CustomerGroupService

Contains methods relating to CustomerGroup entities.

Signature
class CustomerGroupService {    constructor(connection: TransactionalConnection, listQueryBuilder: ListQueryBuilder, historyService: HistoryService, eventBus: EventBus, customFieldRelationService: CustomFieldRelationService)    findAll(ctx: RequestContext, options?: CustomerGroupListOptions, relations: RelationPaths<CustomerGroup> = []) => Promise<PaginatedList<CustomerGroup>>;    findOne(ctx: RequestContext, customerGroupId: ID, relations: RelationPaths<CustomerGroup> = []) => Promise<CustomerGroup | undefined>;    getGroupCustomers(ctx: RequestContext, customerGroupId: ID, options?: CustomerListOptions) => Promise<PaginatedList<Customer>>;    create(ctx: RequestContext, input: CreateCustomerGroupInput) => Promise<CustomerGroup>;    update(ctx: RequestContext, input: UpdateCustomerGroupInput) => Promise<CustomerGroup>;    delete(ctx: RequestContext, id: ID) => Promise<DeletionResponse>;    addCustomersToGroup(ctx: RequestContext, input: MutationAddCustomersToGroupArgs) => Promise<CustomerGroup>;    removeCustomersFromGroup(ctx: RequestContext, input: MutationRemoveCustomersFromGroupArgs) => Promise<CustomerGroup>;}

constructor

method(connection: TransactionalConnection, listQueryBuilder: ListQueryBuilder, historyService: HistoryService, eventBus: EventBus, customFieldRelationService: CustomFieldRelationService) => CustomerGroupService

findAll

method(ctx: RequestContext, options?: CustomerGroupListOptions, relations: RelationPaths<CustomerGroup> = []) => Promise<PaginatedList<CustomerGroup>>

findOne

method(ctx: RequestContext, customerGroupId: ID, relations: RelationPaths<CustomerGroup> = []) => Promise<CustomerGroup | undefined>

getGroupCustomers

method(ctx: RequestContext, customerGroupId: ID, options?: CustomerListOptions) => Promise<PaginatedList<Customer>>

Returns a PaginatedList of all the Customers in the group.

create

method(ctx: RequestContext, input: CreateCustomerGroupInput) => Promise<CustomerGroup>

update

method(ctx: RequestContext, input: UpdateCustomerGroupInput) => Promise<CustomerGroup>

delete

method(ctx: RequestContext, id: ID) => Promise<DeletionResponse>

addCustomersToGroup

method(ctx: RequestContext, input: MutationAddCustomersToGroupArgs) => Promise<CustomerGroup>

removeCustomersFromGroup

method(ctx: RequestContext, input: MutationRemoveCustomersFromGroupArgs) => Promise<CustomerGroup>
Was this chapter helpful?
Report Issue
Edited Feb 4, 2026·Edit this page