Skip to main content
Skip to main content

getTaxLines - Tax Module Reference

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

This method retrieves tax lines for taxable items and shipping methods in a cart.

Learn more in this guide.

Example

const taxLines = await taxModuleService.getTaxLines(
[
{
id: "cali_123",
product_id: "prod_123",
unit_price: 1000,
quantity: 1,
},
{
id: "casm_123",
shipping_option_id: "so_123",
unit_price: 2000,
},
],
{
address: {
country_code: "us",
},
}
)

Parameters

The items and shipping methods to retrieve their tax lines.
calculationContextTaxCalculationContextRequired
The context to pass to the underlying tax provider. It provides more details that are useful to provide accurate tax lines.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<(ItemTaxLineDTO | ShippingTaxLineDTO)[]>Required
The item and shipping methods' tax lines.
Was this section helpful?