calculateTax( )


Calculates tax for the provided line items.

Tax is calculated for each line item based on the tax region in lineItems.taxRegionId and the tax group in lineItems.taxGroupId.

The breakdown of calculated tax returned, includes:

  • taxSummary: The overall total tax calculated.
  • lineItemTaxDetails.taxBreakdown: The tax calculated for each line item in each jurisdiction.
  • lineItemTaxDetails.taxSummary: The total tax calculated for each line item.

Where to find calculateTax()

When you add the Tax Calculation service plugin, a folder is automatically added to your site. Use the .js file in the folder to write the code to determine how to calculate tax for an order.

Method Declaration
Copy
Method Parameters
optionsOptionsRequired

Order information to calculate tax for.


contextContextRequired

Metadata about the request.

Returns
Return Type:Promise<TaxCalculationResponse>
Was this helpful?
Yes
No