generate references (#7882)

This commit is contained in:
Shahed Nasser authored and GitHub committed 2024-07-01 16:02:36 +03:00
1 parent b9036eca1a
commit dd864da4e0
2424 files changed
+106679 -116201

No files matched your search

@@ -1,61 +0,0 @@
---
displayed_sidebar: customerReference
slug: /references/customer/addAddresses
sidebar_label: addAddresses
---
import { TypeList } from "docs-ui"
# addAddresses - Customer Module Reference
This documentation provides a reference to the `addAddresses` method. This belongs to the Customer Module.
## addAddresses(addresses, sharedContext?): Promise<[CustomerAddressDTO](../../../interfaces/customer.CustomerAddressDTO/page.mdx)[]>
This method adds addresses to customers.
### Example
```ts
const addresses = await customerModuleService.addAddresses([
{
customer_id: "cus_123",
address_name: "Home",
address_1: "432 Stierlin Rd",
city: "Mountain View",
country_code: "us",
},
])
```
### Parameters
<TypeList types={[{"name":"addresses","type":"[CreateCustomerAddressDTO](../../../interfaces/customer.CreateCustomerAddressDTO/page.mdx)[]","description":"A list of items, each being the details of the address to add to a customer.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"customer_id","type":"`string`","description":"The associated customer's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"address_name","type":"`string`","description":"The address's name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_shipping","type":"`boolean`","description":"Whether the address is default shipping.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_billing","type":"`boolean`","description":"Whether the address is the default for billing.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`string`","description":"The company.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string`","description":"The first name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string`","description":"The last name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`string`","description":"The address 1.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`string`","description":"The address 2.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`string`","description":"The city.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`string`","description":"The country code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`string`","description":"The province.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`string`","description":"The postal code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string`","description":"The phone.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="addAddresses"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[CustomerAddressDTO](../../../interfaces/customer.CustomerAddressDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The list of created addresses.","expandable":false,"children":[{"name":"CustomerAddressDTO[]","type":"[CustomerAddressDTO](../../../interfaces/customer.CustomerAddressDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CustomerAddressDTO","type":"`object`","description":"The customer address details.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="addAddresses"/>
## addAddresses(address, sharedContext?): Promise&#60;[CustomerAddressDTO](../../../interfaces/customer.CustomerAddressDTO/page.mdx)&#62;
This method adds an address to a customer.
### Example
```ts
const address = await customerModuleService.addAddresses({
customer_id: "cus_123",
address_name: "Home",
address_1: "432 Stierlin Rd",
city: "Mountain View",
country_code: "us",
})
```
### Parameters
<TypeList types={[{"name":"address","type":"[CreateCustomerAddressDTO](../../../interfaces/customer.CreateCustomerAddressDTO/page.mdx)","description":"The details of the address to add to a customer.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"customer_id","type":"`string`","description":"The associated customer's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"address_name","type":"`string`","description":"The address's name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_shipping","type":"`boolean`","description":"Whether the address is default shipping.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_billing","type":"`boolean`","description":"Whether the address is the default for billing.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`string`","description":"The company.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string`","description":"The first name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string`","description":"The last name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`string`","description":"The address 1.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`string`","description":"The address 2.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`string`","description":"The city.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`string`","description":"The country code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`string`","description":"The province.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`string`","description":"The postal code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string`","description":"The phone.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="addAddresses"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[CustomerAddressDTO](../../../interfaces/customer.CustomerAddressDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The created address.","expandable":false,"children":[{"name":"CustomerAddressDTO","type":"[CustomerAddressDTO](../../../interfaces/customer.CustomerAddressDTO/page.mdx)","optional":false,"defaultValue":"","description":"The customer address details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the customer address.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_shipping","type":"`boolean`","description":"Whether the customer address is default shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_billing","type":"`boolean`","description":"Whether the customer address is default billing.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`string`","description":"The associated customer's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The created at of the customer address.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The updated at of the customer address.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"address_name","type":"`string`","description":"The address name of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`string`","description":"The company of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string`","description":"The first name of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string`","description":"The last name of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`string`","description":"The address 1 of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`string`","description":"The address 2 of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`string`","description":"The city of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`string`","description":"The country code of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`string`","description":"The province of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`string`","description":"The postal code of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string`","description":"The phone of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="addAddresses"/>
@@ -0,0 +1,61 @@
---
displayed_sidebar: customerReference
slug: /references/customer/createAddresses
sidebar_label: createAddresses
---
import { TypeList } from "docs-ui"
# createAddresses - Customer Module Reference
This documentation provides a reference to the `createAddresses` method. This belongs to the Customer Module.
## createAddresses(addresses, sharedContext?): Promise&#60;[CustomerAddressDTO](../../../interfaces/customer.CustomerAddressDTO/page.mdx)[]&#62;
This method adds addresses to customers.
### Example
```ts
const addresses = await customerModuleService.createAddresses([
{
customer_id: "cus_123",
address_name: "Home",
address_1: "432 Stierlin Rd",
city: "Mountain View",
country_code: "us",
},
])
```
### Parameters
<TypeList types={[{"name":"addresses","type":"[CreateCustomerAddressDTO](../../../interfaces/customer.CreateCustomerAddressDTO/page.mdx)[]","description":"A list of items, each being the details of the address to add to a customer.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"customer_id","type":"`string`","description":"The associated customer's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"address_name","type":"`null` \\| `string`","description":"The address's name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_shipping","type":"`boolean`","description":"Whether the address is default shipping.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_billing","type":"`boolean`","description":"Whether the address is the default for billing.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`null` \\| `string`","description":"The company.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string`","description":"The first name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string`","description":"The last name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`null` \\| `string`","description":"The address 1.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`null` \\| `string`","description":"The address 2.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`null` \\| `string`","description":"The city.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`null` \\| `string`","description":"The country code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`null` \\| `string`","description":"The province.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`null` \\| `string`","description":"The postal code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`null` \\| `string`","description":"The phone.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../types/customer.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":tLine truncated
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[CustomerAddressDTO](../../../interfaces/customer.CustomerAddressDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The list of created addresses.","expandable":false,"children":[{"name":"CustomerAddressDTO[]","type":"[CustomerAddressDTO](../../../interfaces/customer.CustomerAddressDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CustomerAddressDTO","type":"`object`","description":"The customer address details.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="createAddresses"/>
## createAddresses(address, sharedContext?): Promise&#60;[CustomerAddressDTO](../../../interfaces/customer.CustomerAddressDTO/page.mdx)&#62;
This method adds an address to a customer.
### Example
```ts
const address = await customerModuleService.createAddresses({
customer_id: "cus_123",
address_name: "Home",
address_1: "432 Stierlin Rd",
city: "Mountain View",
country_code: "us",
})
```
### Parameters
<TypeList types={[{"name":"address","type":"[CreateCustomerAddressDTO](../../../interfaces/customer.CreateCustomerAddressDTO/page.mdx)","description":"The details of the address to add to a customer.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"customer_id","type":"`string`","description":"The associated customer's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"address_name","type":"`null` \\| `string`","description":"The address's name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_shipping","type":"`boolean`","description":"Whether the address is default shipping.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_billing","type":"`boolean`","description":"Whether the address is the default for billing.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`null` \\| `string`","description":"The company.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string`","description":"The first name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string`","description":"The last name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`null` \\| `string`","description":"The address 1.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`null` \\| `string`","description":"The address 2.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`null` \\| `string`","description":"The city.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`null` \\| `string`","description":"The country code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`null` \\| `string`","description":"The province.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`null` \\| `string`","description":"The postal code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`null` \\| `string`","description":"The phone.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../types/customer.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandablLine truncated
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[CustomerAddressDTO](../../../interfaces/customer.CustomerAddressDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The created address.","expandable":false,"children":[{"name":"CustomerAddressDTO","type":"[CustomerAddressDTO](../../../interfaces/customer.CustomerAddressDTO/page.mdx)","optional":false,"defaultValue":"","description":"The customer address details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the customer address.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_shipping","type":"`boolean`","description":"Whether the customer address is default shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_billing","type":"`boolean`","description":"Whether the customer address is default billing.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`string`","description":"The associated customer's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The created at of the customer address.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The updated at of the customer address.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"address_name","type":"`string`","description":"The address name of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`string`","description":"The company of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string`","description":"The first name of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string`","description":"The last name of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`string`","description":"The address 1 of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`string`","description":"The address 2 of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`string`","description":"The city of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`string`","description":"The country code of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`string`","description":"The province of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`string`","description":"The postal code of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string`","description":"The phone of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="createAddresses"/>
@@ -1,16 +1,16 @@
---
displayed_sidebar: customerReference
slug: /references/customer/createCustomerGroup
sidebar_label: createCustomerGroup
slug: /references/customer/createCustomerGroups
sidebar_label: createCustomerGroups
---
import { TypeList } from "docs-ui"
# createCustomerGroup - Customer Module Reference
# createCustomerGroups - Customer Module Reference
This documentation provides a reference to the `createCustomerGroup` method. This belongs to the Customer Module.
This documentation provides a reference to the `createCustomerGroups` method. This belongs to the Customer Module.
## createCustomerGroup(data, sharedContext?): Promise&#60;[CustomerGroupDTO](../../../interfaces/customer.CustomerGroupDTO/page.mdx)[]&#62;
## createCustomerGroups(data, sharedContext?): Promise&#60;[CustomerGroupDTO](../../../interfaces/customer.CustomerGroupDTO/page.mdx)[]&#62;
This method creates customer groups.
@@ -18,7 +18,7 @@ This method creates customer groups.
```ts
const customerGroup =
await customerModuleService.createCustomerGroup([
await customerModuleService.createCustomerGroups([
{
name: "VIP",
},
@@ -27,13 +27,13 @@ const customerGroup =
### Parameters
<TypeList types={[{"name":"data","type":"[CreateCustomerGroupDTO](../../../interfaces/customer.CreateCustomerGroupDTO/page.mdx)[]","description":"The customer groups to be created.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the customer group.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"Who created the customer group. For example,\nthe ID of the user that created the customer group.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="createCustomerGroup"/>
<TypeList types={[{"name":"data","type":"[CreateCustomerGroupDTO](../../../interfaces/customer.CreateCustomerGroupDTO/page.mdx)[]","description":"The customer groups to be created.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the customer group.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../types/customer.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"Who created the customer group. For example,\nthe ID of the user that created the customer group.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="createCustomerGroups"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[CustomerGroupDTO](../../../interfaces/customer.CustomerGroupDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The created customer groups.","expandable":false,"children":[{"name":"CustomerGroupDTO[]","type":"[CustomerGroupDTO](../../../interfaces/customer.CustomerGroupDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CustomerGroupDTO","type":"`object`","description":"The customer group details.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="createCustomerGroup"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;[CustomerGroupDTO](../../../interfaces/customer.CustomerGroupDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The created customer groups.","expandable":false,"children":[{"name":"CustomerGroupDTO[]","type":"[CustomerGroupDTO](../../../interfaces/customer.CustomerGroupDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CustomerGroupDTO","type":"`object`","description":"The customer group details.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="createCustomerGroups"/>
## createCustomerGroup(data, sharedContext?): Promise&#60;[CustomerGroupDTO](../../../interfaces/customer.CustomerGroupDTO/page.mdx)&#62;
## createCustomerGroups(data, sharedContext?): Promise&#60;[CustomerGroupDTO](../../../interfaces/customer.CustomerGroupDTO/page.mdx)&#62;
This method creates a customer group.
@@ -41,15 +41,15 @@ This method creates a customer group.
```ts
const customerGroup =
await customerModuleService.createCustomerGroup({
await customerModuleService.createCustomerGroups({
name: "VIP",
})
```
### Parameters
<TypeList types={[{"name":"data","type":"[CreateCustomerGroupDTO](../../../interfaces/customer.CreateCustomerGroupDTO/page.mdx)","description":"The customer group to be created.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the customer group.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"Who created the customer group. For example,\nthe ID of the user that created the customer group.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="createCustomerGroup"/>
<TypeList types={[{"name":"data","type":"[CreateCustomerGroupDTO](../../../interfaces/customer.CreateCustomerGroupDTO/page.mdx)","description":"The customer group to be created.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the customer group.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../types/customer.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"Who created the customer group. For example,\nthe ID of the user that created the customer group.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="createCustomerGroups"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[CustomerGroupDTO](../../../interfaces/customer.CustomerGroupDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The created customer group.","expandable":false,"children":[{"name":"CustomerGroupDTO","type":"[CustomerGroupDTO](../../../interfaces/customer.CustomerGroupDTO/page.mdx)","optional":false,"defaultValue":"","description":"The customer group details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the customer group.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the customer group.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customers","type":"Partial&#60;[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)&#62;[]","description":"The customers of the customer group.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string`","description":"The email of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"has_account","type":"`boolean`","description":"A flag indicating if customer has an account or not.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_billing_address_id","type":"`null` \\| `string`","description":"The associated default billing address's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_shipping_address_id","type":"`null` \\| `string`","description":"The associated default shipping address's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"company_name","type":"`null` \\| `string`","description":"The company name of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string`","description":"The first name of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string`","description":"The last name of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"addresses","type":"[CustomerAddressDTO](../../../interfaces/customer.CustomerAddressDTO/page.mdx)[]","description":"The addresses of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`null` \\| `string`","description":"The phone of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"groups","type":"`object`[]","description":"The groups of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`null` \\| `string`","description":"Who created the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string` \\| `Date`","description":"The deletion date of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The creation date of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The update date of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`null` \\| `string`","description":"Who created the customer group.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string` \\| `Date`","description":"The deletion date of the customer group.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The creation date of the customer group.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The update date of the customer group.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="createCustomerGroup"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;[CustomerGroupDTO](../../../interfaces/customer.CustomerGroupDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The created customer group.","expandable":false,"children":[{"name":"CustomerGroupDTO","type":"[CustomerGroupDTO](../../../interfaces/customer.CustomerGroupDTO/page.mdx)","optional":false,"defaultValue":"","description":"The customer group details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the customer group.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the customer group.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customers","type":"Partial&#60;[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)&#62;[]","description":"The customers of the customer group.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string`","description":"The email of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"has_account","type":"`boolean`","description":"A flag indicating if customer has an account or not.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_billing_address_id","type":"`null` \\| `string`","description":"The associated default billing address's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_shipping_address_id","type":"`null` \\| `string`","description":"The associated default shipping address's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"company_name","type":"`null` \\| `string`","description":"The company name of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string`","description":"The first name of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string`","description":"The last name of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"addresses","type":"[CustomerAddressDTO](../../../interfaces/customer.CustomerAddressDTO/page.mdx)[]","description":"The addresses of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`null` \\| `string`","description":"The phone of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"groups","type":"`object`[]","description":"The groups of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`null` \\| `string`","description":"Who created the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string` \\| `Date`","description":"The deletion date of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The creation date of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The update date of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`null` \\| `string`","description":"Who created the customer group.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string` \\| `Date`","description":"The deletion date of the customer group.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The creation date of the customer group.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The update date of the customer group.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="createCustomerGroups"/>
@@ -1,23 +1,23 @@
---
displayed_sidebar: customerReference
slug: /references/customer/create
sidebar_label: create
slug: /references/customer/createCustomers
sidebar_label: createCustomers
---
import { TypeList } from "docs-ui"
# create - Customer Module Reference
# createCustomers - Customer Module Reference
This documentation provides a reference to the `create` method. This belongs to the Customer Module.
This documentation provides a reference to the `createCustomers` method. This belongs to the Customer Module.
## create(data, sharedContext?): Promise&#60;[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)[]&#62;
## createCustomers(data, sharedContext?): Promise&#60;[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)[]&#62;
This method creates customers.
### Example
```ts
const customers = await customerModuleService.create([
const customers = await customerModuleService.createCustomers([Customers
{
email: "john@smith.com",
first_name: "John",
@@ -28,20 +28,20 @@ const customers = await customerModuleService.create([
### Parameters
<TypeList types={[{"name":"data","type":"[CreateCustomerDTO](../../../interfaces/customer.CreateCustomerDTO/page.mdx)[]","description":"The customers to be created.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"company_name","type":"`string`","description":"The company name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string`","description":"The first name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string`","description":"The last name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string`","description":"The email of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string`","description":"The phone of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"Who created the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"addresses","type":"Omit&#60;[CreateCustomerAddressDTO](../../../interfaces/customer.CreateCustomerAddressDTO/page.mdx), \"customer_id\"&#62;[]","description":"The addresses of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"address_name","type":"`string`","description":"The address's name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_shipping","type":"`boolean`","description":"Whether the address is default shipping.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_billing","type":"`boolean`","description":"Whether the address is the default for billing.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`string`","description":"The company.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string`","description":"The first name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string`","description":"The last name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`string`","description":"The address 1.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`string`","description":"The address 2.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`string`","description":"The city.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`string`","description":"The country code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`string`","description":"The province.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`string`","description":"The postal code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string`","description":"The phone.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":Line truncated
<TypeList types={[{"name":"data","type":"[CreateCustomerDTO](../../../interfaces/customer.CreateCustomerDTO/page.mdx)[]","description":"The customers to be created.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"company_name","type":"`null` \\| `string`","description":"The company name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string`","description":"The first name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string`","description":"The last name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`null` \\| `string`","description":"The email of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`null` \\| `string`","description":"The phone of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`null` \\| `string`","description":"Who created the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"addresses","type":"Omit&#60;[CreateCustomerAddressDTO](../../../interfaces/customer.CreateCustomerAddressDTO/page.mdx), \"customer_id\"&#62;[]","description":"The addresses of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"address_name","type":"`null` \\| `string`","description":"The address's name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_shipping","type":"`boolean`","description":"Whether the address is default shipping.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_billing","type":"`boolean`","description":"Whether the address is the default for billing.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`null` \\| `string`","description":"The company.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string`","description":"The first name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string`","description":"The last name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`null` \\| `string`","description":"The address 1.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`null` \\| `string`","description":"The address 2.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`null` \\| `string`","description":"The city.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`null` \\| `string`","description":"The country code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`null` \\| `string`","description":"The province.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`null` \\| `string`","description":"The postal code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`null` \\| `string`","description":"The phone.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../types/customer.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"metadata","type":"[MetadataType](../../../types/customer.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"Line truncated
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The created customers.","expandable":false,"children":[{"name":"CustomerDTO[]","type":"[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CustomerDTO","type":"`object`","description":"The customer details.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="create"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The created customers.","expandable":false,"children":[{"name":"CustomerDTO[]","type":"[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CustomerDTO","type":"`object`","description":"The customer details.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="createCustomers"/>
## create(data, sharedContext?): Promise&#60;[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)&#62;
## createCustomers(data, sharedContext?): Promise&#60;[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)&#62;
This method creates a customer.
### Example
```ts
const customer = await customerModuleService.create({
const customer = await customerModuleService.createCustomers({Customers
email: "john@smith.com",
first_name: "John",
last_name: "Smith",
@@ -50,8 +50,8 @@ const customer = await customerModuleService.create({
### Parameters
<TypeList types={[{"name":"data","type":"[CreateCustomerDTO](../../../interfaces/customer.CreateCustomerDTO/page.mdx)","description":"The customer to be created.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"company_name","type":"`string`","description":"The company name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string`","description":"The first name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string`","description":"The last name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string`","description":"The email of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string`","description":"The phone of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string`","description":"Who created the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"addresses","type":"Omit&#60;[CreateCustomerAddressDTO](../../../interfaces/customer.CreateCustomerAddressDTO/page.mdx), \"customer_id\"&#62;[]","description":"The addresses of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"address_name","type":"`string`","description":"The address's name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_shipping","type":"`boolean`","description":"Whether the address is default shipping.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_billing","type":"`boolean`","description":"Whether the address is the default for billing.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`string`","description":"The company.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string`","description":"The first name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string`","description":"The last name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`string`","description":"The address 1.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`string`","description":"The address 2.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`string`","description":"The city.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`string`","description":"The country code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`string`","description":"The province.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`string`","description":"The postal code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string`","description":"The phone.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A Line truncated
<TypeList types={[{"name":"data","type":"[CreateCustomerDTO](../../../interfaces/customer.CreateCustomerDTO/page.mdx)","description":"The customer to be created.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"company_name","type":"`null` \\| `string`","description":"The company name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string`","description":"The first name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string`","description":"The last name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`null` \\| `string`","description":"The email of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`null` \\| `string`","description":"The phone of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`null` \\| `string`","description":"Who created the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"addresses","type":"Omit&#60;[CreateCustomerAddressDTO](../../../interfaces/customer.CreateCustomerAddressDTO/page.mdx), \"customer_id\"&#62;[]","description":"The addresses of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"address_name","type":"`null` \\| `string`","description":"The address's name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_shipping","type":"`boolean`","description":"Whether the address is default shipping.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_billing","type":"`boolean`","description":"Whether the address is the default for billing.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`null` \\| `string`","description":"The company.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string`","description":"The first name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string`","description":"The last name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`null` \\| `string`","description":"The address 1.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`null` \\| `string`","description":"The address 2.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`null` \\| `string`","description":"The city.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`null` \\| `string`","description":"The country code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`null` \\| `string`","description":"The province.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`null` \\| `string`","description":"The postal code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`null` \\| `string`","description":"The phone.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../types/customer.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"metadata","type":"[MetadataType](../../../types/customer.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"namLine truncated
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The created customer.","expandable":false,"children":[{"name":"CustomerDTO","type":"[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)","optional":false,"defaultValue":"","description":"The customer details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string`","description":"The email of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"has_account","type":"`boolean`","description":"A flag indicating if customer has an account or not.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_billing_address_id","type":"`null` \\| `string`","description":"The associated default billing address's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_shipping_address_id","type":"`null` \\| `string`","description":"The associated default shipping address's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"company_name","type":"`null` \\| `string`","description":"The company name of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string`","description":"The first name of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string`","description":"The last name of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"addresses","type":"[CustomerAddressDTO](../../../interfaces/customer.CustomerAddressDTO/page.mdx)[]","description":"The addresses of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the customer address.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_shipping","type":"`boolean`","description":"Whether the customer address is default shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_billing","type":"`boolean`","description":"Whether the customer address is default billing.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`string`","description":"The associated customer's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The created at of the customer address.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The updated at of the customer address.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"address_name","type":"`string`","description":"The address name of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`string`","description":"The company of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string`","description":"The first name of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string`","description":"The last name of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`string`","description":"The address 1 of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`string`","description":"The address 2 of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`string`","description":"The city of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`string`","description":"The country code of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`string`","description":"The province of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`string`","description":"The postal code of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string`","description":"The phone of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"phone","type":"`null` \\| `string`Line truncated
<TypeList types={[{"name":"Promise","type":"Promise&#60;[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The created customer.","expandable":false,"children":[{"name":"CustomerDTO","type":"[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)","optional":false,"defaultValue":"","description":"The customer details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string`","description":"The email of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"has_account","type":"`boolean`","description":"A flag indicating if customer has an account or not.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_billing_address_id","type":"`null` \\| `string`","description":"The associated default billing address's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_shipping_address_id","type":"`null` \\| `string`","description":"The associated default shipping address's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"company_name","type":"`null` \\| `string`","description":"The company name of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string`","description":"The first name of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string`","description":"The last name of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"addresses","type":"[CustomerAddressDTO](../../../interfaces/customer.CustomerAddressDTO/page.mdx)[]","description":"The addresses of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the customer address.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_shipping","type":"`boolean`","description":"Whether the customer address is default shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_billing","type":"`boolean`","description":"Whether the customer address is default billing.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`string`","description":"The associated customer's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The created at of the customer address.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The updated at of the customer address.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"address_name","type":"`string`","description":"The address name of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`string`","description":"The company of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string`","description":"The first name of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string`","description":"The last name of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`string`","description":"The address 1 of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`string`","description":"The address 2 of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`string`","description":"The city of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`string`","description":"The country code of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`string`","description":"The province of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`string`","description":"The postal code of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string`","description":"The phone of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"phone","type":"`null` \\| `string`Line truncated
@@ -1,67 +0,0 @@
---
displayed_sidebar: customerReference
slug: /references/customer/delete
sidebar_label: delete
---
import { TypeList } from "docs-ui"
# delete - Customer Module Reference
This documentation provides a reference to the `delete` method. This belongs to the Customer Module.
## delete(customerId, sharedContext?): Promise&#60;void&#62;
This method deletes a customer by its ID.
### Example
```ts
await customerModuleService.delete("cus_123")
```
### Parameters
<TypeList types={[{"name":"customerId","type":"`string`","description":"The customer's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="delete"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"Resolves when the customer is deleted successfully.","expandable":false,"children":[]}]} sectionTitle="delete"/>
## delete(customerIds, sharedContext?): Promise&#60;void&#62;
This method deletes customers by their IDs.
### Example
```ts
await customerModuleService.delete(["cus_123", "cus_321"])
```
### Parameters
<TypeList types={[{"name":"customerIds","type":"`string`[]","description":"The IDs of customers.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="delete"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"Resolves when the customers are deleted successfully.","expandable":false,"children":[]}]} sectionTitle="delete"/>
## delete(selector, sharedContext?): Promise&#60;void&#62;
This method deletes a customer matching the specified filters.
### Example
```ts
await customerModuleService.delete({
id: ["cus_123"],
})
```
### Parameters
<TypeList types={[{"name":"selector","type":"[FilterableCustomerProps](../../../interfaces/customer.FilterableCustomerProps/page.mdx)","description":"The filters that specify which customers should be deleted.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by email.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"groups","type":"`string` \\| `string`[] \\| [FilterableCustomerGroupProps](../../../interfaces/customer.FilterableCustomerGroupProps/page.mdx)","description":"Filter by associated customer group.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"default_billing_address_id","type":"`null` \\| `string` \\| `string`[]","description":"Filter by the associated default billing address's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"default_shipping_address_id","type":"`null` \\| `string` \\| `string`[]","description":"Filter by the associated default shipping address's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company_name","type":"`null` \\| `string` \\| `string`[] \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by company name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string` \\| `string`[] \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by first name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string` \\| `string`[] \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by last name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"has_account","type":"`boolean` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;boolean&#62;","description":"Filter by whether the customer has an account.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`null` \\| `string` \\| `string`[]","description":"Filter by the `created_by` attribute.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by created date.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62; \\| [ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description"Line truncated
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"Resolves when the customers are deleted successfully.","expandable":false,"children":[]}]} sectionTitle="delete"/>
@@ -64,7 +64,7 @@ await customerModuleService.deleteAddresses({
### Parameters
<TypeList types={[{"name":"selector","type":"[FilterableCustomerAddressProps](../../../interfaces/customer.FilterableCustomerAddressProps/page.mdx)","description":"The filters that specify which addresses should be deleted.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer address by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_name","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_shipping","type":"`boolean` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;boolean&#62;","description":"Filter addresses by whether they're the default for shipping.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_billing","type":"`boolean` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;boolean&#62;","description":"Filter addresses by whether they're the default for billing.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`string` \\| `string`[]","description":"Filter addresses by the associated customer's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer","type":"`string` \\| `string`[] \\| [FilterableCustomerProps](../../../interfaces/customer.FilterableCustomerProps/page.mdx)","description":"Filter addresses by the associated customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by company.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by first name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by last name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by first address line.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by second address line.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by city.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by country code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by province.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by postal code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by phone number.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;Record&#60;string, unknown&#62;&#62;","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by created date.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62; \\| [ExpandLine truncated
<TypeList types={[{"name":"selector","type":"[FilterableCustomerAddressProps](../../../interfaces/customer.FilterableCustomerAddressProps/page.mdx)","description":"The filters that specify which addresses should be deleted.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"q","type":"`string`","description":"Searches for addreses by properties such as name and street using this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer address by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_name","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by name.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62; \\| [ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"is_default_shipping","type":"`boolean` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;boolean&#62;","description":"Filter addresses by whether they're the default for shipping.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62; \\| [ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](Line truncated
### Returns
@@ -65,7 +65,7 @@ await customerModuleService.deleteCustomerGroups({
### Parameters
<TypeList types={[{"name":"selector","type":"[FilterableCustomerGroupProps](../../../interfaces/customer.FilterableCustomerGroupProps/page.mdx)","description":"The filters that specify which customer group to delete.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer group by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter customer groups by name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customers","type":"`string` \\| `string`[] \\| [FilterableCustomerProps](../../../interfaces/customer.FilterableCustomerProps/page.mdx)","description":"Filter customer groups by associated customers.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`null` \\| `string` \\| `string`[]","description":"Filter customer groups by their `created_by` attribute.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter customer groups by created date.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62; \\| [ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"updated_at","type":"[OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter customer groups by updated date.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type"Line truncated
<TypeList types={[{"name":"selector","type":"[FilterableCustomerGroupProps](../../../interfaces/customer.FilterableCustomerGroupProps/page.mdx)","description":"The filters that specify which customer group to delete.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"q","type":"`string`","description":"Searches for customer groups by name using this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer group by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter customer groups by name.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62; \\| [ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"customers","type":"`string` \\| `string`[] \\| [FilterableCustomerProps](../../../interfaces/customer.FilterableCustomerProps/page.mdx)","description":"Filter customer groups by associated customers.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"q","type":"`string`","description":"Searches for customers by properties such as name and email using this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by email.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"groups","type":"`string` \\| `string`[] \\| [FilterableCustomerGroupProps](../../../interfaces/customer.FilterableCustomerGroupProps/page.mdx)","description":"Filter by associated customer group.","optional":true,"defaultValue":"","expandable":falLine truncated
### Returns
@@ -0,0 +1,67 @@
---
displayed_sidebar: customerReference
slug: /references/customer/deleteCustomers
sidebar_label: deleteCustomers
---
import { TypeList } from "docs-ui"
# deleteCustomers - Customer Module Reference
This documentation provides a reference to the `deleteCustomers` method. This belongs to the Customer Module.
## deleteCustomers(customerId, sharedContext?): Promise&#60;void&#62;
This method deletes a customer by its ID.
### Example
```ts
await customerModuleService.deleteCustomers("cus_123")
```
### Parameters
<TypeList types={[{"name":"customerId","type":"`string`","description":"The customer's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="deleteCustomers"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"Resolves when the customer is deleted successfully.","expandable":false,"children":[]}]} sectionTitle="deleteCustomers"/>
## deleteCustomers(customerIds, sharedContext?): Promise&#60;void&#62;
This method deletes customers by their IDs.
### Example
```ts
await customerModuleService.deleteCustomers(["cus_123", "cus_321"])
```
### Parameters
<TypeList types={[{"name":"customerIds","type":"`string`[]","description":"The IDs of customers.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="deleteCustomers"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"Resolves when the customers are deleted successfully.","expandable":false,"children":[]}]} sectionTitle="deleteCustomers"/>
## deleteCustomers(selector, sharedContext?): Promise&#60;void&#62;
This method deletes a customer matching the specified filters.
### Example
```ts
await customerModuleService.deleteCustomers({
id: ["cus_123"],
})
```
### Parameters
<TypeList types={[{"name":"selector","type":"[FilterableCustomerProps](../../../interfaces/customer.FilterableCustomerProps/page.mdx)","description":"The filters that specify which customers should be deleted.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"q","type":"`string`","description":"Searches for customers by properties such as name and email using this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by email.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62; \\| [ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"groups","type":"`string` \\| `string`[] \\| [FilterableCustomerGroupProps](../../../interfaces/customer.FilterableCustomerGroupProps/page.mdx)","description":"Filter by associated customer group.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"q","type":"`string`","description":"Searches for customer groups by name using this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer group by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter customer groups by name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customers","type":"`string` \\| `string`[] \\| [FilterableCustomerProps](../../../interfaces/customer.FilterableCustomerProps/page.mdx)","description":"Filter customer groups by associated customers.","optional":true,"defaultValue":"","expandable":false,"chiLine truncated
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;void&#62;","optional":false,"defaultValue":"","description":"Resolves when the customers are deleted successfully.","expandable":false,"children":[]}]} sectionTitle="deleteCustomers"/>
@@ -1,59 +0,0 @@
---
displayed_sidebar: customerReference
slug: /references/customer/list
sidebar_label: list
---
import { TypeList } from "docs-ui"
# list - Customer Module Reference
This documentation provides a reference to the `list` method. This belongs to the Customer Module.
This method retrieves a paginated list of customers based on optional filters and configuration.
## Example
To retrieve a list of customers using their IDs:
```ts
const customers = await customerModuleService.list({
id: ["cus_123", "cus_321"],
})
```
To specify relations that should be retrieved within the customers:
```ts
const customers = await customerModuleService.list(
{
id: ["cus_123", "cus_321"],
},
{
relations: ["groups"],
}
)
```
By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
```ts
const customers = await customerModuleService.list(
{
id: ["cus_123", "cus_321"],
},
{
relations: ["groups"],
take: 20,
skip: 2,
}
)
```
## Parameters
<TypeList types={[{"name":"filters","type":"[FilterableCustomerProps](../../../interfaces/customer.FilterableCustomerProps/page.mdx)","description":"The filters to apply on the retrieved customers.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by email.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"groups","type":"`string` \\| `string`[] \\| [FilterableCustomerGroupProps](../../../interfaces/customer.FilterableCustomerGroupProps/page.mdx)","description":"Filter by associated customer group.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"default_billing_address_id","type":"`null` \\| `string` \\| `string`[]","description":"Filter by the associated default billing address's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"default_shipping_address_id","type":"`null` \\| `string` \\| `string`[]","description":"Filter by the associated default shipping address's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company_name","type":"`null` \\| `string` \\| `string`[] \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by company name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string` \\| `string`[] \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by first name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string` \\| `string`[] \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by last name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"has_account","type":"`boolean` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;boolean&#62;","description":"Filter by whether the customer has an account.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`null` \\| `string` \\| `string`[]","description":"Filter by the `created_by` attribute.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by created date.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62; \\| [ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optionalLine truncated
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The list of customers.","expandable":false,"children":[{"name":"CustomerDTO[]","type":"[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CustomerDTO","type":"`object`","description":"The customer details.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="list"/>
@@ -52,7 +52,7 @@ const addresses = await customerModuleService.listAddresses(
## Parameters
<TypeList types={[{"name":"filters","type":"[FilterableCustomerAddressProps](../../../interfaces/customer.FilterableCustomerAddressProps/page.mdx)","description":"The filters to apply on the retrieved addresss.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer address by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_name","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_shipping","type":"`boolean` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;boolean&#62;","description":"Filter addresses by whether they're the default for shipping.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_billing","type":"`boolean` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;boolean&#62;","description":"Filter addresses by whether they're the default for billing.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`string` \\| `string`[]","description":"Filter addresses by the associated customer's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer","type":"`string` \\| `string`[] \\| [FilterableCustomerProps](../../../interfaces/customer.FilterableCustomerProps/page.mdx)","description":"Filter addresses by the associated customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by company.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by first name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by last name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by first address line.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by second address line.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by city.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by country code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by province.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by postal code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by phone number.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;Record&#60;string, unknown&#62;&#62;","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by created date.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62; \\| [ExpandScalar](../../Line truncated
<TypeList types={[{"name":"filters","type":"[FilterableCustomerAddressProps](../../../interfaces/customer.FilterableCustomerAddressProps/page.mdx)","description":"The filters to apply on the retrieved addresss.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"q","type":"`string`","description":"Searches for addreses by properties such as name and street using this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer address by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_name","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by name.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62; \\| [ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"is_default_shipping","type":"`boolean` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;boolean&#62;","description":"Filter addresses by whether they're the default for shipping.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62; \\| [ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../typesLine truncated
## Returns
@@ -1,59 +0,0 @@
---
displayed_sidebar: customerReference
slug: /references/customer/listAndCount
sidebar_label: listAndCount
---
import { TypeList } from "docs-ui"
# listAndCount - Customer Module Reference
This documentation provides a reference to the `listAndCount` method. This belongs to the Customer Module.
This method retrieves a paginated list of customers along with the total count of available customers satisfying the provided filters.
## Example
To retrieve a list of customers using their IDs:
```ts
const [customers, count] = await customerModuleService.list({
id: ["cus_123", "cus_321"],
})
```
To specify relations that should be retrieved within the customers:
```ts
const [customers, count] = await customerModuleService.list(
{
id: ["cus_123", "cus_321"],
},
{
relations: ["groups"],
}
)
```
By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
```ts
const [customers, count] = await customerModuleService.list(
{
id: ["cus_123", "cus_321"],
},
{
relations: ["groups"],
take: 20,
skip: 2,
}
)
```
## Parameters
<TypeList types={[{"name":"filters","type":"[FilterableCustomerProps](../../../interfaces/customer.FilterableCustomerProps/page.mdx)","description":"The filters to apply on the retrieved customers.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by email.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"groups","type":"`string` \\| `string`[] \\| [FilterableCustomerGroupProps](../../../interfaces/customer.FilterableCustomerGroupProps/page.mdx)","description":"Filter by associated customer group.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"default_billing_address_id","type":"`null` \\| `string` \\| `string`[]","description":"Filter by the associated default billing address's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"default_shipping_address_id","type":"`null` \\| `string` \\| `string`[]","description":"Filter by the associated default shipping address's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company_name","type":"`null` \\| `string` \\| `string`[] \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by company name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string` \\| `string`[] \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by first name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string` \\| `string`[] \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by last name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"has_account","type":"`boolean` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;boolean&#62;","description":"Filter by whether the customer has an account.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`null` \\| `string` \\| `string`[]","description":"Filter by the `created_by` attribute.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by created date.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62; \\| [ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optionalLine truncated
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)[], number]&#62;","optional":false,"defaultValue":"","description":"The list of customers along with their total count.","expandable":false,"children":[{"name":"CustomerDTO[]","type":"[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]},{"name":"number","type":"`number`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="listAndCount"/>
@@ -55,7 +55,7 @@ const [addresses, count] =
## Parameters
<TypeList types={[{"name":"filters","type":"[FilterableCustomerAddressProps](../../../interfaces/customer.FilterableCustomerAddressProps/page.mdx)","description":"The filters to apply on the retrieved addresss.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer address by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_name","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_shipping","type":"`boolean` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;boolean&#62;","description":"Filter addresses by whether they're the default for shipping.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_billing","type":"`boolean` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;boolean&#62;","description":"Filter addresses by whether they're the default for billing.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`string` \\| `string`[]","description":"Filter addresses by the associated customer's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer","type":"`string` \\| `string`[] \\| [FilterableCustomerProps](../../../interfaces/customer.FilterableCustomerProps/page.mdx)","description":"Filter addresses by the associated customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by company.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by first name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by last name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by first address line.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by second address line.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by city.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by country code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by province.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by postal code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by phone number.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;Record&#60;string, unknown&#62;&#62;","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by created date.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62; \\| [ExpandScalar](../../Line truncated
<TypeList types={[{"name":"filters","type":"[FilterableCustomerAddressProps](../../../interfaces/customer.FilterableCustomerAddressProps/page.mdx)","description":"The filters to apply on the retrieved addresss.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"q","type":"`string`","description":"Searches for addreses by properties such as name and street using this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer address by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_name","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by name.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62; \\| [ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"is_default_shipping","type":"`boolean` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;boolean&#62;","description":"Filter addresses by whether they're the default for shipping.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62; \\| [ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../typesLine truncated
## Returns
@@ -55,7 +55,7 @@ const [customerGroups, count] =
## Parameters
<TypeList types={[{"name":"filters","type":"[FilterableCustomerGroupProps](../../../interfaces/customer.FilterableCustomerGroupProps/page.mdx)","description":"The filters to apply on the retrieved customer groups.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer group by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter customer groups by name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customers","type":"`string` \\| `string`[] \\| [FilterableCustomerProps](../../../interfaces/customer.FilterableCustomerProps/page.mdx)","description":"Filter customer groups by associated customers.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`null` \\| `string` \\| `string`[]","description":"Filter customer groups by their `created_by` attribute.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter customer groups by created date.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62; \\| [ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"updated_at","type":"[OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter customer groups by updated date.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ELine truncated
<TypeList types={[{"name":"filters","type":"[FilterableCustomerGroupProps](../../../interfaces/customer.FilterableCustomerGroupProps/page.mdx)","description":"The filters to apply on the retrieved customer groups.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"q","type":"`string`","description":"Searches for customer groups by name using this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer group by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter customer groups by name.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62; \\| [ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"customers","type":"`string` \\| `string`[] \\| [FilterableCustomerProps](../../../interfaces/customer.FilterableCustomerProps/page.mdx)","description":"Filter customer groups by associated customers.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"q","type":"`string`","description":"Searches for customers by properties such as name and email using this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by email.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"groups","type":"`string` \\| `string`[] \\| [FilterableCustomerGroupProps](../../../interfaces/customer.FilterableCustomerGroupProps/page.mdx)","description":"Filter by associated customer group.","optional":true,"defaultValue":"","expandable":false,"Line truncated
## Returns
@@ -0,0 +1,59 @@
---
displayed_sidebar: customerReference
slug: /references/customer/listAndCountCustomers
sidebar_label: listAndCountCustomers
---
import { TypeList } from "docs-ui"
# listAndCountCustomers - Customer Module Reference
This documentation provides a reference to the `listAndCountCustomers` method. This belongs to the Customer Module.
This method retrieves a paginated list of customers along with the total count of available customers satisfying the provided filters.
## Example
To retrieve a list of customers using their IDs:
```ts
const [customers, count] = await customerModuleService.listAndCountCustomers({
id: ["cus_123", "cus_321"],
})
```
To specify relations that should be retrieved within the customers:
```ts
const [customers, count] = await customerModuleService.listAndCountCustomers(
{
id: ["cus_123", "cus_321"],
},
{
relations: ["groups"],
}
)
```
By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
```ts
const [customers, count] = await customerModuleService.listAndCountCustomers(
{
id: ["cus_123", "cus_321"],
},
{
relations: ["groups"],
take: 20,
skip: 2,
}
)
```
## Parameters
<TypeList types={[{"name":"filters","type":"[FilterableCustomerProps](../../../interfaces/customer.FilterableCustomerProps/page.mdx)","description":"The filters to apply on the retrieved customers.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"q","type":"`string`","description":"Searches for customers by properties such as name and email using this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by email.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62; \\| [ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"groups","type":"`string` \\| `string`[] \\| [FilterableCustomerGroupProps](../../../interfaces/customer.FilterableCustomerGroupProps/page.mdx)","description":"Filter by associated customer group.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"q","type":"`string`","description":"Searches for customer groups by name using this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer group by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter customer groups by name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customers","type":"`string` \\| `string`[] \\| [FilterableCustomerProps](../../../interfaces/customer.FilterableCustomerProps/page.mdx)","description":"Filter customer groups by associated customers.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"Line truncated
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)[], number]&#62;","optional":false,"defaultValue":"","description":"The list of customers along with their total count.","expandable":false,"children":[{"name":"CustomerDTO[]","type":"[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]},{"name":"number","type":"`number`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="listAndCountCustomers"/>
@@ -55,7 +55,7 @@ const customerGroupCustomerRels =
## Parameters
<TypeList types={[{"name":"filters","type":"[FilterableCustomerGroupCustomerProps](../../../interfaces/customer.FilterableCustomerGroupCustomerProps/page.mdx)","description":"The filters to apply on the retrieved customer-group relations.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer group's customer relation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`string` \\| `string`[]","description":"Filter by customer ID(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_group_id","type":"`string` \\| `string`[]","description":"Filter by customer group ID(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer","type":"`string` \\| `string`[] \\| [FilterableCustomerProps](../../../interfaces/customer.FilterableCustomerProps/page.mdx)","description":"Filter by customer IDs or filterable customer attributes.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"group","type":"`string` \\| `string`[] \\| [FilterableCustomerGroupProps](../../../interfaces/customer.FilterableCustomerGroupProps/page.mdx)","description":"Filter by customer group IDs or filterable group attributes.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`null` \\| `string` \\| `string`[]","description":"Filter by the group's `created_by` attribute.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by created date.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62; \\| [ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"updated_at","type":"[OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by updated date.","optionalLine truncated
<TypeList types={[{"name":"filters","type":"[FilterableCustomerGroupCustomerProps](../../../interfaces/customer.FilterableCustomerGroupCustomerProps/page.mdx)","description":"The filters to apply on the retrieved customer-group relations.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer group's customer relation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`string` \\| `string`[]","description":"Filter by customer ID(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_group_id","type":"`string` \\| `string`[]","description":"Filter by customer group ID(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer","type":"`string` \\| `string`[] \\| [FilterableCustomerProps](../../../interfaces/customer.FilterableCustomerProps/page.mdx)","description":"Filter by customer IDs or filterable customer attributes.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"q","type":"`string`","description":"Searches for customers by properties such as name and email using this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by email.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"groups","type":"`string` \\| `string`[] \\| [FilterableCustomerGroupProps](../../../interfaces/customer.FilterableCustomerGroupProps/page.mdx)","description":"Filter by associated customer group.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"default_billing_address_id","type":"`null` \\| `string` \\| `string`[]","description":"Filter by the associated default billing address's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"default_shipping_address_id","type":"`null` \\| `string` \\| `string`[]","description":"Filter by the associated default shipping address's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company_name","type":"`null` \\| `string` \\| `string`[] \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by company name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string` \\| `string`[] \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by first name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string` \\| `string`[] \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by last name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"has_account","type":"`boolean` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;boolean&#62;","description":"Filter by whether the customer has an account.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`null` \\| `string` \\| `string`[]","description":"Filter by the `created_by` attribute.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by created date.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"[OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by updated date.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([FilterableCustomerProps](../../../interfaces/customer.FilterableCustomerProps/page.mdx) \\| [BaseFilterable](../../../interfaces/customer.BaseFilterable/page.mdx)&#60;[FilterableCustomerProps](../../../interfaces/customer.FilterableCustomerProps/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([FilterableCustomerProps](../../../interfaces/customer.FilterableCustomerProps/page.mdx) \\| [BaseFilterable](../../../interfaces/customer.BaseFilterable/page.mdx)&#60;[FilterableCustomerProps](../../../interfaces/customer.FilterableCustomerProps/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":falLine truncated
## Returns
@@ -55,7 +55,7 @@ const customerGroups =
## Parameters
<TypeList types={[{"name":"filters","type":"[FilterableCustomerGroupProps](../../../interfaces/customer.FilterableCustomerGroupProps/page.mdx)","description":"The filters to apply on the retrieved customer groups.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer group by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter customer groups by name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customers","type":"`string` \\| `string`[] \\| [FilterableCustomerProps](../../../interfaces/customer.FilterableCustomerProps/page.mdx)","description":"Filter customer groups by associated customers.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`null` \\| `string` \\| `string`[]","description":"Filter customer groups by their `created_by` attribute.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter customer groups by created date.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62; \\| [ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"updated_at","type":"[OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter customer groups by updated date.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ELine truncated
<TypeList types={[{"name":"filters","type":"[FilterableCustomerGroupProps](../../../interfaces/customer.FilterableCustomerGroupProps/page.mdx)","description":"The filters to apply on the retrieved customer groups.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"q","type":"`string`","description":"Searches for customer groups by name using this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer group by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter customer groups by name.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62; \\| [ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"customers","type":"`string` \\| `string`[] \\| [FilterableCustomerProps](../../../interfaces/customer.FilterableCustomerProps/page.mdx)","description":"Filter customer groups by associated customers.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"q","type":"`string`","description":"Searches for customers by properties such as name and email using this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by email.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"groups","type":"`string` \\| `string`[] \\| [FilterableCustomerGroupProps](../../../interfaces/customer.FilterableCustomerGroupProps/page.mdx)","description":"Filter by associated customer group.","optional":true,"defaultValue":"","expandable":false,"Line truncated
## Returns
@@ -0,0 +1,59 @@
---
displayed_sidebar: customerReference
slug: /references/customer/listCustomers
sidebar_label: listCustomers
---
import { TypeList } from "docs-ui"
# listCustomers - Customer Module Reference
This documentation provides a reference to the `listCustomers` method. This belongs to the Customer Module.
This method retrieves a paginated list of customers based on optional filters and configuration.
## Example
To retrieve a list of customers using their IDs:
```ts
const customers = await customerModuleService.listCustomers({
id: ["cus_123", "cus_321"],
})
```
To specify relations that should be retrieved within the customers:
```ts
const customers = await customerModuleService.listCustomers(
{
id: ["cus_123", "cus_321"],
},
{
relations: ["groups"],
}
)
```
By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
```ts
const customers = await customerModuleService.listCustomers(
{
id: ["cus_123", "cus_321"],
},
{
relations: ["groups"],
take: 20,
skip: 2,
}
)
```
## Parameters
<TypeList types={[{"name":"filters","type":"[FilterableCustomerProps](../../../interfaces/customer.FilterableCustomerProps/page.mdx)","description":"The filters to apply on the retrieved customers.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"q","type":"`string`","description":"Searches for customers by properties such as name and email using this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by email.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62; \\| [ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"groups","type":"`string` \\| `string`[] \\| [FilterableCustomerGroupProps](../../../interfaces/customer.FilterableCustomerGroupProps/page.mdx)","description":"Filter by associated customer group.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"q","type":"`string`","description":"Searches for customer groups by name using this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer group by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter customer groups by name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customers","type":"`string` \\| `string`[] \\| [FilterableCustomerProps](../../../interfaces/customer.FilterableCustomerProps/page.mdx)","description":"Filter customer groups by associated customers.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"Line truncated
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The list of customers.","expandable":false,"children":[{"name":"CustomerDTO[]","type":"[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CustomerDTO","type":"`object`","description":"The customer details.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="listCustomers"/>
@@ -1,27 +1,27 @@
---
displayed_sidebar: customerReference
slug: /references/customer/restore
sidebar_label: restore
slug: /references/customer/restoreCustomers
sidebar_label: restoreCustomers
---
import { TypeList } from "docs-ui"
# restore - Customer Module Reference
# restoreCustomers - Customer Module Reference
This documentation provides a reference to the `restore` method. This belongs to the Customer Module.
This documentation provides a reference to the `restoreCustomers` method. This belongs to the Customer Module.
This method restores soft deleted customer by their IDs.
## Example
```ts
await customerModuleService.restore(["cus_123"])
await customerModuleService.restoreCustomers(["cus_123"])
```
## Parameters
<TypeList types={[{"name":"customerIds","type":"`string`[]","description":"The IDs of customers.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[RestoreReturn](../../../interfaces/customer.RestoreReturn/page.mdx)&#60;TReturnableLinkableKeys&#62;","description":"Configurations determining which relations to restore along with each of the customer. You can pass to its `returnLinkableKeys`\nproperty any of the customer's relation attribute names, such as `groups`.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"returnLinkableKeys","type":"TReturnableLinkableKeys[]","description":"An array of strings, each being the ID attribute names of the entity's relations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="restore"/>
<TypeList types={[{"name":"customerIds","type":"`string`[]","description":"The IDs of customers.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[RestoreReturn](../../../interfaces/customer.RestoreReturn/page.mdx)&#60;TReturnableLinkableKeys&#62;","description":"Configurations determining which relations to restore along with each of the customer. You can pass to its `returnLinkableKeys`\nproperty any of the customer's relation attribute names, such as `groups`.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"returnLinkableKeys","type":"TReturnableLinkableKeys[]","description":"An array of strings, each being the ID attribute names of the entity's relations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="restoreCustomers"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;void \\| Record&#60;TReturnableLinkableKeys, string[]&#62;&#62;","optional":false,"defaultValue":"","description":"An object that includes the IDs of related records that were restored.\nIf there are no related records restored, the promise resolves to `void`.","expandable":false,"children":[{"name":"void \\| Record&#60;TReturnableLinkableKeys, string[]&#62;","type":"`void` \\| `Record<TReturnableLinkableKeys, string[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="restore"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;void \\| Record&#60;TReturnableLinkableKeys, string[]&#62;&#62;","optional":false,"defaultValue":"","description":"An object that includes the IDs of related records that were restored.\nIf there are no related records restored, the promise resolves to `void`.","expandable":false,"children":[{"name":"void \\| Record&#60;TReturnableLinkableKeys, string[]&#62;","type":"`void` \\| `Record<TReturnableLinkableKeys, string[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="restoreCustomers"/>
@@ -1,14 +1,14 @@
---
displayed_sidebar: customerReference
slug: /references/customer/retrieve
sidebar_label: retrieve
slug: /references/customer/retrieveCustomer
sidebar_label: retrieveCustomer
---
import { TypeList } from "docs-ui"
# retrieve - Customer Module Reference
# retrieveCustomer - Customer Module Reference
This documentation provides a reference to the `retrieve` method. This belongs to the Customer Module.
This documentation provides a reference to the `retrieveCustomer` method. This belongs to the Customer Module.
This method retrieves a customer by its ID.
@@ -17,21 +17,21 @@ This method retrieves a customer by its ID.
A simple example that retrieves a customer by its ID:
```ts
const customer = await customerModuleService.retrieve("cus_123")
const customer = await customerModuleService.retrieveCustomer("cus_123")
```
To specify relations that should be retrieved:
```ts
const customer = await customerModuleService.retrieve("cus_123", {
const customer = await customerModuleService.retrieveCustomer("cus_123", {
relations: ["groups"],
})
```
## Parameters
<TypeList types={[{"name":"customerId","type":"`string`","description":"The customer's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../../interfaces/customer.FindConfig/page.mdx)&#60;[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)&#62;","description":"The configurations determining how the customer is retrieved. Its properties, such as `select` or `relations`, accept the\nattributes or relations associated with a customer.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"select","type":"(`string` \\| keyof Entity)[]","description":"An array of strings, each being attribute names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"skip","type":"`null` \\| `number`","description":"A number indicating the number of records to skip before retrieving the results.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`null` \\| `number`","description":"A number indicating the number of records to return in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relations","type":"`string`[]","description":"An array of strings, each being relation names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`object`","description":"An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC`\nto sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"withDeleted","type":"`boolean`","description":"A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the\n`SoftDeletableEntity` class.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"filters","type":"`Record<string, any>`","description":"Enable ORM specific defined filters","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="retrieve"/>
<TypeList types={[{"name":"customerId","type":"`string`","description":"The customer's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../../interfaces/customer.FindConfig/page.mdx)&#60;[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)&#62;","description":"The configurations determining how the customer is retrieved. Its properties, such as `select` or `relations`, accept the\nattributes or relations associated with a customer.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"select","type":"(`string` \\| keyof Entity)[]","description":"An array of strings, each being attribute names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"skip","type":"`null` \\| `number`","description":"A number indicating the number of records to skip before retrieving the results.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`null` \\| `number`","description":"A number indicating the number of records to return in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relations","type":"`string`[]","description":"An array of strings, each being relation names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`object`","description":"An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC`\nto sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"withDeleted","type":"`boolean`","description":"A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the\n`SoftDeletableEntity` class.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"filters","type":"`Record<string, any>`","description":"Enable ORM specific defined filters","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, any>`","description":"Enable ORM specific defined options","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="retrieveCustomer"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The retrieved customer.","expandable":false,"children":[{"name":"CustomerDTO","type":"[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)","optional":false,"defaultValue":"","description":"The customer details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string`","description":"The email of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"has_account","type":"`boolean`","description":"A flag indicating if customer has an account or not.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_billing_address_id","type":"`null` \\| `string`","description":"The associated default billing address's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_shipping_address_id","type":"`null` \\| `string`","description":"The associated default shipping address's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"company_name","type":"`null` \\| `string`","description":"The company name of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string`","description":"The first name of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string`","description":"The last name of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"addresses","type":"[CustomerAddressDTO](../../../interfaces/customer.CustomerAddressDTO/page.mdx)[]","description":"The addresses of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the customer address.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_shipping","type":"`boolean`","description":"Whether the customer address is default shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_billing","type":"`boolean`","description":"Whether the customer address is default billing.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`string`","description":"The associated customer's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The created at of the customer address.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The updated at of the customer address.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"address_name","type":"`string`","description":"The address name of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`string`","description":"The company of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string`","description":"The first name of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string`","description":"The last name of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`string`","description":"The address 1 of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`string`","description":"The address 2 of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`string`","description":"The city of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`string`","description":"The country code of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`string`","description":"The province of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`string`","description":"The postal code of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string`","description":"The phone of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"phone","type":"`null` \\| `strinLine truncated
<TypeList types={[{"name":"Promise","type":"Promise&#60;[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The retrieved customer.","expandable":false,"children":[{"name":"CustomerDTO","type":"[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)","optional":false,"defaultValue":"","description":"The customer details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string`","description":"The email of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"has_account","type":"`boolean`","description":"A flag indicating if customer has an account or not.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_billing_address_id","type":"`null` \\| `string`","description":"The associated default billing address's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_shipping_address_id","type":"`null` \\| `string`","description":"The associated default shipping address's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"company_name","type":"`null` \\| `string`","description":"The company name of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string`","description":"The first name of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string`","description":"The last name of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"addresses","type":"[CustomerAddressDTO](../../../interfaces/customer.CustomerAddressDTO/page.mdx)[]","description":"The addresses of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the customer address.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_shipping","type":"`boolean`","description":"Whether the customer address is default shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_billing","type":"`boolean`","description":"Whether the customer address is default billing.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`string`","description":"The associated customer's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The created at of the customer address.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The updated at of the customer address.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"address_name","type":"`string`","description":"The address name of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`string`","description":"The company of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string`","description":"The first name of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string`","description":"The last name of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`string`","description":"The address 1 of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`string`","description":"The address 2 of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`string`","description":"The city of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`string`","description":"The country code of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`string`","description":"The province of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`string`","description":"The postal code of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string`","description":"The phone of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"phone","type":"`null` \\| `strinLine truncated
@@ -16,12 +16,12 @@ This method retrieves a customer group by its ID.
```ts
const customerGroup =
await customerModuleService.retrieve("cusgroup_123")
await customerModuleService.retrieveCustomerGroup("cusgroup_123")
```
## Parameters
<TypeList types={[{"name":"groupId","type":"`string`","description":"The customer group's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../../interfaces/customer.FindConfig/page.mdx)&#60;[CustomerGroupDTO](../../../interfaces/customer.CustomerGroupDTO/page.mdx)&#62;","description":"The configurations determining how the customer group is retrieved. Its properties, such as `select` or `relations`, accept the\nattributes or relations associated with a customer group.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"select","type":"(`string` \\| keyof Entity)[]","description":"An array of strings, each being attribute names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"skip","type":"`null` \\| `number`","description":"A number indicating the number of records to skip before retrieving the results.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`null` \\| `number`","description":"A number indicating the number of records to return in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relations","type":"`string`[]","description":"An array of strings, each being relation names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`object`","description":"An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC`\nto sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"withDeleted","type":"`boolean`","description":"A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the\n`SoftDeletableEntity` class.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"filters","type":"`Record<string, any>`","description":"Enable ORM specific defined filters","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="retrieveCustomerGroup"/>
<TypeList types={[{"name":"groupId","type":"`string`","description":"The customer group's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[FindConfig](../../../interfaces/customer.FindConfig/page.mdx)&#60;[CustomerGroupDTO](../../../interfaces/customer.CustomerGroupDTO/page.mdx)&#62;","description":"The configurations determining how the customer group is retrieved. Its properties, such as `select` or `relations`, accept the\nattributes or relations associated with a customer group.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"select","type":"(`string` \\| keyof Entity)[]","description":"An array of strings, each being attribute names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"skip","type":"`null` \\| `number`","description":"A number indicating the number of records to skip before retrieving the results.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"take","type":"`null` \\| `number`","description":"A number indicating the number of records to return in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"relations","type":"`string`[]","description":"An array of strings, each being relation names of the entity to retrieve in the result.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`object`","description":"An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC`\nto sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"withDeleted","type":"`boolean`","description":"A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the\n`SoftDeletableEntity` class.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"filters","type":"`Record<string, any>`","description":"Enable ORM specific defined filters","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, any>`","description":"Enable ORM specific defined options","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="retrieveCustomerGroup"/>
## Returns
@@ -1,27 +1,27 @@
---
displayed_sidebar: customerReference
slug: /references/customer/softDelete
sidebar_label: softDelete
slug: /references/customer/softDeleteCustomers
sidebar_label: softDeleteCustomers
---
import { TypeList } from "docs-ui"
# softDelete - Customer Module Reference
# softDeleteCustomers - Customer Module Reference
This documentation provides a reference to the `softDelete` method. This belongs to the Customer Module.
This documentation provides a reference to the `softDeleteCustomers` method. This belongs to the Customer Module.
This method soft deletes customers by their IDs.
## Example
```ts
await customerModuleService.softDelete(["cus_123"])
await customerModuleService.softDeleteCustomers(["cus_123"])
```
## Parameters
<TypeList types={[{"name":"customerIds","type":"`string`[]","description":"The IDs of customers.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[SoftDeleteReturn](../../../interfaces/customer.SoftDeleteReturn/page.mdx)&#60;TReturnableLinkableKeys&#62;","description":"An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"returnLinkableKeys","type":"TReturnableLinkableKeys[]","description":"An array of strings, each being the ID attribute names of the entity's relations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="softDelete"/>
<TypeList types={[{"name":"customerIds","type":"`string`[]","description":"The IDs of customers.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"config","type":"[SoftDeleteReturn](../../../interfaces/customer.SoftDeleteReturn/page.mdx)&#60;TReturnableLinkableKeys&#62;","description":"An object that is used to specify an entity's related entities that should be soft-deleted when the main entity is soft-deleted.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"returnLinkableKeys","type":"TReturnableLinkableKeys[]","description":"An array of strings, each being the ID attribute names of the entity's relations.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="softDeleteCustomers"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;void \\| Record&#60;TReturnableLinkableKeys, string[]&#62;&#62;","optional":false,"defaultValue":"","description":"An object that includes the IDs of related records that were also soft deleted, such as the ID of the associated address.\nThe object's keys are the ID attribute names of the customer entity's relations, such as `address_id`, and its value is an array of strings, each being the ID of a record associated\nwith the customer through this relation, such as the IDs of associated address.\n\nIf there are no related records, the promise resolves to `void`.","expandable":false,"children":[{"name":"void \\| Record&#60;TReturnableLinkableKeys, string[]&#62;","type":"`void` \\| `Record<TReturnableLinkableKeys, string[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="softDelete"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;void \\| Record&#60;TReturnableLinkableKeys, string[]&#62;&#62;","optional":false,"defaultValue":"","description":"An object that includes the IDs of related records that were also soft deleted, such as the ID of the associated address.\nThe object's keys are the ID attribute names of the customer entity's relations, such as `address_id`, and its value is an array of strings, each being the ID of a record associated\nwith the customer through this relation, such as the IDs of associated address.\n\nIf there are no related records, the promise resolves to `void`.","expandable":false,"children":[{"name":"void \\| Record&#60;TReturnableLinkableKeys, string[]&#62;","type":"`void` \\| `Record<TReturnableLinkableKeys, string[]>`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} sectionTitle="softDeleteCustomers"/>
@@ -1,80 +0,0 @@
---
displayed_sidebar: customerReference
slug: /references/customer/update
sidebar_label: update
---
import { TypeList } from "docs-ui"
# update - Customer Module Reference
This documentation provides a reference to the `update` method. This belongs to the Customer Module.
## update(customerId, data, sharedContext?): Promise&#60;[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)&#62;
This method updates an existing customer.
### Example
```ts
const customer = await customerModuleService.update(
"cus_123",
{
first_name: "Matt",
}
)
```
### Parameters
<TypeList types={[{"name":"customerId","type":"`string`","description":"The customer's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"[CustomerUpdatableFields](../../../interfaces/customer.CustomerUpdatableFields/page.mdx)","description":"The updatable fields of a customer.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"company_name","type":"`null` \\| `string`","description":"The company name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string`","description":"The first name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string`","description":"The last name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`null` \\| `string`","description":"The email of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`null` \\| `string`","description":"The phone of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="update"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The updated customer.","expandable":false,"children":[{"name":"CustomerDTO","type":"[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)","optional":false,"defaultValue":"","description":"The customer details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string`","description":"The email of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"has_account","type":"`boolean`","description":"A flag indicating if customer has an account or not.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_billing_address_id","type":"`null` \\| `string`","description":"The associated default billing address's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_shipping_address_id","type":"`null` \\| `string`","description":"The associated default shipping address's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"company_name","type":"`null` \\| `string`","description":"The company name of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string`","description":"The first name of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string`","description":"The last name of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"addresses","type":"[CustomerAddressDTO](../../../interfaces/customer.CustomerAddressDTO/page.mdx)[]","description":"The addresses of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the customer address.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_shipping","type":"`boolean`","description":"Whether the customer address is default shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_billing","type":"`boolean`","description":"Whether the customer address is default billing.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`string`","description":"The associated customer's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The created at of the customer address.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The updated at of the customer address.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"address_name","type":"`string`","description":"The address name of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`string`","description":"The company of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string`","description":"The first name of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string`","description":"The last name of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`string`","description":"The address 1 of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`string`","description":"The address 2 of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`string`","description":"The city of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`string`","description":"The country code of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`string`","description":"The province of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`string`","description":"The postal code of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string`","description":"The phone of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"phone","type":"`null` \\| `string`Line truncated
## update(customerIds, data, sharedContext?): Promise&#60;[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)[]&#62;
This method updates existing customers.
### Example
```ts
const customers = await customerModuleService.update(
["cus_123", "cus_321"],
{
company_name: "Acme",
}
)
```
### Parameters
<TypeList types={[{"name":"customerIds","type":"`string`[]","description":"The IDs of customers to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"[CustomerUpdatableFields](../../../interfaces/customer.CustomerUpdatableFields/page.mdx)","description":"The attributes to update in the customers.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"company_name","type":"`null` \\| `string`","description":"The company name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string`","description":"The first name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string`","description":"The last name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`null` \\| `string`","description":"The email of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`null` \\| `string`","description":"The phone of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="update"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The updated customers.","expandable":false,"children":[{"name":"CustomerDTO[]","type":"[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CustomerDTO","type":"`object`","description":"The customer details.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="update"/>
## update(selector, data, sharedContext?): Promise&#60;[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)[]&#62;
This method updates existing customers.
### Example
```ts
const customers = await customerModuleService.update(
{ company_name: "Acme" },
{
company_name: "Acme Inc.",
}
)
```
### Parameters
<TypeList types={[{"name":"selector","type":"[FilterableCustomerProps](../../../interfaces/customer.FilterableCustomerProps/page.mdx)","description":"The filters that specify which API keys should be updated.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by email.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"groups","type":"`string` \\| `string`[] \\| [FilterableCustomerGroupProps](../../../interfaces/customer.FilterableCustomerGroupProps/page.mdx)","description":"Filter by associated customer group.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"default_billing_address_id","type":"`null` \\| `string` \\| `string`[]","description":"Filter by the associated default billing address's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"default_shipping_address_id","type":"`null` \\| `string` \\| `string`[]","description":"Filter by the associated default shipping address's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company_name","type":"`null` \\| `string` \\| `string`[] \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by company name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string` \\| `string`[] \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by first name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string` \\| `string`[] \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by last name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"has_account","type":"`boolean` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;boolean&#62;","description":"Filter by whether the customer has an account.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`null` \\| `string` \\| `string`[]","description":"Filter by the `created_by` attribute.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by created date.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62; \\| [ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":Line truncated
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The updated customers.","expandable":false,"children":[{"name":"CustomerDTO[]","type":"[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CustomerDTO","type":"`object`","description":"The customer details.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="update"/>
@@ -28,7 +28,7 @@ const address = await customerModuleService.updateAddresses(
### Parameters
<TypeList types={[{"name":"addressId","type":"`string`","description":"The address's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"[UpdateCustomerAddressDTO](../../../interfaces/customer.UpdateCustomerAddressDTO/page.mdx)","description":"The attributes to update in the address.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_name","type":"`null` \\| `string`","description":"The address's name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_shipping","type":"`boolean`","description":"Whether the address is the default for shipping.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_billing","type":"`boolean`","description":"Whether the address is the default for billing.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`null` \\| `string`","description":"The associated customer's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`null` \\| `string`","description":"The company.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string`","description":"The first name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string`","description":"The last name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`null` \\| `string`","description":"The address 1.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`null` \\| `string`","description":"The address 2.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`null` \\| `string`","description":"The city.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`null` \\| `string`","description":"The country code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`null` \\| `string`","description":"The province.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`null` \\| `string`","description":"The postal code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`null` \\| `string`","description":"The phone.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the cuLine truncated
<TypeList types={[{"name":"addressId","type":"`string`","description":"The address's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"[UpdateCustomerAddressDTO](../../../interfaces/customer.UpdateCustomerAddressDTO/page.mdx)","description":"The attributes to update in the address.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_name","type":"`null` \\| `string`","description":"The address's name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_shipping","type":"`boolean`","description":"Whether the address is the default for shipping.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_billing","type":"`boolean`","description":"Whether the address is the default for billing.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`null` \\| `string`","description":"The associated customer's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`null` \\| `string`","description":"The company.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string`","description":"The first name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string`","description":"The last name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`null` \\| `string`","description":"The address 1.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`null` \\| `string`","description":"The address 2.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`null` \\| `string`","description":"The city.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`null` \\| `string`","description":"The country code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`null` \\| `string`","description":"The province.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`null` \\| `string`","description":"The postal code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`null` \\| `string`","description":"The phone.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../types/customer.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string inLine truncated
### Returns
@@ -52,7 +52,7 @@ const addresses = await customerModuleService.updateAddresses(
### Parameters
<TypeList types={[{"name":"addressIds","type":"`string`[]","description":"The IDs of addresses to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"[UpdateCustomerAddressDTO](../../../interfaces/customer.UpdateCustomerAddressDTO/page.mdx)","description":"The attributes to update in the addresses.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_name","type":"`null` \\| `string`","description":"The address's name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_shipping","type":"`boolean`","description":"Whether the address is the default for shipping.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_billing","type":"`boolean`","description":"Whether the address is the default for billing.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`null` \\| `string`","description":"The associated customer's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`null` \\| `string`","description":"The company.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string`","description":"The first name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string`","description":"The last name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`null` \\| `string`","description":"The address 1.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`null` \\| `string`","description":"The address 2.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`null` \\| `string`","description":"The city.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`null` \\| `string`","description":"The country code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`null` \\| `string`","description":"The province.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`null` \\| `string`","description":"The postal code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`null` \\| `string`","description":"The phone.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicatiLine truncated
<TypeList types={[{"name":"addressIds","type":"`string`[]","description":"The IDs of addresses to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"[UpdateCustomerAddressDTO](../../../interfaces/customer.UpdateCustomerAddressDTO/page.mdx)","description":"The attributes to update in the addresses.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_name","type":"`null` \\| `string`","description":"The address's name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_shipping","type":"`boolean`","description":"Whether the address is the default for shipping.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_billing","type":"`boolean`","description":"Whether the address is the default for billing.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`null` \\| `string`","description":"The associated customer's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`null` \\| `string`","description":"The company.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string`","description":"The first name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string`","description":"The last name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`null` \\| `string`","description":"The address 1.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`null` \\| `string`","description":"The address 2.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`null` \\| `string`","description":"The city.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`null` \\| `string`","description":"The country code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`null` \\| `string`","description":"The province.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`null` \\| `string`","description":"The postal code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`null` \\| `string`","description":"The phone.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../types/customer.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","descriLine truncated
### Returns
@@ -75,7 +75,7 @@ const addresses = await customerModuleService.updateAddresses(
### Parameters
<TypeList types={[{"name":"selector","type":"[FilterableCustomerAddressProps](../../../interfaces/customer.FilterableCustomerAddressProps/page.mdx)","description":"The filters that specify which address should be updated.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer address by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_name","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_shipping","type":"`boolean` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;boolean&#62;","description":"Filter addresses by whether they're the default for shipping.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_billing","type":"`boolean` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;boolean&#62;","description":"Filter addresses by whether they're the default for billing.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`string` \\| `string`[]","description":"Filter addresses by the associated customer's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer","type":"`string` \\| `string`[] \\| [FilterableCustomerProps](../../../interfaces/customer.FilterableCustomerProps/page.mdx)","description":"Filter addresses by the associated customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by company.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by first name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by last name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by first address line.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by second address line.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by city.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by country code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by province.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by postal code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by phone number.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;Record&#60;string, unknown&#62;&#62;","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by created date.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62; \\| [ExpandScLine truncated
<TypeList types={[{"name":"selector","type":"[FilterableCustomerAddressProps](../../../interfaces/customer.FilterableCustomerAddressProps/page.mdx)","description":"The filters that specify which address should be updated.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"q","type":"`string`","description":"Searches for addreses by properties such as name and street using this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer address by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_name","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter addresses by name.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62; \\| [ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"is_default_shipping","type":"`boolean` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;boolean&#62;","description":"Filter addresses by whether they're the default for shipping.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62; \\| [ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](..Line truncated
### Returns
@@ -28,7 +28,7 @@ const customerGroup =
### Parameters
<TypeList types={[{"name":"groupId","type":"`string`","description":"The group's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"[CustomerGroupUpdatableFields](../../../interfaces/customer.CustomerGroupUpdatableFields/page.mdx)","description":"The attributes to update in the customer group.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the customer group.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updateCustomerGroups"/>
<TypeList types={[{"name":"groupId","type":"`string`","description":"The group's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"[CustomerGroupUpdatableFields](../../../interfaces/customer.CustomerGroupUpdatableFields/page.mdx)","description":"The attributes to update in the customer group.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the customer group.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../types/customer.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updateCustomerGroups"/>
### Returns
@@ -52,7 +52,7 @@ const customerGroups =
### Parameters
<TypeList types={[{"name":"groupIds","type":"`string`[]","description":"The IDs of customer groups.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"[CustomerGroupUpdatableFields](../../../interfaces/customer.CustomerGroupUpdatableFields/page.mdx)","description":"The attributes to update in the customer groups.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the customer group.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updateCustomerGroups"/>
<TypeList types={[{"name":"groupIds","type":"`string`[]","description":"The IDs of customer groups.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"[CustomerGroupUpdatableFields](../../../interfaces/customer.CustomerGroupUpdatableFields/page.mdx)","description":"The attributes to update in the customer groups.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the customer group.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../types/customer.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updateCustomerGroups"/>
### Returns
@@ -78,7 +78,7 @@ const customerGroups =
### Parameters
<TypeList types={[{"name":"selector","type":"[FilterableCustomerGroupProps](../../../interfaces/customer.FilterableCustomerGroupProps/page.mdx)","description":"The filters that specify which customer groups should be updates.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer group by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter customer groups by name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customers","type":"`string` \\| `string`[] \\| [FilterableCustomerProps](../../../interfaces/customer.FilterableCustomerProps/page.mdx)","description":"Filter customer groups by associated customers.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`null` \\| `string` \\| `string`[]","description":"Filter customer groups by their `created_by` attribute.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter customer groups by created date.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62; \\| [ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"updated_at","type":"[OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter customer groups by updated date.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eLine truncated
<TypeList types={[{"name":"selector","type":"[FilterableCustomerGroupProps](../../../interfaces/customer.FilterableCustomerGroupProps/page.mdx)","description":"The filters that specify which customer groups should be updates.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"q","type":"`string`","description":"Searches for customer groups by name using this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer group by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter customer groups by name.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62; \\| [ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"customers","type":"`string` \\| `string`[] \\| [FilterableCustomerProps](../../../interfaces/customer.FilterableCustomerProps/page.mdx)","description":"Filter customer groups by associated customers.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"q","type":"`string`","description":"Searches for customers by properties such as name and email using this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by email.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"groups","type":"`string` \\| `string`[] \\| [FilterableCustomerGroupProps](../../../interfaces/customer.FilterableCustomerGroupProps/page.mdx)","description":"Filter by associated customer group.","optional":true,"defaultValue":"","expandLine truncated
### Returns
@@ -0,0 +1,80 @@
---
displayed_sidebar: customerReference
slug: /references/customer/updateCustomers
sidebar_label: updateCustomers
---
import { TypeList } from "docs-ui"
# updateCustomers - Customer Module Reference
This documentation provides a reference to the `updateCustomers` method. This belongs to the Customer Module.
## updateCustomers(customerId, data, sharedContext?): Promise&#60;[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)&#62;
This method updates an existing customer.
### Example
```ts
const customer = await customerModuleService.updateCustomers(
"cus_123",
{
first_name: "Matt",
}
)
```
### Parameters
<TypeList types={[{"name":"customerId","type":"`string`","description":"The customer's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"[CustomerUpdatableFields](../../../interfaces/customer.CustomerUpdatableFields/page.mdx)","description":"The updatable fields of a customer.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"company_name","type":"`null` \\| `string`","description":"The company name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string`","description":"The first name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string`","description":"The last name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`null` \\| `string`","description":"The email of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`null` \\| `string`","description":"The phone of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../types/customer.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updateCustomers"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The updated customer.","expandable":false,"children":[{"name":"CustomerDTO","type":"[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)","optional":false,"defaultValue":"","description":"The customer details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string`","description":"The email of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"has_account","type":"`boolean`","description":"A flag indicating if customer has an account or not.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_billing_address_id","type":"`null` \\| `string`","description":"The associated default billing address's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"default_shipping_address_id","type":"`null` \\| `string`","description":"The associated default shipping address's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"company_name","type":"`null` \\| `string`","description":"The company name of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string`","description":"The first name of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string`","description":"The last name of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"addresses","type":"[CustomerAddressDTO](../../../interfaces/customer.CustomerAddressDTO/page.mdx)[]","description":"The addresses of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the customer address.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_shipping","type":"`boolean`","description":"Whether the customer address is default shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_default_billing","type":"`boolean`","description":"Whether the customer address is default billing.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`string`","description":"The associated customer's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The created at of the customer address.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The updated at of the customer address.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"address_name","type":"`string`","description":"The address name of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`string`","description":"The company of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`string`","description":"The first name of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`string`","description":"The last name of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`string`","description":"The address 1 of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`string`","description":"The address 2 of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`string`","description":"The city of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`string`","description":"The country code of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`string`","description":"The province of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`string`","description":"The postal code of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`string`","description":"The phone of the customer address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"phone","type":"`null` \\| `string`Line truncated
## updateCustomers(customerIds, data, sharedContext?): Promise&#60;[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)[]&#62;
This method updates existing customers.
### Example
```ts
const customers = await customerModuleService.updateCustomers(
["cus_123", "cus_321"],
{
company_name: "Acme",
}
)
```
### Parameters
<TypeList types={[{"name":"customerIds","type":"`string`[]","description":"The IDs of customers to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"[CustomerUpdatableFields](../../../interfaces/customer.CustomerUpdatableFields/page.mdx)","description":"The attributes to update in the customers.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"company_name","type":"`null` \\| `string`","description":"The company name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`null` \\| `string`","description":"The first name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`null` \\| `string`","description":"The last name of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`null` \\| `string`","description":"The email of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`null` \\| `string`","description":"The phone of the customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"[MetadataType](../../../types/customer.MetadataType/page.mdx)","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sharedContext","type":"[Context](../../../interfaces/customer.Context/page.mdx)","description":"A context used to share resources, such as transaction manager, between the application and the module.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"transactionManager","type":"TManager","description":"An instance of a transaction manager of type `TManager`, which is a typed parameter passed to the context to specify the type of the `transactionManager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manager","type":"TManager","description":"An instance of a manager, typically an entity manager, of type `TManager`, which is a typed parameter passed to the context to specify the type of the `manager`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationLevel","type":"`string`","description":"A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"enableNestedTransactions","type":"`boolean`","description":"A boolean value indicating whether nested transactions are enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"eventGroupId","type":"`string`","description":"A string indicating the ID of the group to aggregate the events to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"transactionId","type":"`string`","description":"A string indicating the ID of the current transaction.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"messageAggregator","type":"[IMessageAggregator](../../../interfaces/customer.IMessageAggregator/page.mdx)","description":"An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requestId","type":"`string`","description":"A string indicating the ID of the current request.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"idempotencyKey","type":"`string`","description":"A string indicating the idempotencyKey of the current workflow execution.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} sectionTitle="updateCustomers"/>
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The updated customers.","expandable":false,"children":[{"name":"CustomerDTO[]","type":"[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CustomerDTO","type":"`object`","description":"The customer details.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="updateCustomers"/>
## updateCustomers(selector, data, sharedContext?): Promise&#60;[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)[]&#62;
This method updates existing customers.
### Example
```ts
const customers = await customerModuleService.updateCustomers(
{ company_name: "Acme" },
{
company_name: "Acme Inc.",
}
)
```
### Parameters
<TypeList types={[{"name":"selector","type":"[FilterableCustomerProps](../../../interfaces/customer.FilterableCustomerProps/page.mdx)","description":"The filters that specify which API keys should be updated.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"q","type":"`string`","description":"Searches for customers by properties such as name and email using this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string` \\| `string`[] \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter by email.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62; \\| [ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../types/customer.Query/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](../../../types/customer.ExpandScalar/page.mdx)&#60;T&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"groups","type":"`string` \\| `string`[] \\| [FilterableCustomerGroupProps](../../../interfaces/customer.FilterableCustomerGroupProps/page.mdx)","description":"Filter by associated customer group.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"q","type":"`string`","description":"Searches for customer groups by name using this search term.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"The IDs to filter the customer group by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string` \\| [OperatorMap](../../../types/customer.OperatorMap/page.mdx)&#60;string&#62;","description":"Filter customer groups by name.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customers","type":"`string` \\| `string`[] \\| [FilterableCustomerProps](../../../interfaces/customer.FilterableCustomerProps/page.mdx)","description":"Filter customer groups by associated customers.","optional":true,"defaultValue":"","expandable":false,"chilLine truncated
### Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)[]&#62;","optional":false,"defaultValue":"","description":"The updated customers.","expandable":false,"children":[{"name":"CustomerDTO[]","type":"[CustomerDTO](../../../interfaces/customer.CustomerDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"CustomerDTO","type":"`object`","description":"The customer details.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} sectionTitle="updateCustomers"/>