How to use the advanced settings for Shopify codes

This article is only for version 1 of the advanced settings. You can view your version in the title of the settings window as shown in this image:

If you need to specify more advanced settings for generating your discount codes, you can use the Advanced settings dialogue. This allows you to specify all properties available in Shopify's API. This is an advanced setting and requires that you perform tests to make sure that the codes are generated correctly. 

Examples of what you can do

Set a fixed expiry date for generated codes

To override the regular expiry date settings (where you specify the number of hours to expiry), you can add the "ends_at" property to the advanced settings. This property accepts a fixed date when the generated code should expire. Here's an example of this added:

Only allow the discount to work on specific collections, products, or variants

Use the "entitled_collection_ids", "entitled_product_ids", or "entitled_variant_ids" properties to specify one or more collections/products/variants that the discounts will be entitled to. For all three types, you'll need to set the correct target_type and target_selection as shown below.


In this example, we'll use "entitled_collection_ids". To set this property, you enter the collection ID(s): "entitled_collection_ids": [12345] or if you have multiple: "entitled_collection_ids": [12345, 6789]

You can find the collection ID by browsing to the collection in your Shopify admin portal where you can see the collection ID in the URL:

According to the Shopify documentation on this property, you also need to specify "target_type" and "target_selection" if you decide to use "entitled_collection_ids". The three properties you need to change are the following:


"target_type": "line_item",

"target_selection:"entitled",

" entitled_collection_ids": [30365529].

Here's how it would look in the advanced settings:

Require a minimum subtotal on the order

You can use the "prerequisite_subtotal_range" property to set a minimum order value that's required for the discount to be applicable. Here's an example:

"prerequisite_subtotal_range": {
    "greater_than_or_equal_to": "40.0"
}

Still need help? Contact Us Contact Us