--- displayed_sidebar: servicesSidebar --- import ParameterTypes from "@site/src/components/ParameterTypes" # TaxProviderService Finds tax providers and assists in tax related operations. ## constructor ### Parameters ___ ## Properties `","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"__moduleDeclaration__","type":"`Record`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="TaxProviderService"/> ___ ## Accessors ### activeManager\_ #### Returns ___ ## Methods ### withTransaction #### Parameters #### Returns ### shouldRetryTransaction\_ #### Parameters ` \\| `object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="shouldRetryTransaction_"/> #### Returns ### atomicPhase\_ Wraps some work within a transactional block. If the service already has a transaction manager attached this will be reused, otherwise a new transaction manager is created. #### Type Parameters #### Parameters Promise<TResult>","description":"the transactional work to be done","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationOrErrorHandler","type":"`IsolationLevel` \\| (`error`: TError) => Promise<void \\| TResult>","description":"the isolation level to be used for the work.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"maybeErrorHandlerOrDontFail","type":"(`error`: TError) => Promise<void \\| TResult>","description":"Potential error handler","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="atomicPhase_"/> #### Returns ### list #### Returns ### retrieveProvider Retrieves the relevant tax provider for the given region. #### Parameters #### Returns {\n throw new Error(\"Method not implemented.\")\n }\n}\n\nexport default MyTaxService\n```\n\n---\n\n## Identifier Property\n\nThe `TaxProvider` entity has 2 properties: `identifier` and `is_installed`. The `identifier` property in the tax provider service is used when the tax provider is added to the database.\n\nThe value of this property is also used to reference the tax provider throughout Medusa. For example, it is used to [change the tax provider](https://docs.medusajs.com/modules/taxes/admin/manage-tax-settings#change-tax-provider-of-a-region) to a region.\n\n```ts title=\"src/services/my-tax.ts\"\nclass MyTaxService extends AbstractTaxService {\n static identifier = \"my-tax\"\n // ...\n}\n```\n\n---","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="retrieveProvider"/> ### clearLineItemsTaxLines #### Parameters #### Returns ### clearTaxLines #### Parameters #### Returns ### createTaxLines Persists the tax lines relevant for an order to the database. #### Parameters #### Returns ### createShippingTaxLines Persists the tax lines relevant for a shipping method to the database. Used for return shipping methods. #### Parameters #### Returns ### getShippingTaxLines Gets the relevant tax lines for a shipping method. Note: this method doesn't persist the tax lines. Use createShippingTaxLines if you wish to persist the tax lines to the DB layer. #### Parameters #### Returns ### getTaxLines Gets the relevant tax lines for an order or cart. If an order is provided the order's tax lines will be returned. If a cart is provided the tax lines will be computed from the tax rules and potentially a 3rd party tax plugin. Note: this method doesn't persist the tax lines. Use createTaxLines if you wish to persist the tax lines to the DB layer. #### Parameters #### Returns ### getTaxLinesMap Return a map of tax lines for line items and shipping methods #### Parameters #### Returns ### getRegionRatesForShipping Gets the tax rates configured for a shipping option. The rates are cached between calls. #### Parameters #### Returns ### getRegionRatesForProduct Gets the tax rates configured for a product. The rates are cached between calls. #### Parameters #### Returns ### getCacheKey The cache key to get cache hits by. #### Parameters #### Returns ### registerInstalledProviders #### Parameters #### Returns