How it works

Follow these 7 simple steps to start updating B2B company tax exemptions from customer tags automatically

Shopify logo icon

Customer Tags Changed

App connector: Shopify • Time to complete: 0 minutes (Auto-configured)
Why this matters: This trigger captures customer tag modifications, enabling tax exemption management through tags rather than manual company location updates in Shopify Plus admin, streamlining B2B tax compliance workflows.

When customer tags are updated in Shopify (tags added, removed, or modified through admin, API, or apps), this trigger activates the workflow and captures the customer ID and complete current tag list. The includeFields parameter limits the trigger to only fire when tags actually change (not on every customer update), improving efficiency. No configuration is required—it's pre-connected to your Shopify store and monitors tag changes automatically.

Use case: B2B merchants can tag customers with specific tax exemption codes (like "CA_BC_COMMERCIAL_FISHERY_EXEMPTION" for British Columbia commercial fishing exemptions) and have those exemptions automatically apply to all company locations associated with that customer.

Grab Exemption Tags

App connector: Code • Time to complete: 0 minutes (Auto-configured)
Why this matters: Filters the customer's complete tag list to identify only tags formatted as official tax exemptions, preventing non-exemption tags from being processed and ensuring only valid exemption codes are applied to company locations.

This custom JavaScript step processes the customer's tag list to extract tax exemption tags.

Tag format requirement: Exemption tags must follow Shopify's tax exemption naming convention and contain the word "EXEMPTION" (like CA_BC_COMMERCIAL_FISHERY_EXEMPTION, CA_BC_CONTRACTOR_EXEMPTION, US_CA_RESELLER_EXEMPTION). The code splits the comma-separated tags, trims whitespace, checks each tag for the string "EXEMPTION", and returns an array of matching exemption tags.

// Splits tags, trims whitespace
let tags = vars.shopify.tags.split(',').map(element => element.trim());
// Filters to only tags containing "EXEMPTION"
for (let tag of tags) {
  if (tag.includes('EXEMPTION')) {
    exemptionTags.push({"tag": tag})
  }
}

The filtered exemption tags are returned as an array where each element contains a tag property ready for processing.

Loop Over Exemption Tags

App connector: Loop • Time to complete: 0 minutes (Auto-configured)
Why this matters: Processes each identified tax exemption tag individually, enabling application of multiple exemptions to the customer's company locations when customers qualify for several tax-exempt categories.

This loop iterates through the array of exemption tags from the previous step. For each exemption tag, the loop executes the subsequent company location retrieval and update steps. This ensures that if a customer has multiple exemption tags (like both CA_BC_COMMERCIAL_FISHERY_EXEMPTION and CA_BC_CONTRACTOR_EXEMPTION), all exemptions are properly applied to their company locations.

Get Locations Customer Is Assigned To

App connector: Code • Time to complete: 0 minutes (Auto-configured)
Why this matters: Retrieves all company locations where this customer is assigned in Shopify's B2B structure, identifying which locations need the tax exemption applied to ensure comprehensive coverage across the customer's business relationship.

This custom JavaScript step queries Shopify's B2B system to find company locations associated with the customer using the customer ID. In Shopify Plus B2B, customers can be assigned to multiple company locations (different business addresses, warehouses, branches), and tax exemptions need to apply across all relevant locations. The code uses ShopifyUtil.companyLocationsForCustomer to retrieve the location list and returns an array of company location objects.

B2B context: A single customer might be associated with multiple company locations if they represent a business with several branches or shipping addresses. Each location may need the same tax exemptions applied.

Loop Over Company Locations

App connector: Loop • Time to complete: 0 minutes (Auto-configured)
Why this matters: Processes each company location individually, ensuring the tax exemption is applied to every location where the customer is assigned rather than just one location.

This loop iterates through the array of company locations from the previous step. For each location, the loop executes the location retrieval and tax exemption update steps using the company location ID. This nested loop structure (outer loop for exemption tags, inner loop for locations) ensures every exemption is applied to every relevant location.

