App reviews, troubleshooting, and recommendations
We are developing an app that creates products by API and we are trying to determine how we calculate the correct price for the product depending on the merchant's tax settings.
We are always creating products with this API operation: https://shopify.dev/docs/api/admin-graphql/2024-04/mutations/productCreate
We then add variants (with a price) using this API operation: https://shopify.dev/docs/api/admin-graphql/2024-04/mutations/productVariantsBulkCreate
In the Shopify guide: https://help.shopify.com/en/manual/taxes/location#include-taxes-in-product-prices, they include the following instructions.
This means we can have 2 types of store:
Store Tax Exclusive
If we start with the exclusive store, we can simply create a product with a price of $1000.
As we have unchecked the global setting and setup a region to collect tax in.
The tax is automatically calculated at the checkout and added to the total price.
Store Tax Inclusive
Now the global setting to include taxes is checked (as this is expected in some areas such as UK/France)
The tax component is still calculated automatically and displayed below.
However, the total price has now been reduced.
We would still want the total price of $1,122.33 - Does this mean we need to calculate that price when we create the product via the API?
It looks like this might be possible by checking if taxes are included: https://shopify.dev/docs/api/admin-graphql/2024-07/objects/Shop#field-taxesincluded
But it doesn't seem like there is a way to query the home tax rate of the store - so how would we know what tax component to add?
We did find this: https://shopify.dev/docs/api/admin-graphql/2024-07/objects/TaxLine#field-rate - but it appears that this would only be available as a dynamic rate calculated for draft orders or actual orders as opposed to a static field we could check.
https://shopify.dev/docs/api/admin-graphql/2024-07/mutations/draftOrderCalculate
We found that we might be able to use draftOrderCalculate - but this would still require a product variant to exist ahead of time
We could either create a product that we always use to verify these tax rates against - or perform this check for all newly created products and then update the price as required
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025