Files
medusa-store/www/apps/docs/content/references/services/classes/TaxRate.mdx
T
github-actions[bot] 39649b3552 chore(docs): Generated References (#5602)
Generated the following references:
- `pricing`
- `product`

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
2023-11-10 17:31:02 +00:00

180 lines
4.0 KiB
Plaintext

---
displayed_sidebar: servicesSidebar
---
import ParameterTypes from "@site/src/components/ParameterTypes"
# TaxRate
A Tax Rate can be used to define a custom rate to charge on specified products, product types, and shipping options within a given region.
## Constructors
### constructor
**new TaxRate**()
A Tax Rate can be used to define a custom rate to charge on specified products, product types, and shipping options within a given region.
## Properties
<ParameterTypes parameters={[
{
"name": "code",
"type": "``null`` \\| `string`",
"description": "A code to identify the tax type by",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "created_at",
"type": "`Date`",
"description": "The date with timezone at which the resource was created.",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "id",
"type": "`string`",
"description": "The tax rate's ID",
"optional": false,
"defaultValue": "",
"expandable": false,
"children": []
},
{
"name": "metadata",
"type": "Record<`string`, `unknown`\\>",
"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`](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`](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`](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`](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": []
}
]} />
## Methods
### beforeInsert
`Private` **beforeInsert**(): `void`
#### Returns
`void`
<ParameterTypes parameters={[
{
"name": "void",
"type": "`void`",
"optional": true,
"defaultValue": "",
"description": "",
"expandable": false,
"children": []
}
]} />