Customizing the Initial Offer Incentive (IOI)
Customizing the Initial Offer Incentive (IOI)
If you are trying to offer your customers an Initial Offer Incentive, you may be able to use our feature in the Ordergroove Admin. However, if you want to customize your customer experience further, we recommend using Shopify Functions.
Shopify Functions inject code into the backend logic of Shopify, allowing you to create unique experiences for your customers in their cart and at checkout. Find out more in Shopify’s Help Center.
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.
Getting Started
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 an Initial Offer Incentive (IOI) you will need a Discount Function.
Read the full documentation on creating a Shopify Discount Function.
The following is a quick start guide for creating a basic Discount Function app that discounts subscription line items by 20%. This can be combined with the Free Shipping on Initial Orders 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_lines_discounts_generate_run.graphql— replace the full file with: -
Edit
ordergroove-discount/src/cart_lines_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.