Skip to main content
Skip to main content

create - Tax Module Reference

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

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

This method creates tax rates.

Example

const taxRates = await taxModuleService.create([
{
tax_region_id: "txreg_123",
name: "Default rate",
rate: 10,
},
{
tax_region_id: "txreg_123",
name: "Custom rate",
rate: 15,
rules: [
{
reference: "product_type",
reference_id: "ptyp_1",
},
{
reference: "product",
reference_id: "prod_123",
},
],
},
])

Parameters

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

Returns

PromisePromise<TaxRateDTO[]>Required
The created tax rates.

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

This method creates a tax rate.

Example

const taxRate = await taxModuleService.create({
tax_region_id: "txreg_123",
name: "Default rate",
rate: 10,
})

Parameters

dataCreateTaxRateDTORequired
The tax rate to be created.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<TaxRateDTO>Required
The created tax rate.
Was this section helpful?