Back to Medusa

TaxCalculationContext

www/apps/resources/references/tax/interfaces/tax.TaxCalculationContext/page.mdx

2.14.23.5 KB
Original Source

import { TypeList } from "docs-ui"

TaxCalculationContext

The context provided when tax lines are calculated and retrieved. This context is later passed to the underlying tax provider.

<TypeList types={[{"name":"address","type":"object","description":"The customer's address","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"country_code","type":"string","description":"The ISO 2 character currency code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"province_code","type":"null \| string","description":"The lower-case ISO 3166-2 province or state code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"string","description":"The first line of the address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"null \| string","description":"The second line of the address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"string","description":"The city.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"string","description":"The postal code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"null \| Record<string, unknown>","description":"Address metadata.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"locale","type":"string","description":"The locale of the tax calculation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer","type":"object","description":"The customer's details.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"string","description":"The ID of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"string","description":"The email of the customer.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_groups","type":"string[]","description":"The groups that the customer belongs to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"null \| Record<string, unknown>","description":"Customer metadata.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"is_return","type":"boolean","description":"Whether the tax lines are calculated for an order return.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"object[]","description":"The shipping method details.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"string","description":"The associated shipping method's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"string","description":"The name of the shipping method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_option_id","type":"string","description":"The associated shipping options's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"number","description":"The amount of the shipping method.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="TaxCalculationContext"/>