How to add custom charges on the order on Shopify checkout?

I want to charge an extra fee based on custom data entered on the checkout. The custom data field is added through Checkout UI extension.

  1. Is there any way to add charges on checkout?

  2. If not, how can I modify the shipping rates to add these extra charges?

Hi @rashmim

Adding custom charges to the checkout on Shopify can be a bit tricky due to Shopify’s restrictions on modifying the checkout process directly unless you’re using Shopify Plus. Here’s a clear breakdown to address your question:

1. Can you add custom charges on checkout?

No, Shopify does not allow direct modifications to the checkout process (like adding extra fees) unless you’re on Shopify Plus. With Shopify Plus, you can use Checkout Scripts to apply custom logic, including adding fees, discounts, or other adjustments.

If you’re not on Shopify Plus, adding charges directly on the checkout page isn’t possible. However, there are alternative ways to achieve a similar outcome.

2. How can you modify shipping rates to add extra charges?

If you can’t directly add charges, you can adjust shipping rates to include the extra fees. Here’s how you can do it:

Option A: Use Shipping Profiles

1-Create a Custom Shipping Profile:

  • Go to Settings > Shipping and Delivery in your Shopify admin.
  • Create a new Shipping Profile for the product(s) requiring the custom fee.

2-Add Custom Shipping Rates:

  • Inside the shipping profile, define a new rate with the added charge. For example, if your shipping costs $10 and the custom fee is $5, create a shipping rate of $15.

3-Label the Shipping Rate Clearly:

  • Make sure to label it in a way that customers understand, e.g., “Standard Shipping + Processing Fee.”

Option B: Adjust Shipping Rates Using Shopify APIs

If the custom fee is dynamic based on data entered in the checkout UI extension:

  1. Use the Shopify Admin API to fetch the custom field data.
  2. Dynamically calculate the total fee, including shipping, and update the available shipping rates accordingly using Carrier Calculated Shipping (available on Shopify Advanced or higher plans).

Here’s a simplified example of using a script for carrier-calculated rates:

{

“carrier_service”: {

“name”: “Custom Fee Service”,

“callback_url”: “https://your-server.com/custom-fee”,

“service_discovery”: true

}

}

On your server, calculate the shipping rates dynamically based on the custom data.

Important Notes:- Checkout UI Extensions: These can collect extra data but cannot directly modify checkout behavior unless paired with Shopify Plus features or external APIs.

  • Communication: Always be transparent with customers. Add clear messaging on the cart or product page to explain the extra fees.

If you’re unsure about setting this up, apps like Advanced Shipping Rules or Custom Shipping Rates by Intuitive Shipping can help you achieve similar results without custom coding.

If you need any other assistance, feel free to reply and I will try my best to respond.
Best regards,
Daisy