Custom Tax
Merchant-defined tax rules: a rate per set of countries (regions for US and CA) with product groups that override it. Rates are fractions, like tax_rate on orders and invoices (0.105 is 10.5 %).
- GET/custom_taxes
- POST/custom_taxes
- GET/custom_taxes/{custom_tax_id}
- PATCH/custom_taxes/{custom_tax_id}
- DELETE/custom_taxes/{custom_tax_id}
- POST/custom_taxes/{custom_tax_id}/publish
- POST/custom_taxes/{custom_tax_id}/unpublish
- GET/custom_taxes/{custom_tax_id}/groups
- POST/custom_taxes/{custom_tax_id}/groups
- GET/custom_taxes/{custom_tax_id}/groups/{group_id}
- PATCH/custom_taxes/{custom_tax_id}/groups/{group_id}
- DELETE/custom_taxes/{custom_tax_id}/groups/{group_id}
A paginated list of the shop's custom taxes (drafts and published, deleted ones excluded). Countries and groups are always embedded.
Query parameters
ids[]optionalinteger[]Filter by custom tax IDs. Values must be unique.
queryoptionalstringSearch by name
publishedoptionalintegerFilter by published state (0 or 1)
Possible values: 0, 1.
country_idoptionalintegerOnly taxes that cover this country (a country ID from GET /countries)
region_idoptionalintegerOnly taxes that cover this US state or Canadian province (a region ID from GET /countries)
product_idoptionalintegerOnly taxes with a group that holds this plan or variant. Plan or variant ID, not the parent product ID.
sort[field]optionalstringSort field. Without sort the list is newest first (id desc), with it the direction defaults to asc and id breaks ties
Possible values: id, name, created_at.
sort[direction]optionalstringSort direction; defaults to asc.
Possible values: asc, desc.
pageoptionalintegerPage number
per_pageoptionalintegerItems per page (1-100, default 10)
Returnsobject
Custom taxes list response
Error responses
422objectA query parameter is invalid: a wrong type, a repeated ID, a value outside its enum or range, an unknown country or region, or sort without sort[field]. errors lists the messages per parameter.
Creates a draft tax with its countries; publish it with POST /custom_taxes/{custom_tax_id}/publish. Product groups are created separately with POST /custom_taxes/{custom_tax_id}/groups.
Request body
nameRequiredstringdefault_rateRequirednumberRate applied to products outside every group, as a fraction (0.0825 is 8.25 %).
shipping_rateRequirednumberRate applied to shipping lines, as a fraction.
countriesRequiredobjectThe countries of the tax, as { create: [...] }.
ReturnsCustomTax
Custom tax object response
Error responses
422objectA field is missing or invalid: an invalid rate, a malformed countries set, an unknown country or region, regions that do not fit the country, or a country or region another tax of the shop already covers. errors lists the messages per field.
Path parameters
custom_tax_idRequiredintegerCustom tax ID
ReturnsCustomTax
Custom tax object response
Error responses
404objectNo custom tax exists with this ID in the shop, or it was deleted.
Partial update: only the keys present in the body are applied. countries is a { create, update, delete } change set keyed by country ID; a US or CA entry carries its own regions change set. published changes only through the publish and unpublish endpoints.
Path parameters
custom_tax_idRequiredintegerCustom tax ID
Request body
nameoptionalstringdefault_rateoptionalnumberRate applied to products outside every group, as a fraction.
shipping_rateoptionalnumberRate applied to shipping lines, as a fraction.
countriesoptionalCustomTaxCountriesChangeSetCountries keyed by country id: create countries must not be on the tax yet, update and delete countries must be, an id may appear in only one of create, update and delete, and at least one country must remain.
ReturnsCustomTax
Custom tax object response
Error responses
404objectNo custom tax exists with this ID in the shop, or it was deleted.
422objectA field fails the create rules, or a change set is malformed, lists an ID in two operations, creates an entry already on the tax, updates or deletes one that is not, or would leave the tax without a country or a US or CA country without a region. errors lists the messages per field.
Delete the tax and its groups, and return the tax as it was. Its countries and regions can then be added to another tax.
Path parameters
custom_tax_idRequiredintegerCustom tax ID
ReturnsCustomTax
The deleted custom tax, serialised as it was just before the delete.
Error responses
404objectNo custom tax exists with this ID in the shop, or it was deleted.
Makes the tax apply at checkout and on renewals. Publishing a published tax answers 200 and changes nothing.
Path parameters
custom_tax_idRequiredintegerCustom tax ID
ReturnsCustomTax
Custom tax object response
Error responses
400objectThe tax stays a draft: the publish is refused with feature_not_available.
404objectNo custom tax exists with this ID in the shop, or it was deleted.
422objectThe tax stays a draft: another tax of the shop already covers one of its countries or regions, or a plan or variant sits in two of its groups. errors lists them under countries and groups.
Stops the tax from applying. Unpublishing an unpublished tax answers 200 and changes nothing.
Path parameters
custom_tax_idRequiredintegerCustom tax ID
ReturnsCustomTax
Custom tax object response
Error responses
404objectNo custom tax exists with this ID in the shop, or it was deleted.
A paginated list of the tax's product groups (deleted ones excluded).
Path parameters
custom_tax_idRequiredintegerCustom tax ID
Query parameters
ids[]optionalinteger[]Filter by group IDs. Values must be unique.
product_idoptionalintegerOnly the group that holds this plan or variant. Plan or variant ID, not the parent product ID.
queryoptionalstringSearch by name
sort[field]optionalstringSort field. Without sort the list is newest first (id desc), with it the direction defaults to asc and id breaks ties
Possible values: id, name, created_at.
sort[direction]optionalstringSort direction; defaults to asc.
Possible values: asc, desc.
pageoptionalintegerPage number
per_pageoptionalintegerItems per page (1-100, default 10)
Returnsobject
Custom tax groups list response
Error responses
404objectNo custom tax exists with this ID in the shop, or it was deleted.
422objectA query parameter is invalid: a wrong type, a repeated ID, a value outside its enum or range, or sort without sort[field]. errors lists the messages per parameter.
Adds a product group to the tax, with or without products. Groups apply as soon as their tax is published.
Path parameters
custom_tax_idRequiredintegerCustom tax ID
Request body
nameRequiredstringrateRequirednumberRate applied to the grouped products instead of the tax default rate, as a fraction.
productsoptionalobjectThe group's plans and variants, as { create: [...] }. A product may sit in one group of the tax only.
ReturnsCustomTaxGroup
Custom tax group object response
Error responses
404objectNo custom tax exists with this ID in the shop, or it was deleted.
422objectA field is missing or invalid: an invalid rate, a malformed products set, or a product that is not a plan or variant of the shop or already sits in another group of the tax. errors lists the messages per field.
Path parameters
custom_tax_idRequiredintegerCustom tax ID
group_idRequiredintegerCustom tax group ID
ReturnsCustomTaxGroup
Custom tax group object response
Error responses
404objectNo custom tax exists with this ID in the shop or the tax is deleted (CustomTax not found with ID: 16), or the tax has no group with this ID.
Partial update: only the keys present in the body are applied. products is a { create, delete } change set keyed by product_id.
Path parameters
custom_tax_idRequiredintegerCustom tax ID
group_idRequiredintegerCustom tax group ID
Request body
nameoptionalstringrateoptionalnumberRate applied to the grouped products instead of the tax default rate, as a fraction.
productsoptionalobjectProducts keyed by product_id: create products must not be in the group yet, delete products must be, and a product may appear in only one of them.
ReturnsCustomTaxGroup
Custom tax group object response
Error responses
404objectNo custom tax exists with this ID in the shop or the tax is deleted (CustomTax not found with ID: 16), or the tax has no group with this ID.
422objectA field fails the create rules, or products is malformed, lists a product in both operations, creates a product already in the group or deletes one that is not. errors lists the messages per field.
Delete the group and return it as it was, with its products. The products can then join another group of the tax.
Path parameters
custom_tax_idRequiredintegerCustom tax ID
group_idRequiredintegerCustom tax group ID
ReturnsCustomTaxGroup
The deleted custom tax group, serialised as it was just before the delete.
Error responses
404objectNo custom tax exists with this ID in the shop or the tax is deleted (CustomTax not found with ID: 16), or the tax has no group with this ID.