Files
medusa-store/www/apps/docs/content/references/services/interfaces/ITaxService.mdx
github-actions[bot] cdd42dbdcd chore(docs): Generated References (#5743)
Generated the following references:
- `entities`
- `inventory`
- `js-client`
- `pricing`
- `product`
- `services`
- `stock-location`
- `workflows`

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
2023-11-27 18:58:52 +00:00

68 lines
1.7 KiB
Plaintext

---
displayed_sidebar: servicesSidebar
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# ITaxService
Interface to be implemented by tax provider plugins. The interface defines a
single method `getTaxLines` that returns numerical rates to apply to line
items and shipping methods.
## Methods
#### getTaxLines
`**getTaxLines**(itemLines, shippingLines, context): Promise&#60;[ProviderTaxLine](../types/ProviderTaxLine.mdx)[]&#62;`
Retrieves the numerical tax lines for a calculation context.
##### Parameters
<ParameterTypes parameters={[
{
"name": "itemLines",
"type": "[ItemTaxCalculationLine](../types/ItemTaxCalculationLine.mdx)[]",
"description": "the line item calculation lines",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "shippingLines",
"type": "[ShippingTaxCalculationLine](../types/ShippingTaxCalculationLine.mdx)[]",
"description": "",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "context",
"type": "[TaxCalculationContext](../types/TaxCalculationContext.mdx)",
"description": "other details relevant to the tax determination",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
}
]} />
##### Returns
Promise&#60;[ProviderTaxLine](../types/ProviderTaxLine.mdx)[]&#62;
<ParameterTypes parameters={[
{
"name": "Promise",
"type": "Promise&#60;[ProviderTaxLine](../types/ProviderTaxLine.mdx)[]&#62;",
"optional": false,
"defaultValue": "",
"description": "numerical tax rates that should apply to the provided calculation\n lines",
"expandable": false,
"children": []
}
]} />