Starting with GraphQL Admin API version 2027-01, you can assign a category from Shopify's Standard Product Taxonomy to custom line items in draft orders and order edits. The category controls the item's tax treatment in the same way it does for products.
For stores using Managed Taxes, the product category is the only input that sets a custom line item's tax treatment.
What's new
You can now set and read product categories on custom line items in draft orders and order edits:
Draft orders
sets the product category of a custom line item. You can use it with,and. It's ignored whenis provided.andreturn the category of a custom line item. They returnnullfor product variant line items.
Order edits
accepts a newargument.returns the category of the calculated line item.
If doesn't match a category in the current taxonomy, the mutation returns a user error.
How the category affects tax
| Store | Tax treatment of a custom line item |
|---|---|
| Uses Managed Taxes | Set by . The taxable input is ignored. A custom line item with no category is treated as Uncategorized and taxed at the standard rate. |
| All other stores | taxable: false means the item isn't taxed. When the item is taxed, Shopify uses its category to calculate tax. |
The taxable input on custom line items is deprecated in favour of . For details, see taxable on custom line items is deprecated.
Why this matters
A yes-or-no taxable flag can't express reduced rates or category-specific exemptions, and it doesn't record why an item was taxed or exempted. A product category lets tax calculation apply the right rules to a custom line item and records the reason for the tax treatment.
How to use it
- Look up a category ID with the
taxonomyquery:
query {
taxonomy {
categories(search: "t-shirts", first: 5) {
nodes {
id
fullName
}
}
}
}
- Pass the ID as
on a custom line item in,,, or. - Read the saved category from
on,, or.