Skip to main content
Skip to main content

upsert - Tax Module Reference

This documentation provides a reference to the upsert method. This belongs to the Tax Module.

upsert(data, sharedContext?): Promise<TaxRateDTO>

This method updates or creates a tax rate if it doesn't exist.

Example

const taxRate = await taxModuleService.upsert({
id: "txr_123",
rate: 10,
})

Parameters

dataUpsertTaxRateDTORequired
The attributes in the tax rate to be created or updated.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<TaxRateDTO>Required
The created or updated tax rate.

upsert(data, sharedContext?): Promise<TaxRateDTO[]>

This method updates or creates tax rates if they don't exist.

Example

const taxRates = await taxModuleService.upsert([
{
id: "txr_123",
rate: 10,
},
])

Parameters

dataUpsertTaxRateDTO[]Required
The attributes in the tax rates to be created or updated.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<TaxRateDTO[]>Required
The created or updated tax rates.
Was this section helpful?