Ga naar inhoud

Data reference

Deze inhoud is nog niet vertaald.

Namespace app--284350873601--discount_os. See Read the data in Liquid.

KeyShopify typeHolds
discountslist.metaobject_referenceThe discount entries for this product or collection
max_reward_percentnumber_decimalBest percentage off every shopper gets, or 0
max_reward_centsnumber_integerBest fixed amount off every shopper gets, in minor units, or 0
max_reward_discountmetaobject_referenceThe entry behind the best value. Missing when there is none.

The shop has the same four keys for the whole store, plus:

KeyShopify typeHolds
sync_pausedbooleantrue while Live sync is off
synced_atdate_timeWhen the data was last written

This is the entry DiscountOS writes for a quantity break on a test store: buy 2 for 10% off, buy 3 for 15% off, on one product. It was produced by the app’s own code from the real discount. Fields with no value for this discount are not written, so they are missing here.

The entry’s handle is discount-2139462500662. Product references are shown as the IDs Shopify stores. In Liquid, .value gives you the product objects.

{
"discount_title": "Layer Up Volume Pricing",
"discount_type": "PRODUCT_VOLUME",
"discount_class": "product",
"provenance": "ours",
"method": "automatic",
"discount_id": "2139462500662",
"discount_gid": "gid://shopify/DiscountAutomaticNode/2139462500662",
"schema_version": 2,
"threshold_type": "QUANTITY",
"minimum_threshold_value": 2,
"thresholds": [2, 3],
"threshold_product_references": ["gid://shopify/Product/15397580472630"],
"reward_type": "PERCENTAGE",
"minimum_reward_value": 10,
"maximum_reward_value": 15,
"reward_values": [10, 15],
"reward_product_references": ["gid://shopify/Product/15397580472630"],
"threshold_messages": ["Layer Up Volume Pricing", "Layer Up Volume Pricing"],
"universal": true,
"test": false,
"allow_b2b": true,
"only_b2b": false,
"all_products": false,
"starts_at": "2026-09-28T10:04:00Z",
"ends_at": "2026-09-30T10:25:05Z",
"config": {
"v": 2,
"engine": "v2",
"discount_type_ours": "price-list",
"template": "quantity_break",
"reward_type_ours": "percentage",
"usage": {},
"purchase_type": "one_time",
"configuration": {
"discountValueType": "percentage_off",
"tierBasis": "quantity",
"tierScope": "selected",
"convertCurrency": true,
"priceRules": [
{
"id": "qb0",
"quantity": 2,
"discountValue": 10
},
{
"id": "qb1",
"quantity": 3,
"discountValue": 15
}
]
}
}
}

Step i is “buy thresholds[i], get reward_values[i]% off”. Money fields (none in this entry) are in the smallest unit of the shop currency.

Each entry is a metaobject with the handle discount-<Shopify discount ID>. Fields that do not apply to a discount are left empty, so check for a value before you use one.

FieldTypeHolds
discount_titletextThe title shoppers see
discount_typetextBASIC, PRODUCT_VOLUME (quantity breaks), ORDER_GOAL (spend tiers), BXGY, GWP (free gift), FREE_SHIPPING, SHIPPING, CUSTOM (DiscountOS Custom, Multi-offer and Bundle discounts) or UNKNOWN_APP
discount_classtextWhat it takes money off: product, order, shipping, or mixed for a discount with more than one
provenancetextWho made it: ours (DiscountOS), native (Shopify) or app (another app)
methodtextautomatic or code
codetextThe discount code, for code discounts
tagslist of textThe discount’s tags in Shopify
discount_idtextThe Shopify discount ID (numbers only)
discount_gidtextThe Shopify discount ID in gid:// form
schema_versionintegerThe version of this entry’s shape
FieldTypeHolds
reward_typetextPERCENTAGE, FIXED_AMOUNT (money off) or FIXED_PRICE (a set price)
minimum_reward_valuedecimalThe smallest reward. A percent, or money in minor units.
maximum_reward_valuedecimalThe largest reward. A percent, or money in minor units.
reward_product_referenceslist of productsThe products the reward applies to, when it names products
reward_collection_referenceslist of collectionsThe collections the reward applies to, when it names collections
reward_product_indexesjsonFor a free gift with steps: which of reward_product_references each step gives
currencytextFor a DiscountOS price list limited to one currency: that currency. Otherwise empty, and money is in the shop currency.
FieldTypeHolds
threshold_typetextWhat must be reached: QUANTITY, AMOUNT or NONE
minimum_threshold_valuedecimalThe first threshold. A quantity, or money in minor units.
thresholdslist of integersEvery step’s threshold, lowest first
reward_valueslist of decimalsEvery step’s reward, in the same order
reward_quantitieslist of integersHow many items each step gives, for buy X get Y and gifts
threshold_messageslist of textA short line per step
threshold_product_referenceslist of productsThe products whose quantity or amount counts towards the threshold. For buy X get Y, the “buy” products.
threshold_collection_referenceslist of collectionsThe collections whose products count towards the threshold. For buy X get Y, the “buy” collections.
FieldTypeHolds
universalbooleantrue when every shopper gets it with no condition: automatic, not test mode, not buy X get Y or a free gift, no customer condition, every market, no usage limit, not subscription-only, no location or shipping condition. Only these feed max_reward_percent and max_reward_cents.
testbooleantrue for a DiscountOS discount in test mode
included_customer_tagslist of textThe shopper must have one of these customer tags
excluded_customer_tagslist of textThe shopper must have none of these customer tags
included_marketslist of textMarket handles the discount works in. Empty means every market.
excluded_marketslist of textMarket handles the discount does not work in
allow_b2bbooleanWhether business (B2B) customers can get it
only_b2bbooleantrue when only business customers can get it
cart_attribute_keytextA cart attribute the cart must carry
cart_attribute_valuetextThe value that attribute must have
FieldTypeHolds
all_productsbooleantrue when it applies to every product. These entries live on the shop only.
starts_atdate and timeWhen it started
ends_atdate and timeWhen it ends. Empty when it has no end.

config is a json field with details that do not fit the fields above. It always has v (its version). Keys you may find:

KeyHolds
discount_type_ours, reward_type_ours, engineThe DiscountOS type, reward and engine names
templateThe preset the discount was made from: quantity_break, smsm (Spend More Save More) or gift_with_purchase
purchase_typeWhich purchases it applies to: one_time, subscription or both
exclusionsProducts, collections or tags the discount does not apply to
tiers_mixed, tier_reward_types, tiers_droppedFor discounts with steps: set when the steps use different reward types, or when a step could not be written
usagelimit_total (total uses allowed) and once_per_customer
targeting.variantsVariant IDs the discount is limited to. Empty means every variant.
targeting.giftVariantsFor a free gift: the gift’s variant IDs, one list per step
eligibilityCustomer conditions: counts for segments and named customers, and conditions such as locations. It never lists customer names or IDs.
price_basisFor a set price: whether it is per item or for the whole set
configurationThe DiscountOS setup for Custom, Multi-offer and Bundle discounts, such as bundleItems
config_truncatedtrue when the details were too long and were cut. The discount works as set up; only the data is shorter.
typename, combines_with, threshold_refs_unknownFor Shopify’s own and other apps’ discounts: the Shopify type, what it combines with, and whether the “buy” products could not be read