Skip to main content
Skip to main content

addShippingMethodTaxLines - Cart Module Reference

This documentation provides a reference to the addShippingMethodTaxLines method. This belongs to the Cart Module.

addShippingMethodTaxLines(taxLines): Promise<ShippingMethodTaxLineDTO[]>

This method creates and adds shipping method tax lines.

Example

const shippingMethodTaxLines =
await cartModuleService.addShippingMethodTaxLines([
{
code: "1000",
rate: 10,
},
{
code: "1234",
rate: 20,
},
])

Parameters

The shipping method tax lines to be created.

Returns

PromisePromise<ShippingMethodTaxLineDTO[]>Required
The added shipping method tax lines.

addShippingMethodTaxLines(taxLine): Promise<ShippingMethodTaxLineDTO>

This method creates and adds a shipping method tax line.

Example

const shippingMethodTaxLine =
await cartModuleService.addShippingMethodTaxLines({
code: "1000",
rate: 10,
})

Parameters

The shipping method tax line to be created.

Returns

PromisePromise<ShippingMethodTaxLineDTO>Required
The added shipping method tax line.

addShippingMethodTaxLines(cartId, taxLines, sharedContext?): Promise<ShippingMethodTaxLineDTO[]>

This method creates and adds one or more shipping method tax lines to a cart.

Example

const shippingMethodTaxLines =
await cartModuleService.addShippingMethodTaxLines(
"cart_123",
[
{
code: "1000",
rate: 10,
},
{
code: "1234",
rate: 20,
},
]
)

Parameters

cartIdstringRequired
The cart's ID.
The shipping item tax lines to add. If the id field is specified, the tax line is kept and its attributes can be updated.
sharedContextContext
A context used to share resources, such as transaction manager, between the application and the module.

Returns

PromisePromise<ShippingMethodTaxLineDTO[]>Required
The added shipping method tax lines.
Was this section helpful?