--- displayed_sidebar: jsClientSidebar slug: /references/js-client/AdminTaxRatesResource --- import ParameterTypes from "@site/src/components/ParameterTypes" # AdminTaxRatesResource This class is used to send requests to [Admin Tax Rate API Routes](https://docs.medusajs.com/api/admin#tax-rates). All its method are available in the JS Client under the `medusa.admin.taxRates` property. All methods in this class require [user authentication](AdminAuthResource.mdx#createsession). Each region has at least a default tax rate. Admins can create and manage additional tax rates that can be applied for certain conditions, such as for specific product types. Related Guide: [How to manage tax rates](https://docs.medusajs.com/modules/taxes/admin/manage-tax-rates). ## Methods ### addProductTypes Add product types to a tax rate. #### Example ```ts import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token medusa.admin.taxRates .addProductTypes(taxRateId, { product_types: [productTypeId], }) .then(({ tax_rate }) => { console.log(tax_rate.id) }) ``` #### Parameters `", "description": "Custom headers to attach to the request.", "optional": false, "defaultValue": "{}", "expandable": false, "children": [] } ]} /> #### Returns `", "description": "An optional key-value map with additional details", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "name", "type": "`string`", "description": "A human friendly name for the tax", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "product_count", "type": "`number`", "description": "The count of products", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "product_type_count", "type": "`number`", "description": "The count of product types", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "product_types", "type": "[ProductType](../internal/classes/internal.ProductType.mdx)[]", "description": "The details of the product types that belong to this tax rate.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "products", "type": "[Product](../internal/classes/internal.Product.mdx)[]", "description": "The details of the products that belong to this tax rate.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "rate", "type": "``null`` \\| `number`", "description": "The numeric rate to charge", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "region", "type": "[Region](../internal/classes/internal.Region.mdx)", "description": "The details of the region that the rate belongs to.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "region_id", "type": "`string`", "description": "The ID of the region that the rate belongs to.", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "shipping_option_count", "type": "`number`", "description": "The count of shipping options", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "shipping_options", "type": "[ShippingOption](../internal/classes/internal.ShippingOption.mdx)[]", "description": "The details of the shipping options that belong to this tax rate.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "updated_at", "type": "`Date`", "description": "The date with timezone at which the resource was updated.", "optional": false, "defaultValue": "", "expandable": false, "children": [] } ] } ] } ] } ]} /> ___ ### addProducts Add products to a tax rate. #### Example ```ts import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token medusa.admin.taxRates .addProducts(taxRateId, { products: [productId], }) .then(({ tax_rate }) => { console.log(tax_rate.id) }) ``` #### Parameters `", "description": "Custom headers to attach to the request.", "optional": false, "defaultValue": "{}", "expandable": false, "children": [] } ]} /> #### Returns `", "description": "An optional key-value map with additional details", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "name", "type": "`string`", "description": "A human friendly name for the tax", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "product_count", "type": "`number`", "description": "The count of products", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "product_type_count", "type": "`number`", "description": "The count of product types", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "product_types", "type": "[ProductType](../internal/classes/internal.ProductType.mdx)[]", "description": "The details of the product types that belong to this tax rate.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "products", "type": "[Product](../internal/classes/internal.Product.mdx)[]", "description": "The details of the products that belong to this tax rate.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "rate", "type": "``null`` \\| `number`", "description": "The numeric rate to charge", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "region", "type": "[Region](../internal/classes/internal.Region.mdx)", "description": "The details of the region that the rate belongs to.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "region_id", "type": "`string`", "description": "The ID of the region that the rate belongs to.", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "shipping_option_count", "type": "`number`", "description": "The count of shipping options", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "shipping_options", "type": "[ShippingOption](../internal/classes/internal.ShippingOption.mdx)[]", "description": "The details of the shipping options that belong to this tax rate.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "updated_at", "type": "`Date`", "description": "The date with timezone at which the resource was updated.", "optional": false, "defaultValue": "", "expandable": false, "children": [] } ] } ] } ] } ]} /> ___ ### addShippingOptions Add shipping options to a tax rate. #### Example ```ts import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token medusa.admin.taxRates .addShippingOptions(taxRateId, { shipping_options: [shippingOptionId], }) .then(({ tax_rate }) => { console.log(tax_rate.id) }) ``` #### Parameters `", "description": "Custom headers to attach to the request.", "optional": false, "defaultValue": "{}", "expandable": false, "children": [] } ]} /> #### Returns `", "description": "An optional key-value map with additional details", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "name", "type": "`string`", "description": "A human friendly name for the tax", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "product_count", "type": "`number`", "description": "The count of products", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "product_type_count", "type": "`number`", "description": "The count of product types", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "product_types", "type": "[ProductType](../internal/classes/internal.ProductType.mdx)[]", "description": "The details of the product types that belong to this tax rate.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "products", "type": "[Product](../internal/classes/internal.Product.mdx)[]", "description": "The details of the products that belong to this tax rate.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "rate", "type": "``null`` \\| `number`", "description": "The numeric rate to charge", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "region", "type": "[Region](../internal/classes/internal.Region.mdx)", "description": "The details of the region that the rate belongs to.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "region_id", "type": "`string`", "description": "The ID of the region that the rate belongs to.", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "shipping_option_count", "type": "`number`", "description": "The count of shipping options", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "shipping_options", "type": "[ShippingOption](../internal/classes/internal.ShippingOption.mdx)[]", "description": "The details of the shipping options that belong to this tax rate.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "updated_at", "type": "`Date`", "description": "The date with timezone at which the resource was updated.", "optional": false, "defaultValue": "", "expandable": false, "children": [] } ] } ] } ] } ]} /> ___ ### create Create a tax rate. #### Example ```ts import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token medusa.admin.taxRates .create({ code: "TEST", name: "New Tax Rate", region_id, }) .then(({ tax_rate }) => { console.log(tax_rate.id) }) ``` #### Parameters `", "description": "Custom headers to attach to the request.", "optional": false, "defaultValue": "{}", "expandable": false, "children": [] } ]} /> #### Returns `", "description": "An optional key-value map with additional details", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "name", "type": "`string`", "description": "A human friendly name for the tax", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "product_count", "type": "`number`", "description": "The count of products", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "product_type_count", "type": "`number`", "description": "The count of product types", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "product_types", "type": "[ProductType](../internal/classes/internal.ProductType.mdx)[]", "description": "The details of the product types that belong to this tax rate.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "products", "type": "[Product](../internal/classes/internal.Product.mdx)[]", "description": "The details of the products that belong to this tax rate.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "rate", "type": "``null`` \\| `number`", "description": "The numeric rate to charge", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "region", "type": "[Region](../internal/classes/internal.Region.mdx)", "description": "The details of the region that the rate belongs to.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "region_id", "type": "`string`", "description": "The ID of the region that the rate belongs to.", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "shipping_option_count", "type": "`number`", "description": "The count of shipping options", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "shipping_options", "type": "[ShippingOption](../internal/classes/internal.ShippingOption.mdx)[]", "description": "The details of the shipping options that belong to this tax rate.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "updated_at", "type": "`Date`", "description": "The date with timezone at which the resource was updated.", "optional": false, "defaultValue": "", "expandable": false, "children": [] } ] } ] } ] } ]} /> ___ ### delete Delete a tax rate. Resources associated with the tax rate, such as products or product types, are not deleted. #### Example ```ts import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token medusa.admin.taxRates.delete(taxRateId).then(({ id, object, deleted }) => { console.log(id) }) ``` #### Parameters `", "description": "Custom headers to attach to the request.", "optional": false, "defaultValue": "{}", "expandable": false, "children": [] } ]} /> #### Returns ___ ### list Retrieve a list of tax rates. The tax rates can be filtered by fields such as `name` or `rate` passed in the `query` parameter. The tax rates can also be paginated. #### Example To list tax rates: ```ts import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token medusa.admin.taxRates.list().then(({ tax_rates, limit, offset, count }) => { console.log(tax_rates.length) }) ``` To specify relations that should be retrieved within the tax rates: ```ts import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token medusa.admin.taxRates .list({ expand: "shipping_options", }) .then(({ tax_rates, limit, offset, count }) => { console.log(tax_rates.length) }) ``` By default, only the first `50` records are retrieved. You can control pagination by specifying the `limit` and `offset` properties: ```ts import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token medusa.admin.taxRates .list({ expand: "shipping_options", limit, offset, }) .then(({ tax_rates, limit, offset, count }) => { console.log(tax_rates.length) }) ``` #### Parameters `", "description": "Custom headers to attach to the request.", "optional": false, "defaultValue": "{}", "expandable": false, "children": [] } ]} /> #### Returns `", "description": "An optional key-value map with additional details", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "name", "type": "`string`", "description": "A human friendly name for the tax", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "product_count", "type": "`number`", "description": "The count of products", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "product_type_count", "type": "`number`", "description": "The count of product types", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "product_types", "type": "[ProductType](../internal/classes/internal.ProductType.mdx)[]", "description": "The details of the product types that belong to this tax rate.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "products", "type": "[Product](../internal/classes/internal.Product.mdx)[]", "description": "The details of the products that belong to this tax rate.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "rate", "type": "``null`` \\| `number`", "description": "The numeric rate to charge", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "region", "type": "[Region](../internal/classes/internal.Region.mdx)", "description": "The details of the region that the rate belongs to.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "region_id", "type": "`string`", "description": "The ID of the region that the rate belongs to.", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "shipping_option_count", "type": "`number`", "description": "The count of shipping options", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "shipping_options", "type": "[ShippingOption](../internal/classes/internal.ShippingOption.mdx)[]", "description": "The details of the shipping options that belong to this tax rate.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "updated_at", "type": "`Date`", "description": "The date with timezone at which the resource was updated.", "optional": false, "defaultValue": "", "expandable": false, "children": [] } ] } ] } ] } ]} /> ___ ### removeProductTypes Remove product types from a tax rate. This only removes the association between the product types and the tax rate. It does not delete the product types. #### Example ```ts import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token medusa.admin.taxRates .removeProductTypes(taxRateId, { product_types: [productTypeId], }) .then(({ tax_rate }) => { console.log(tax_rate.id) }) ``` #### Parameters `", "description": "Custom headers to attach to the request.", "optional": false, "defaultValue": "{}", "expandable": false, "children": [] } ]} /> #### Returns `", "description": "An optional key-value map with additional details", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "name", "type": "`string`", "description": "A human friendly name for the tax", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "product_count", "type": "`number`", "description": "The count of products", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "product_type_count", "type": "`number`", "description": "The count of product types", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "product_types", "type": "[ProductType](../internal/classes/internal.ProductType.mdx)[]", "description": "The details of the product types that belong to this tax rate.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "products", "type": "[Product](../internal/classes/internal.Product.mdx)[]", "description": "The details of the products that belong to this tax rate.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "rate", "type": "``null`` \\| `number`", "description": "The numeric rate to charge", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "region", "type": "[Region](../internal/classes/internal.Region.mdx)", "description": "The details of the region that the rate belongs to.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "region_id", "type": "`string`", "description": "The ID of the region that the rate belongs to.", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "shipping_option_count", "type": "`number`", "description": "The count of shipping options", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "shipping_options", "type": "[ShippingOption](../internal/classes/internal.ShippingOption.mdx)[]", "description": "The details of the shipping options that belong to this tax rate.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "updated_at", "type": "`Date`", "description": "The date with timezone at which the resource was updated.", "optional": false, "defaultValue": "", "expandable": false, "children": [] } ] } ] } ] } ]} /> ___ ### removeProducts Remove products from a tax rate. This only removes the association between the products and the tax rate. It does not delete the products. #### Example ```ts import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token medusa.admin.taxRates .removeProducts(taxRateId, { products: [productId], }) .then(({ tax_rate }) => { console.log(tax_rate.id) }) ``` #### Parameters `", "description": "Custom headers to attach to the request.", "optional": false, "defaultValue": "{}", "expandable": false, "children": [] } ]} /> #### Returns `", "description": "An optional key-value map with additional details", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "name", "type": "`string`", "description": "A human friendly name for the tax", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "product_count", "type": "`number`", "description": "The count of products", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "product_type_count", "type": "`number`", "description": "The count of product types", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "product_types", "type": "[ProductType](../internal/classes/internal.ProductType.mdx)[]", "description": "The details of the product types that belong to this tax rate.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "products", "type": "[Product](../internal/classes/internal.Product.mdx)[]", "description": "The details of the products that belong to this tax rate.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "rate", "type": "``null`` \\| `number`", "description": "The numeric rate to charge", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "region", "type": "[Region](../internal/classes/internal.Region.mdx)", "description": "The details of the region that the rate belongs to.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "region_id", "type": "`string`", "description": "The ID of the region that the rate belongs to.", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "shipping_option_count", "type": "`number`", "description": "The count of shipping options", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "shipping_options", "type": "[ShippingOption](../internal/classes/internal.ShippingOption.mdx)[]", "description": "The details of the shipping options that belong to this tax rate.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "updated_at", "type": "`Date`", "description": "The date with timezone at which the resource was updated.", "optional": false, "defaultValue": "", "expandable": false, "children": [] } ] } ] } ] } ]} /> ___ ### removeShippingOptions Remove shipping options from a tax rate. This only removes the association between the shipping options and the tax rate. It does not delete the shipping options. #### Example ```ts import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token medusa.admin.taxRates .removeShippingOptions(taxRateId, { shipping_options: [shippingOptionId], }) .then(({ tax_rate }) => { console.log(tax_rate.id) }) ``` #### Parameters `", "description": "Custom headers to attach to the request.", "optional": false, "defaultValue": "{}", "expandable": false, "children": [] } ]} /> #### Returns `", "description": "An optional key-value map with additional details", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "name", "type": "`string`", "description": "A human friendly name for the tax", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "product_count", "type": "`number`", "description": "The count of products", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "product_type_count", "type": "`number`", "description": "The count of product types", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "product_types", "type": "[ProductType](../internal/classes/internal.ProductType.mdx)[]", "description": "The details of the product types that belong to this tax rate.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "products", "type": "[Product](../internal/classes/internal.Product.mdx)[]", "description": "The details of the products that belong to this tax rate.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "rate", "type": "``null`` \\| `number`", "description": "The numeric rate to charge", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "region", "type": "[Region](../internal/classes/internal.Region.mdx)", "description": "The details of the region that the rate belongs to.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "region_id", "type": "`string`", "description": "The ID of the region that the rate belongs to.", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "shipping_option_count", "type": "`number`", "description": "The count of shipping options", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "shipping_options", "type": "[ShippingOption](../internal/classes/internal.ShippingOption.mdx)[]", "description": "The details of the shipping options that belong to this tax rate.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "updated_at", "type": "`Date`", "description": "The date with timezone at which the resource was updated.", "optional": false, "defaultValue": "", "expandable": false, "children": [] } ] } ] } ] } ]} /> ___ ### retrieve Retrieve a tax rate's details. #### Example A simple example that retrieves a tax rate by its ID: ```ts import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token medusa.admin.taxRates.retrieve(taxRateId).then(({ tax_rate }) => { console.log(tax_rate.id) }) ``` To specify relations that should be retrieved: ```ts import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token medusa.admin.taxRates .retrieve(taxRateId, { expand: "shipping_options", }) .then(({ tax_rate }) => { console.log(tax_rate.id) }) ``` #### Parameters `", "description": "Custom headers to attach to the request.", "optional": false, "defaultValue": "{}", "expandable": false, "children": [] } ]} /> #### Returns `", "description": "An optional key-value map with additional details", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "name", "type": "`string`", "description": "A human friendly name for the tax", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "product_count", "type": "`number`", "description": "The count of products", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "product_type_count", "type": "`number`", "description": "The count of product types", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "product_types", "type": "[ProductType](../internal/classes/internal.ProductType.mdx)[]", "description": "The details of the product types that belong to this tax rate.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "products", "type": "[Product](../internal/classes/internal.Product.mdx)[]", "description": "The details of the products that belong to this tax rate.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "rate", "type": "``null`` \\| `number`", "description": "The numeric rate to charge", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "region", "type": "[Region](../internal/classes/internal.Region.mdx)", "description": "The details of the region that the rate belongs to.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "region_id", "type": "`string`", "description": "The ID of the region that the rate belongs to.", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "shipping_option_count", "type": "`number`", "description": "The count of shipping options", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "shipping_options", "type": "[ShippingOption](../internal/classes/internal.ShippingOption.mdx)[]", "description": "The details of the shipping options that belong to this tax rate.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "updated_at", "type": "`Date`", "description": "The date with timezone at which the resource was updated.", "optional": false, "defaultValue": "", "expandable": false, "children": [] } ] } ] } ] } ]} /> ___ ### update Update a tax rate's details. #### Example ```ts import Medusa from "@medusajs/medusa-js" const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 }) // must be previously logged in or use api token medusa.admin.taxRates .update(taxRateId, { name: "New Tax Rate", }) .then(({ tax_rate }) => { console.log(tax_rate.id) }) ``` #### Parameters `", "description": "Custom headers to attach to the request.", "optional": false, "defaultValue": "{}", "expandable": false, "children": [] } ]} /> #### Returns `", "description": "An optional key-value map with additional details", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "name", "type": "`string`", "description": "A human friendly name for the tax", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "product_count", "type": "`number`", "description": "The count of products", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "product_type_count", "type": "`number`", "description": "The count of product types", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "product_types", "type": "[ProductType](../internal/classes/internal.ProductType.mdx)[]", "description": "The details of the product types that belong to this tax rate.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "products", "type": "[Product](../internal/classes/internal.Product.mdx)[]", "description": "The details of the products that belong to this tax rate.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "rate", "type": "``null`` \\| `number`", "description": "The numeric rate to charge", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "region", "type": "[Region](../internal/classes/internal.Region.mdx)", "description": "The details of the region that the rate belongs to.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "region_id", "type": "`string`", "description": "The ID of the region that the rate belongs to.", "optional": false, "defaultValue": "", "expandable": false, "children": [] }, { "name": "shipping_option_count", "type": "`number`", "description": "The count of shipping options", "optional": true, "defaultValue": "", "expandable": false, "children": [] }, { "name": "shipping_options", "type": "[ShippingOption](../internal/classes/internal.ShippingOption.mdx)[]", "description": "The details of the shipping options that belong to this tax rate.", "optional": false, "defaultValue": "", "expandable": true, "children": [] }, { "name": "updated_at", "type": "`Date`", "description": "The date with timezone at which the resource was updated.", "optional": false, "defaultValue": "", "expandable": false, "children": [] } ] } ] } ] } ]} />