Retrieve Company Location

App connector: Shopify Plus • Time to complete: 0 minutes (Auto-configured)
Why this matters: Fetches complete company location details needed for the tax exemption update operation, ensuring the workflow has all necessary context and data about the location before modifying its tax status.

This step retrieves the full company location record from Shopify Plus using the company location ID from the loop. It returns complete location information including current tax exemption status, location details, and associated company data. This information is used in the subsequent update step to properly apply the tax exemption.

Shopify Plus requirement: This step uses Shopify Plus B2B features. The workflow requires a Shopify Plus account with B2B capabilities enabled.

code icon

Update Location's Tax Exempt Status

App connector: Code • Time to complete: 0 minutes (Auto-configured)
Why this matters: Applies the tax exemption to the company location using Shopify's official tax exemption system, ensuring orders from this location process with correct tax calculations and maintaining tax compliance for B2B transactions.

This custom JavaScript step updates the company location's tax exemption status. The code uses ShopifyUtil.assignTaxExemptStatusToLocation with the company location ID and the exemption tag to apply the exemption through Shopify's GraphQL API. This updates the location's tax configuration so that orders placed by contacts at this location receive appropriate tax exemptions based on the assigned exemption codes.

Tax exemption application: Shopify maintains a list of valid tax exemption codes for different regions and exemption types. When applied to a company location, these exemptions automatically affect tax calculations during checkout for orders associated with that location.

Make it your own

Customize this workflow even further:

Add tag validation
Enhance the exemption tag filtering to validate tags against a list of known valid exemption codes for your regions, preventing typos or invalid exemption tags from being processed.
Log exemption changes
Add a Google Sheets or database step that records each exemption application with timestamp, customer name, location, and exemption code for audit trails and compliance reporting.
Send notification on exemption changes
Add Slack or email steps that notify your accounting or compliance team when tax exemptions are applied, providing visibility into tax status changes for B2B customers.
Sync exemptions to external systems
Add steps that send exemption data to your ERP, accounting software, or tax compliance platform, maintaining synchronized tax exemption records across business systems.

Frequently asked questions

What tax exemption codes are valid for my region?
Valid exemption codes depend on your business location and the jurisdictions where you operate. Refer to Shopify's tax exemption documentation for your region or consult your tax advisor. Exemption codes follow formats like CA_BC_COMMERCIAL_FISHERY_EXEMPTION (Canadian provincial exemptions) or US_CA_RESELLER_EXEMPTION (US state exemptions).
Can I remove exemptions by removing tags?
This workflow only applies exemptions when tags are added. To remove exemptions, you'd need to create a companion workflow that detects tag removal and calls Shopify's API to remove the corresponding exemption from company locations.
Does this work for standard (non-B2B) customers?
No, this workflow is specifically for Shopify Plus B2B customers with company locations. Standard customers don't have company location associations, so the location retrieval step would return no results. For standard customer tax exemptions, you'd need a different approach.
What is a template?
MESA templates are fully pre-configured workflows built and vetted by Shopify Experts. Unlike competitor templates that provide basic scaffolds requiring extensive setup, MESA templates come with all data variables properly mapped, required fields configured, and steps ready to activate. You can turn them on immediately and start automating.
Can I customize a template?
Absolutely! While our templates work out-of-the-box, every step can be personalized to match your exact business requirements. Add conditional logic, integrate additional apps, or build more sophisticated workflows. MESA's templates provide a solid foundation that you can expand as needed.
Are templates free?
Yes! Our entire library of expert-built, production-ready templates is free to use. Unlike platforms that charge for premium templates or provide only basic scaffolds, MESA gives you access to hundreds of fully-configured, vetted workflows at no additional cost.

Ready to start updating B2B company tax exemptions from customer tags automatically?

Join thousands who've automated their work and saved an average of 3.5 hours every week.

Start with this template — It's free
7-day free trial • 7 min setup • Cancel anytime