Free shipping on initial orders
If you are on Shopify Plus, you can use Shopify Functions to give customers free shipping when they purchase a subscription from your store. This applies to the initial order when a customer checks out with a subscription. You can also set up free shipping for recurring orders from the Flex Incentives page within Ordergroove.
Note that free shipping configured in Ordergroove only applies to recurring subscription orders, not the initial checkout order. See this article for more information about subscription shipping and delivery for Shopify.
Looking for the legacy Shopify Scripts version?
If you are maintaining an existing implementation or migrating from Shopify Scripts, you can still access the original Scripts-based guide here. Please note that Scripts will stop functioning on June 30, 2026.
Requirements
Shopify Functions require a custom app or a paid app from the Shopify App Store. Custom apps can only be made by Shopify Partners — this guide is intended for developers working with Shopify clients.
Instructions
Shopify Functions allow developers to customize the backend logic of Shopify. Functions are continually being updated, so it is best to first reference Shopify’s official documentation.
At a high level:
- App developers create and deploy apps that contain functions.
- Merchants install the app on their Shopify store and configure the function via an API call.
- Customers interact with the Shopify store and Shopify executes the function.
You can use Shopify apps to generate functions, or create your own for complete control. For free shipping on initial subscription orders you will need a Delivery Discount Function.
Read the full documentation on creating a Shopify Discount Function.
The following is a quick start guide for creating a basic Delivery Discount Function app that provides free shipping on subscription orders. This can be combined with the Initial Offer Incentive (IOI) Product Discount Function.
Note: This guide is accurate as of Shopify Function API version 2026-01.
-
Use Shopify CLI version 3.69.4+
-
Use Node version 22.9.9+
-
Navigate to a local directory where you want to create the app
-
Run
shopify app initto create an app:- Select Build an extension-only app
- Select Yes, create it as a new app
- Name your app (e.g.
ordergroove-discount) - The app will now appear in your Shopify Partner Dashboard
-
Run
cd ordergroove-discount -
Run
shopify app generate extension:- Select the extension to create
- Name your extension
- Select a language (the example code below assumes JavaScript)
-
Edit
ordergroove-discount/src/cart_delivery_options_discounts_generate_run.graphql— replace the full file with: -
Edit
ordergroove-discount/src/cart_delivery_options_discounts_generate_run.js— replace the full file with: -
Run
shopify app deploy
Further Customizations
For further customizations, see Shopify’s documentation on the Functions API. You’ll find great examples of building Functions that you can adapt for your subscription program.