Skip to main content
Skip to main content

addCustomerToGroup - Customer Module Reference

This documentation provides a reference to the addCustomerToGroup method. This belongs to the Customer Module.

addCustomerToGroup(groupCustomerPair, sharedContext?): Promise<{ id: string }>

This method adds a customer to a group.

Example

const customerGroupCustomerId =
await customerModuleService.addCustomerToGroup({
customer_id: "cus_123",
customer_group_id: "cus_321",
})

Parameters

groupCustomerPairGroupCustomerPairRequired
The details of the customer and the group it should be added to.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<object>Required
The ID of the relation between the customer and the group.

addCustomerToGroup(groupCustomerPairs, sharedContext?): Promise<{ id: string }[]>

This method adds customers to groups.

Example

const customerGroupCustomerIds =
await customerModuleService.addCustomerToGroup([
{
customer_id: "cus_123",
customer_group_id: "cus_321",
},
])

Parameters

groupCustomerPairsGroupCustomerPair[]Required
A list of items, each being the details of a customer and the group it should be added to.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<object[]>Required
The IDs of the relations between each of the customer and group pairs.
Was this section helpful?