|
1
|
{"slug":"/references/tax/getProvider","title":"getProvider - Tax Module Reference","frontmatter":{"displayed_sidebar":"taxReference","slug":"/references/tax/getProvider","sidebar_label":"getProvider"},"toc":[{"title":"Example","id":"example","level":2},{"title":"Parameters","id":"getprovider-parameters","level":2},{"title":"Returns","id":"getprovider-returns","level":2}],"blocks":[{"kind":"markdown","html":"This documentation provides a reference to the `getProvider` method. This belongs to the Tax Module."},{"kind":"note","variant":"note","html":"You should only use this methods when implementing complex customizations. For common cases, check out [available workflows instead](/medusa-workflows-reference)."},{"kind":"markdown","html":"This method returns the service of a Tax Module Provider by its ID. A Tax Module Provider's ID is of the format\n`tp_{identifier}_{id}`, where `identifier` is the static `identifier` property defined in the provider's service,\nand `id` is the ID set in `medusa-config.ts` when registering the provider."},{"kind":"heading","level":2,"text":"Example","id":"example"},{"kind":"markdown","html":"```ts\nconst avalaraProvider = taxModuleService.getProvider(\"tp_avalara_avalara\")\n// TODO: perform custom actions with the provider\n```"},{"kind":"heading","level":2,"text":"Parameters","id":"getprovider-parameters"},{"kind":"typeList","sectionTitle":"getProvider","types":[{"name":"providerId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"kind":"heading","level":2,"text":"Returns","id":"getprovider-returns"},{"kind":"typeList","sectionTitle":"getProvider","types":[{"name":"getIdentifier","type":"() => `string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"getTaxLines","type":"(`itemLines`: [ItemTaxCalculationLine](/references/tax/types/tax.ItemTaxCalculationLine)[], `shippingLines`: [ShippingTaxCalculationLine](/references/tax/types/tax.ShippingTaxCalculationLine)[], `context`: [TaxCalculationContext](/references/tax/interfaces/tax.TaxCalculationContext)) => Promise<([ItemTaxLineDTO](/references/tax/interfaces/tax.ItemTaxLineDTO) \\| [ShippingTaxLineDTO](/references/tax/interfaces/tax.ShippingTaxLineDTO))[]>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} |