Skip to main content

How to Charge Sugar-Sweetened Beverage Taxes (Soda Taxes) on Shopify

Kyle Godon·Published setup

Quick Answer

Several U.S. cities — including Philadelphia, Seattle, and Boulder — impose per-ounce taxes on sugar-sweetened beverages. Rates range from 1 to 2 cents per ounce, and the rules on what's covered vary by city. Shopify doesn't support city-level, per-ounce tax logic at checkout. Magical Fees lets you add the correct soda tax as a separate line item by city, automatically.


What You Need to Know About Soda Taxes

Sweetened beverage taxes are city-level excise taxes on drinks that contain added caloric sweeteners — sodas, energy drinks, sweetened teas, flavored waters, and similar products. There is no federal or state-level soda tax in the U.S.; all current programs are municipal.

The tax is technically on distributors, but it's almost always passed through to retail prices. If you sell sweetened beverages online and deliver to customers in these cities, the tax applies to you.

Current cities and rates

  • Boulder, Colorado — 2¢ per ounce (highest rate in the U.S.)
  • Seattle, Washington — 1.75¢ per ounce
  • Philadelphia, Pennsylvania — 1.5¢ per ounce (uniquely includes artificially sweetened/diet drinks)
  • San Francisco, California — 1¢ per ounce
  • Oakland, California — 1¢ per ounce
  • Berkeley, California — 1¢ per ounce (first U.S. city to enact a soda tax)
  • Albany, California — 1¢ per ounce

What's typically covered

Beverages with 5+ grams of added caloric sweetener per 12 oz. This includes sodas, energy drinks, sports drinks, sweetened teas, and flavored waters. Philadelphia is the exception — it also covers artificially sweetened (diet) beverages.

What's typically exempt

Milk products, 100% fruit juice, infant formula, dietary supplements, and alcoholic beverages.


Why This Is Tricky on Shopify

Soda taxes are per-ounce, city-level, and product-specific. That's three dimensions Shopify's checkout doesn't handle. The workarounds all have problems:

  • Raising prices across the board overcharges customers outside these cities and makes your products look more expensive everywhere.
  • Applying a flat percentage doesn't work because the tax is per-ounce, not a percentage of price. A 12-oz can and a 2-liter bottle have very different tax amounts.
  • Manual calculations are error-prone, especially if you sell multiple sizes to multiple cities.

How to Set Up Soda Taxes With Magical Fees

Magical Fees handles the city-level, per-product logic. Here's the approach.

1. Calculate the tax per product

Since the tax is per-ounce, you need to figure out the total tax per SKU based on its volume. For example:

  • A 12-oz can in Seattle: 12 × $0.0175 = $0.21
  • A 2-liter (67.6 oz) bottle in Seattle: 67.6 × $0.0175 = $1.18
  • A 12-oz can in Boulder: 12 × $0.02 = $0.24

Pre-calculate these amounts for each product size and city combination.

2. Group products by size

In Shopify, tag or collect your sweetened beverage products by size — "12 oz Cans," "20 oz Bottles," "2 Liter Bottles," etc. This gives you clear targets for fee rules.

3. Create fee rules for each city and product size

In Magical Fees, create a fixed-price fee for each city/size combination. Name it clearly — "Seattle Sweetened Beverage Tax (12 oz)" — and set the pre-calculated amount.

Target each rule to the appropriate product collection. Set the calculation to per unit so the tax scales with the number of beverages in the cart.

4. Add city-level location conditions

This is the important part. Add a location condition to each rule targeting the specific city (or zip code range) where the tax applies. Your Seattle rules only fire on Seattle deliveries. Your Boulder rules only fire on Boulder deliveries.

5. Handle Philadelphia's broader scope

Philadelphia's tax uniquely covers both sugar-sweetened and artificially sweetened beverages. If you sell diet drinks, you'll need to include those products in your Philadelphia rules (but not in your rules for other cities).

6. Test with city-specific orders

Place test orders to addresses in affected cities and outside them. Verify the tax appears correctly, matches the calculated amount, and doesn't show up for addresses outside the taxed area.


Common Questions

Is this a tax on distributors or retailers?

Technically, most soda taxes are levied on distributors. But distributors pass the cost to retailers, who pass it to consumers. If you're both the distributor and retailer (selling direct online), the tax applies to you directly.

What if a new city enacts a soda tax?

Add a new set of fee rules for that city. The setup is the same — calculate per-ounce amounts, create rules, add location conditions.

What about the UK Soft Drinks Industry Levy?

The UK imposes a national levy on manufacturers of soft drinks with added sugar (18p/litre for drinks with 5–8g sugar per 100ml, 24p/litre for drinks with 8g+ per 100ml). This is typically absorbed into wholesale pricing before it reaches retail. If you need to separately state it, the same approach works — create percentage or fixed-price rules targeted to UK orders.

Further Reading

Always label deposits separately for compliance

Display bottle deposit fees as a clearly labeled, separate line item at checkout and on receipts. This meets regulatory transparency requirements, builds customer trust by showing exactly what they're paying, and makes it significantly easier to track deposits for reporting and audits. Use a clear label like "Bottle deposit" or "Container deposit (CRV)" so customers immediately understand the charge.

Magical Fees is the only fee app that allows you to apply a fee based on a specific or individual state/province situation. All the other apps we tested only allow 'Location' (the entire country) which is a major limitation. The solution Magical Fees applies during the Cart to Checkout process is very smart and not a hassle. Very easy app to setup and the support was great.

Alameda Soda Co· Shopify App Store

Can't find what you're looking for?

We build custom solutions and love hearing from merchants. Tell us what you need.

Get in touch