Skip to main content

Links between Tax Code Module and Other Modules

This document showcases the module links defined between the Tax Code Module and other Commerce Modules.

Summary

The Tax Code Module has the following links to other modules:
First Data ModelSecond Data ModelTypeDescription
ProductCategoryTaxCodeStored - many-to-oneAssociates product categories with tax codes for tax classification

Product Module

Mercur defines a link between the Product Module’s ProductCategory data model and the Tax Code Module’s TaxCode data model. This allows product categories to be associated with specific tax codes for proper tax calculation and compliance.

Retrieve with Query

To retrieve the tax code of a product category with Query, pass tax_code.* in fields:
const { data: categories } = await query.graph({
  entity: "product_category",
  fields: [
    "*",
    "tax_code.*",
  ],
})

// categories[0].tax_code
To manage the tax code of a product category, use Link: