1 {"slug":"/references/tax/interfaces/tax.ITaxProvider","title":"ITaxProvider","frontmatter":{"displayed_sidebar":"taxReference"},"toc":[{"title":"Identifier Property","id":"identifier-property","level":3},{"title":"constructor","id":"constructor","level":3},{"title":"Methods","id":"methods","level":2}],"blocks":[{"kind":"heading","level":3,"text":"Identifier Property","id":"identifier-property"},{"kind":"markdown","html":"Each tax provider has a unique identifier defined in its class. The provider's ID\nwill be stored as `tp_{identifier}_{id}`, where `{id}` is the provider's `id`\nproperty in the `medusa-config.ts`.\n\nFor example:\n\n```ts title=\"src/modules/my-tax/service.ts\"\nexport default class MyTaxProvider implements ITaxProvider {\n static identifier = \"my-tax\"\n // ...\n}\n```"},{"kind":"heading","level":3,"text":"constructor","id":"constructor"},{"kind":"markdown","html":"You can use the `constructor` of your Tax Module Provider's service to access the resources registered in the [Module Container](https://docs.medusajs.com/resources/medusa-container-resources#module-container-resources).\n\nYou can also use the constructor to initialize your integration with the third-party provider. For example, if you use a client to connect to the third-party provider’s APIs, you can initialize it in the constructor and use it in other methods in the service.\n\nAdditionally, if you’re creating your tax provider as a plugin or a module provider to be installed in any Medusa application and you want to access its options, you can access them in the second parameter of the constructor.\n\nFor example:\n\n```ts\nimport {\n ITaxProvider,\n Logger\n} from \"@medusajs/framework/types\"\n\ntype InjectedDependencies = {\n logger: Logger\n}\n\ntype Options = {\n apiKey: string\n}\n\nexport default class MyTaxProvider implements ITaxProvider {\n static identifier = \"my-tax\"\n protected logger_: Logger\n protected options_: Options\n // assuming you're initializing a client\n protected client\n\n constructor (\n { logger }: InjectedDependencies,\n options: Options\n ) {\n this.logger_ = logger\n this.options_ = options\n\n // assuming you're initializing a client\n this.client = new Client(options)\n }\n}\n```\n\n---"},{"kind":"heading","level":2,"text":"Methods","id":"methods"},{"kind":"linkList","items":[{"title":"getIdentifier","href":"/references/tax/ITaxProvider/methods/tax.ITaxProvider.getIdentifier"},{"title":"getTaxLines","href":"/references/tax/ITaxProvider/methods/tax.ITaxProvider.getTaxLines"}]}]}