Skip to main content
Skip to main content

delete - Customer Module Reference

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

delete(customerId, sharedContext?): Promise<void>

This method deletes a customer by its ID.

Example

await customerModuleService.delete("cus_123")

Parameters

customerIdstringRequired
The customer's ID.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<void>Required
Resolves when the customer is deleted successfully.

delete(customerIds, sharedContext?): Promise<void>

This method deletes customers by their IDs.

Example

await customerModuleService.delete(["cus_123", "cus_321"])

Parameters

customerIdsstring[]Required
The IDs of customers.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<void>Required
Resolves when the customers are deleted successfully.

delete(selector, sharedContext?): Promise<void>

This method deletes a customer matching the specified filters.

Example

await customerModuleService.delete({
id: ["cus_123"],
})

Parameters

selectorFilterableCustomerPropsRequired
The filters that specify which customers should be deleted.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<void>Required
Resolves when the customers are deleted successfully.
Was this section helpful?