Cracking the Code: Adding Custom Surcharges to Shopify Checkout (Beyond the Basics)

Ever found yourself in a tricky spot trying to add a very specific, percentage-based fee directly to your Shopify checkout? You’re not alone. This is a surprisingly common, yet notoriously complex, challenge for many store owners. We recently saw a lively discussion in the Shopify community about just this – how to implement a “surcharge/extra fee/tariff” at checkout without it falling into one of the usual categories like a product, tax, or shipping cost.

Our community member, MER10, laid out a clear set of requirements, and perhaps more importantly, a list of what wouldn’t work for them. They needed a percentage fee added to the order total, displayed clearly in checkout, but absolutely NOT:

  • As a tax product
  • As part of a cart line item
  • As a part of the tax calculation
  • As a part of shipping cost
  • As a catalog override for products
  • On top of the product price (meaning, it's a separate line item on the total)

That's a pretty specific ask, right? It really narrows down the options and highlights why many off-the-shelf solutions might not cut it. The core of MER10's dilemma, and indeed many merchants', is the desire for a distinct fee that functions truly as an "extra fee line item" rather than being disguised as something else.

Why Custom Checkout Fees Are So Tricky on Shopify

The main reason this gets complicated is Shopify’s robust, but somewhat locked-down, checkout process. For security, stability, and conversion optimization, Shopify keeps the checkout experience tightly controlled. Historically, merchants on non-Plus plans couldn't edit the checkout.liquid file, and even for Plus merchants, the landscape has evolved significantly.

Many apps often resort to clever "workarounds," like creating a hidden product in your store that represents the fee and then dynamically adding it to the cart. As MixMigDev pointed out in the thread, an app might use something like cartTransformCreate - GraphQL Admin to inject this "fee product" into the cart. But as MER10 clearly stated, this "add fee as a product" method simply wouldn't fit their needs.

The Essential Requirement: Shopify Plus

Right off the bat, the community agreed on one non-negotiable point: if you want to add custom fees or make significant changes to the checkout flow, you absolutely need to be on Shopify Plus. As Maximus3 repeatedly emphasized, this is the "only solution" for advanced checkout customization. Without Plus, your options are severely limited to pre-checkout solutions or less elegant workarounds.

The Modern Solution: Shopify Functions and Checkout Extensibility

So, if "fee products" are out, and checkout.liquid editing is largely a thing of the past, what's left for Plus merchants? This is where Shopify Functions and the new Checkout Extensibility come into play. OttyAI hit the nail on the head by suggesting a "checkout extension using Shopify Functions" as the "only real option left" for a percentage fee that isn't one of the rejected types.

Maximus3 further clarified this, stating that certain apps (and potentially their own) can add a "fee line item at checkout only." This means it appears once the customer proceeds to checkout, it's not a product, not a cart line item, not part of tax or shipping, and it's calculated on top of the total. This description aligns perfectly with MER10's ideal scenario.

How Shopify Functions Make This Possible

Shopify Functions allow developers to write custom business logic that runs directly on Shopify’s infrastructure. For checkout, this means you can create server-side extensions that modify various aspects of the checkout process, including applying custom discounts, validating cart contents, or, crucially, adding custom line items. These line items can represent surcharges, handling fees, or other specific charges that aren't tied to a product in your catalog.

The beauty of this approach is that these fees are truly "first-class" citizens in the checkout total, clearly distinct and not masquerading as a product. It's the cleanest, most official way to achieve what MER10 was looking for.

Finding (or Building) Your Solution

Given MER10’s strict criteria, the path forward involves a couple of options:

  1. Scrutinize Existing Apps: Maximus3 mentioned apps like Upcharge, Feesly, and Dotstore. If you're on Plus, you'd need to thoroughly investigate these (and others) to confirm they implement the fee as a true "checkout line item" via Shopify Functions, rather than a hidden product. Don't be afraid to reach out to app support with your specific requirements.
  2. Custom Development with Shopify Functions: If no off-the-shelf app perfectly fits your nuanced needs, custom development is likely your best bet. A Shopify Plus development partner can build a bespoke checkout extension using Shopify Functions to create that precise percentage-based, non-product fee line item. This gives you ultimate control over the logic and display.

A Word of Caution: Shopify's Stance on Fees

One important point OttyAI raised is that "Shopify doesn’t love arbitrary fees showing up at checkout." While technically possible with Plus and Functions, it's always wise to consider the customer experience and potential compliance implications. Ensure your fees are transparent, clearly explained, and legally sound for your region and product type. Unexplained or unexpected fees can lead to cart abandonment and erode customer trust.

So, while the initial discussion felt a bit like a stalemate, the consensus is clear: for a truly custom, non-product-based percentage fee in checkout, Shopify Plus and leveraging Shopify Functions through a checkout app or custom extension is the definitive, modern answer. It's not a simple click-and-done for everyone, especially with highly specific requirements like MER10's, but the tools are there for Plus merchants to build exactly what they need, keeping in mind clarity for the customer.

Share:

Use cases

Explore use cases

Agencies, store owners, enterprise — find the migration path that fits.

Explore use cases