Skip to main content
Skip to main content

update - Customer Module Reference

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

update(customerId, data, sharedContext?): Promise<CustomerDTO>

This method updates an existing customer.

Example

const customer = await customerModuleService.update(
"cus_123",
{
first_name: "Matt",
}
)

Parameters

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

Returns

PromisePromise<CustomerDTO>Required
The updated customer.

update(customerIds, data, sharedContext?): Promise<CustomerDTO[]>

This method updates existing customers.

Example

const customers = await customerModuleService.update(
["cus_123", "cus_321"],
{
company_name: "Acme",
}
)

Parameters

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

Returns

PromisePromise<CustomerDTO[]>Required
The updated customers.

update(selector, data, sharedContext?): Promise<CustomerDTO[]>

This method updates existing customers.

Example

const customers = await customerModuleService.update(
{ company_name: "Acme" },
{
company_name: "Acme Inc.",
}
)

Parameters

selectorFilterableCustomerPropsRequired
The filters that specify which API keys should be updated.
The attributes to update in the customers.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<CustomerDTO[]>Required
The updated customers.
Was this section helpful?