Abra API: Discount types
Last updated: September 29, 2026
discountValue sets what a discount gives. Its type picks one of the shapes below, and each shape has its own fields. The first eight run on Abra's discount functions and can be created and edited through the API. The last five are native Shopify discounts, which you can only attach with discountId. For how each one works in the Abra app, see Discount and Reward Types.
Beta. The Abra API is in beta, so its behavior may change. If something doesn't work as described, contact us at help@abrapromotions.com.
The type values, in the order they appear on this page:
Gift: Gift with purchaseBxgyDiscount: Buy X get YDiscountMultiValueProduct: Different discount per productDiscountMultiValueCollection: Different discount per collectionTieredDiscount: Tiered discountCollectionOrderDiscount: Order discount by collectionMultiEffectTiers: Tiers with several rewardsVolumeDiscount: Volume discountDiscountPercentage: Shopify percentage offDiscountAmount: Shopify amount offDiscountOnQuantity: Shopify discount on quantityDiscountCodeFreeShipping: Shopify free shippingBXGY: Shopify buy X get Y
Gift with purchase
type: Gift. Adds free gift products to the cart once it reaches prerequisite.minimumRequirement, which must be a subtotal or quantity above 0. Items covered by entitled count toward that minimum. products lists 1 to 10 gift products, and quantity is how many gifts the shopper earns (1 by default); with compound, they earn that many again each time the minimum is met again. Use discountClass PRODUCT and typeName DiscountAutomaticApp or DiscountCodeApp.
Name | Description |
|---|---|
string, required | Always |
number | |
array of objects, required | Each item is a Gift product object (see Shared objects). |
boolean | |
boolean | |
object | A Free gift settings object (see Shared objects). |
string | One of |
Example request body
A request body for Create a discount:
{
"title": "Free gift with purchase",
"discountClass": "PRODUCT",
"typeName": "DiscountAutomaticApp",
"discountValue": {
"type": "Gift",
"quantity": 1,
"products": [
{
"id": "gid://shopify/Product/123",
"handle": "free-gift-product",
"title": "Free Gift Product",
"variants": [
{
"id": "gid://shopify/ProductVariant/456",
"displayName": "Default Title"
}
]
}
],
"compound": false,
"countsTowardEligibility": false
},
"prerequisite": {
"minimumRequirement": {
"greaterThanOrEqualToSubtotal": {
"amount": "50.00",
"currencyCode": "USD"
}
}
}
}Buy X get Y
type: BxgyDiscount. Abra's buy X get Y. productCards lists up to 5 things the shopper must buy, each with items, a purchase type and a quantity or subtotal (requirementType). customerGets says what they get: a percentage off, an amount off, a fixed price or a free gift on the chosen items. Use discountClass PRODUCT and typeName DiscountAutomaticApp or DiscountCodeApp.
Name | Description |
|---|---|
string, required | Always |
string, required | One of |
object | A Money object (see Shared objects). |
array of objects, required | What the shopper must buy. Each card sets its items and a quantity or subtotal. Fields listed under |
object, required | What the shopper gets once the product cards are met. Fields listed under |
boolean | |
object | A Free gift settings object (see Shared objects). |
string or null | |
string or null | |
number or null |
productCards[]
Name | Description |
|---|---|
number | |
string | One of |
object | Fields listed under |
object, required | Fields listed under |
string, required | One of |
productCards[].minimumSubtotal
Name | Description |
|---|---|
string | |
string |
productCards[].items
Name | Description |
|---|---|
string, required | One of |
string | One of |
array of objects | Each item is a Metafield selection object (see Shared objects). |
array of objects | Fields listed under |
array of objects | Fields listed under |
productCards[].items.products[]
Name | Description |
|---|---|
string, required | |
string, required | |
string | |
number | Manual display order of the gift on the storefront. |
array of objects, required | Fields listed under |
productCards[].items.products[].variants[]
Name | Description |
|---|---|
string, required | |
string | |
string |
productCards[].items.collections[]
Name | Description |
|---|---|
string, required | |
string, required | |
string | |
array of strings |
customerGets
Name | Description |
|---|---|
number | |
boolean, required | |
object | Same fields as |
array of objects, required | Fields listed under |
object, required | Fields listed under |
customerGets.productCards[]
Name | Description |
|---|---|
number | |
object, required | Same fields as |
string | One of |
customerGets.value
Name | Description |
|---|---|
string, required | One of |
string | |
object | A Money object (see Shared objects). |
object | A Money object (see Shared objects). |
Example request body
A request body for Create a discount:
{
"title": "Buy 2 get 1 free",
"discountClass": "PRODUCT",
"typeName": "DiscountAutomaticApp",
"discountValue": {
"type": "BxgyDiscount",
"requirementType": "QUANTITY",
"productCards": [
{
"quantity": 2,
"requirementType": "QUANTITY",
"items": {
"type": "AllProducts"
},
"purchaseType": "ONE_TIME"
}
],
"customerGets": {
"applyToProductCardItems": true,
"productCards": [
{
"quantity": 1,
"items": {
"type": "AllProducts"
}
}
],
"value": {
"type": "DiscountPercentage",
"percentage": "100"
}
}
}
}Different discount per product
type: DiscountMultiValueProduct. Gives different products different discounts. Each entry in discounts picks products or collections (type), or variants by metafield when selectionMethod is metafield, and sets a percentage or amount off in value. Use discountClass PRODUCT and typeName DiscountAutomaticApp or DiscountCodeApp.
Name | Description |
|---|---|
string, required | Always |
string | One of |
array of objects, required | One entry per group of products, each with its own discount. Fields listed under |
discounts[]
Name | Description |
|---|---|
string, required | One of |
array of objects | Fields listed under |
array of objects | Fields listed under |
array of objects | Each item is a Metafield selection object (see Shared objects). |
object, required | An Entry value object (see Shared objects). |
discounts[].collections[]
Name | Description |
|---|---|
string, required | |
string, required | |
string | |
number, required |
discounts[].products[]
Name | Description |
|---|---|
string | |
string, required | |
array of objects | Fields listed under |
discounts[].products[].variants[]
Name | Description |
|---|---|
string, required | |
string |
Example request body
A request body for Create a discount:
{
"title": "Per-product discounts",
"discountClass": "PRODUCT",
"typeName": "DiscountAutomaticApp",
"discountValue": {
"type": "DiscountMultiValueProduct",
"selectionMethod": "product",
"discounts": [
{
"type": "DiscountProducts",
"products": [
{
"id": "gid://shopify/Product/123",
"handle": "example-product",
"variants": [
{
"id": "gid://shopify/ProductVariant/456",
"displayName": "Default Title"
}
]
}
],
"value": {
"type": "DiscountPercentage",
"percentage": "20"
}
}
]
}
}Different discount per collection
type: DiscountMultiValueCollection. Gives different collections different discounts. Each entry in discounts lists collections and the percentage or amount off in value. Use discountClass PRODUCT and typeName DiscountAutomaticApp or DiscountCodeApp.
Name | Description |
|---|---|
string, required | Always |
array of objects, required | One entry per group of collections, each with its own discount. Fields listed under |
discounts[]
Name | Description |
|---|---|
string, required | Always |
array of objects, required | Fields listed under |
object, required | An Entry value object (see Shared objects). |
discounts[].collections[]
Name | Description |
|---|---|
string, required | |
string, required | |
string | |
number, required |
Example request body
A request body for Create a discount:
{
"title": "Per-collection discounts",
"discountClass": "PRODUCT",
"typeName": "DiscountAutomaticApp",
"discountValue": {
"type": "DiscountMultiValueCollection",
"discounts": [
{
"type": "DiscountCollection",
"collections": [
{
"id": "gid://shopify/Collection/123",
"handle": "summer-sale",
"productsCount": 10
}
],
"value": {
"type": "DiscountPercentage",
"percentage": "15"
}
}
]
}
}Tiered discount
type: TieredDiscount. The reward grows as the cart grows. Each tier in discounts has a threshold in prerequisite.minimumRequirement (a subtotal or quantity) and gives a percentage or amount off (PERCENTAGE_OFF) or free gifts (FREE_GIFT). tiersType lists the reward kinds used and globalPrerequisite the threshold kinds. Thresholds and rewards must increase from tier to tier. entitled sets the products it covers. Use discountClass PRODUCT and typeName DiscountAutomaticApp or DiscountCodeApp.
Name | Description |
|---|---|
string, required | Always |
array of strings, required | |
array of strings, required | |
boolean | |
object | A Free gift settings object (see Shared objects). |
object, required | Which products the tiers apply to. An Entitled items object (see Shared objects). |
array of objects | The tiers, ordered by threshold. Fields listed under |
discounts[]
Name | Description |
|---|---|
string, required | One of |
object, required | Fields listed under |
object | Fields listed under |
discounts[].prerequisite
Name | Description |
|---|---|
object | A Tier threshold object (see Shared objects). |
discounts[].value
Name | Description |
|---|---|
string, required | One of |
number | |
string | |
object | A Money object (see Shared objects). |
array of objects | Each item is a Gift product object (see Shared objects). |
string | One of |
Example request body
A request body for Create a discount:
{
"title": "Spend more save more",
"discountClass": "PRODUCT",
"typeName": "DiscountAutomaticApp",
"discountValue": {
"type": "TieredDiscount",
"globalPrerequisite": [
"SUBTOTAL"
],
"tiersType": [
"PERCENTAGE_OFF"
],
"entitled": {
"type": "AllDiscountItems",
"all": true
},
"discounts": [
{
"type": "PERCENTAGE_OFF",
"prerequisite": {
"minimumRequirement": {
"greaterThanOrEqualToSubtotal": {
"amount": "50.00",
"currencyCode": "USD"
}
}
},
"value": {
"type": "DiscountPercentage",
"percentage": "10"
}
}
]
}
}Order discount by collection
type: CollectionOrderDiscount. An order discount set up per collection. Each entry in discounts lists collections and the percentage or amount off in value. It's always saved with discountClass ORDER; use typeName DiscountAutomaticApp or DiscountCodeApp.
Name | Description |
|---|---|
string, required | Always |
array of objects, required | One entry per group of collections, each with its own discount. Fields listed under |
discounts[]
Name | Description |
|---|---|
string, required | Always |
array of objects, required | Fields listed under |
object, required | An Entry value object (see Shared objects). |
discounts[].collections[]
Name | Description |
|---|---|
string, required | |
string | |
string | |
number |
Example request body
A request body for Create a discount:
{
"title": "10% off accessories collection",
"discountClass": "ORDER",
"typeName": "DiscountAutomaticApp",
"discountValue": {
"type": "CollectionOrderDiscount",
"discounts": [
{
"type": "DiscountCollections",
"collections": [
{
"id": "gid://shopify/Collection/123",
"handle": "accessories"
}
],
"value": {
"type": "DiscountPercentage",
"percentage": "10"
}
}
]
}
}Tiers with several rewards
type: MultiEffectTiers. Like a tiered discount, but each tier in tiers can combine several rewards: product discounts, an order discount, free shipping and gifts. Thresholds use globalPrerequisite (SUBTOTAL or QUANTITY) and must increase, and purchaseType is ONE_TIME_PURCHASE or SUBSCRIPTION. Send discountClass PRODUCT; the Shopify discount classes are set from the rewards you use. Use typeName DiscountAutomaticApp or DiscountCodeApp.
Name | Description |
|---|---|
string, required | Always |
string, required | One of |
string, required | One of |
object, required | Which products the tiers apply to. An Entitled items object (see Shared objects). |
boolean | |
object | A Free gift settings object (see Shared objects). |
array of objects, required | The tiers. Each has its own requirement and one or more rewards. Fields listed under |
tiers[]
Name | Description |
|---|---|
object, required | Fields listed under |
array of objects, required | Fields listed under |
tiers[].prerequisite
Name | Description |
|---|---|
object | A Tier threshold object (see Shared objects). |
tiers[].discounts[]
Name | Description |
|---|---|
string, required | One of |
array of objects or object, required | The reward. For |
tiers[].discounts[].value[] when type is ProductDiscount
Name | Description |
|---|---|
object, required | An Entitled items object (see Shared objects). |
object, required | Fields listed under |
string | One of |
number |
tiers[].discounts[].value[].value
Name | Description |
|---|---|
string, required | One of |
string | |
object | A Money object (see Shared objects). |
object | A Money object (see Shared objects). |
tiers[].discounts[].value when type is GWPDiscount
Name | Description |
|---|---|
number | |
array of objects, required | Each item is a Gift product object (see Shared objects). |
boolean | |
string | One of |
tiers[].discounts[].value when type is OrderDiscount
Name | Description |
|---|---|
string, required | One of |
string | |
object | A Money object (see Shared objects). |
tiers[].discounts[].value when type is FreeShippingDiscount
Name | Description |
|---|---|
string, required | One of |
array of strings, required | |
object | A Money object (see Shared objects). |
Example request body
A request body for Create a discount:
{
"title": "Tiered discount with multiple effects",
"discountClass": "PRODUCT",
"typeName": "DiscountAutomaticApp",
"discountValue": {
"type": "MultiEffectTiers",
"globalPrerequisite": "SUBTOTAL",
"purchaseType": "ONE_TIME_PURCHASE",
"entitled": {
"type": "AllDiscountItems",
"all": true
},
"tiers": [
{
"prerequisite": {
"minimumRequirement": {
"greaterThanOrEqualToSubtotal": {
"amount": "50.00",
"currencyCode": "USD"
}
}
},
"discounts": [
{
"type": "ProductDiscount",
"value": [
{
"entitled": {
"type": "AllDiscountItems",
"all": true
},
"value": {
"type": "DiscountPercentage",
"percentage": "10"
},
"quantity": 1
}
]
}
]
}
]
}
}Volume discount
type: VolumeDiscount. Price breaks for buying more of the products in customerGets. Each tier in tiers has a threshold and a reward: a percentage off, an amount off each item, a fixed price or free gifts. With minimumPurchaseAmountPerProductVariant, the threshold is counted per product or per variant (minimumPurchaseScope) instead of across the cart. Use discountClass PRODUCT and typeName DiscountAutomaticApp or DiscountCodeApp.
Name | Description |
|---|---|
string, required | Always |
array of strings, required | |
array of strings, required | |
boolean | |
object | A Free gift settings object (see Shared objects). |
object, required | Which products the volume tiers apply to, chosen by |
boolean, required | |
string | One of |
array of objects, required | Volume discount tiers ordered by threshold. Fields listed under |
customerGets
Name | Description |
|---|---|
string, required | One of |
boolean, required | |
string | One of |
string | One of |
array of objects | Each item is a Metafield selection object (see Shared objects). |
array of objects | Fields listed under |
array of objects | Fields listed under |
customerGets.products[]
Name | Description |
|---|---|
string | |
string, required | |
array of objects, required | Fields listed under |
customerGets.products[].variants[]
Name | Description |
|---|---|
string, required | |
string, required |
customerGets.collections[]
Name | Description |
|---|---|
string, required | |
string, required | |
string |
tiers[]
Name | Description |
|---|---|
object | Fields listed under |
object, required | Fields listed under |
tiers[].prerequisite
Name | Description |
|---|---|
object | A Tier threshold object (see Shared objects). |
tiers[].value
Name | Description |
|---|---|
string, required | One of |
number | |
string | |
object | A Money object (see Shared objects). |
object | A Money object (see Shared objects). |
array of objects | Each item is a Gift product object (see Shared objects). |
string | One of |
Example request body
A request body for Create a discount:
{
"title": "Volume pricing",
"discountClass": "PRODUCT",
"typeName": "DiscountAutomaticApp",
"discountValue": {
"type": "VolumeDiscount",
"globalPrerequisite": [
"QUANTITY"
],
"tiersType": [
"PERCENTAGE_OFF"
],
"compound": false,
"customerGets": {
"appliesTo": "ALL_PRODUCTS",
"all": true
},
"minimumPurchaseAmountPerProductVariant": false,
"tiers": [
{
"prerequisite": {
"minimumRequirement": {
"greaterThanOrEqualToQuantity": 5
}
},
"value": {
"type": "DiscountPercentage",
"percentage": "10"
}
}
]
}
}Shopify percentage off
type: DiscountPercentage. A native Shopify amount-off discount that takes a percentage off, set in percentage as a string such as 10. Its typeName is DiscountCodeBasic or DiscountAutomaticBasic. Native discounts can't be created or edited through the API: attach an existing Shopify discount with discountId.
Name | Description |
|---|---|
string, required | Always |
string, required |
Shopify amount off
type: DiscountAmount. A native Shopify amount-off discount that takes a fixed amount off, set in discountAmount, or off each item when appliesOnEachItem is true. Its typeName is DiscountCodeBasic or DiscountAutomaticBasic. Native discounts can't be created or edited through the API: attach an existing Shopify discount with discountId.
Name | Description |
|---|---|
string, required | Always |
object, required | A Money object (see Shared objects). |
boolean |
Shopify discount on quantity
type: DiscountOnQuantity. A native Shopify discount on a number of items: quantity items get the effect, a percentage or an amount off. Its typeName is DiscountCodeBasic or DiscountAutomaticBasic. Native discounts can't be created or edited through the API: attach an existing Shopify discount with discountId.
Name | Description |
|---|---|
string, required | Always |
object, required | One of 2 shapes, chosen by |
number, required |
Shopify free shipping
type: DiscountCodeFreeShipping. A native Shopify free shipping discount. It has no other fields. Its typeName is DiscountCodeFreeShipping or DiscountAutomaticFreeShipping. Native discounts can't be created or edited through the API: attach an existing Shopify discount with discountId.
Name | Description |
|---|---|
string, required | Always |
Shopify buy X get Y
type: BXGY. Shopify's own buy X get Y. customerBuys sets the items and the quantity or purchase amount the shopper must buy, and customerGets the items they get and the discount on them. Its typeName is DiscountCodeBxgy or DiscountAutomaticBxgy. Native discounts can't be created or edited through the API: attach an existing Shopify discount with discountId.
Name | Description |
|---|---|
string, required | Always |
object or null | Fields listed under |
object or null | Fields listed under |
customerBuys
Name | Description |
|---|---|
object, required | Fields listed under |
object, required | One of 2 shapes, chosen by |
customerBuys.items
Name | Description |
|---|---|
boolean | |
array of strings | |
array of objects | Fields listed under |
array of strings | |
array of strings |
customerBuys.items.collections[]
Name | Description |
|---|---|
string, required | |
string, required |
customerBuys.value when type is DiscountPurchaseAmount
Name | Description |
|---|---|
string, required | Always |
number, required |
customerBuys.value when type is DiscountQuantity
Name | Description |
|---|---|
string, required | Always |
integer, required | At least 1. |
customerGets
Name | Description |
|---|---|
object, required | Same fields as |
object, required | One of 3 shapes, chosen by |
Shared objects
These objects appear in more than one discount type. Each is described once here.
Entitled items
Used by the Tiered discount and Tiers with several rewards types.
Name | Description |
|---|---|
string, required | One of |
boolean | |
string | One of |
array of objects | Each item is a Metafield selection object (see Shared objects). |
array of strings or objects | Shopify product IDs, or objects with |
array of objects | Fields listed under |
collections[]
Name | Description |
|---|---|
string, required | |
string, required | |
string |
Entry value
Used by the Different discount per product, Different discount per collection and Order discount by collection types.
Name | Description |
|---|---|
string, required | One of |
string | |
object | A Money object (see Shared objects). |
Free gift settings
Used by the Gift with purchase, Buy X get Y, Tiered discount, Tiers with several rewards and Volume discount types.
Name | Description |
|---|---|
boolean | |
boolean |
Gift product
Used by the Gift with purchase, Tiered discount, Tiers with several rewards and Volume discount types.
Name | Description |
|---|---|
string, required | |
string, required | |
string | |
string | |
string | |
number | Manual display order of the gift on the storefront. |
array of objects, required | Fields listed under |
variants[]
Name | Description |
|---|---|
string, required | |
string | |
string | |
number | |
string |
Metafield selection
Used by the Buy X get Y, Different discount per product, Tiered discount, Tiers with several rewards and Volume discount types.
Name | Description |
|---|---|
string | |
string, required | |
string, required | |
string, required | |
string, required | |
array of strings, required |
Money
Used by the Buy X get Y, Different discount per product, Different discount per collection, Tiered discount, Order discount by collection, Tiers with several rewards, Volume discount and Shopify amount off types.
Name | Description |
|---|---|
string, required | Amount as a string, for example |
string, required | Three-letter ISO 4217 currency code, for example |
Tier threshold
Used by the Tiered discount, Tiers with several rewards and Volume discount types.
Name | Description |
|---|---|
number | |
object | Fields listed under |
greaterThanOrEqualToSubtotal
Name | Description |
|---|---|
string | |
string |
This page is generated from the Abra API specification (build bc96ccc) ยท ref 51d894041a08. Edits made in Pylon are overwritten.