discountNodes
query
Requires read_discounts access scope.
An access token is required to call this API. Refer to Authorization for more information about how to obtain the token.
Get the store's discount activities.
Arguments
Returns elements following the specified cursor. The
first argument must also be specified when using this argument.Returns elements preceding the specified cursor. The
last argument must also be specified when using this argument.Returns the first n elements in the list.
Returns the last n elements in the list.
Whether to reverse the order of the list.
● true: reverse
● false: do not reverse
Default value: false
Specify one or more query filters. Supported filters and their valid values are as follows:
discount_type: The discount benefit type. Valid values are:bogo: Buy X, get Y free.fix_amount: Amount discount.percentage: Percentage discount.free_shipping: Free shipping.
status: The activity status. Valid values are:active: The activity is live and ongoing.expired: The activity has expired.scheduled: The activity has not started yet.
times_used: The usage count or the usage count range of the discount.
For example,times_used:>0means filtering discounts that have been used at least once.starts_at: The date and time when the activity starts, or a time scope during which the activity starts.
For example,starts_at:>='2023-01-10T00:00:00Z'means filtering activities that started after2023-01-10T00:00:00Z.title: The name of the activity, where any keyword passed in must be enclosed in''.
Filtering by title applies fuzzy matching.code: The discount code, where any keyword passed in must be enclosed in''.
Filtering by discount code applies exact matching.sales_channel: The sales channel. Valid values are:web: Online sales channel.pos: POS channel.all: All sales channels.
source_key: Specifies the creation source of the discount.
The key for sorting the filtered discount activities. For example,
STARTS_AT means sorting by the start time, and TIMES_USED means sorting by the usage count.Return
A list of edges.
A list of the nodes contained in DiscountNodeEdge.
Information to aid in pagination
Status and error codes
For detailed information about common codes, see Status and error codes.
Example
Get discount activities by title
Code
query MyQuery {
discountNodes(
first: 2
query: "title:'demo'"
sortKey: CREATED_AT
reverse: true
) {
pageInfo {
endCursor
hasNextPage
hasPreviousPage
startCursor
}
nodes {
discount {
... on DiscountAutomaticBasic {
endsAt
asyncUsageCount
status
shortSummary
minimumRequirement {
... on DiscountMinimumQuantity {
__typename
greaterThanOrEqualToQuantity
}
... on DiscountMinimumSubtotal {
__typename
greaterThanOrEqualToSubtotal {
amount
currencyCode
}
}
}
summary
title
updatedAt
startsAt
createdAt
customerGets {
items {
... on AllDiscountItems {
__typename
allItems
}
... on DiscountCollections {
__typename
collections
}
... on DiscountProducts {
__typename
productVariants
products
}
}
value {
... on DiscountAmount {
appliesOnEachItem
amount {
amount
currencyCode
}
}
... on DiscountPercentage {
__typename
percentage
}
... on DiscountOnQuantity {
__typename
effect {
... on DiscountAmount {
appliesOnEachItem
amount {
amount
currencyCode
}
}
... on DiscountPercentage {
__typename
percentage
}
}
quantity {
quantity
}
}
}
}
discountAutomaticBasicDiscountClass:discountClass
}
... on DiscountCodeBasic {
summary
minimumRequirement {
... on DiscountMinimumQuantity {
__typename
greaterThanOrEqualToQuantity
}
... on DiscountMinimumSubtotal {
__typename
greaterThanOrEqualToSubtotal {
amount
currencyCode
}
}
}
shareableUrls {
targetType
title
url
}
appliesTimesPerCustomer
asyncUsageCount
codeCount
createdAt
customerSelection {
... on DiscountCustomers {
__typename
customers
}
... on DiscountCustomerAll {
allCustomers
}
... on DiscountCustomerSegments {
__typename
segments
}
}
endsAt
shortSummary
startsAt
status
title
totalSales {
amount
currencyCode
}
updatedAt
usageLimit
combinesWith {
orderDiscounts
productDiscounts
shippingDiscounts
}
customerGets {
items {
... on AllDiscountItems {
__typename
allItems
}
... on DiscountCollections {
__typename
collections
}
... on DiscountProducts {
__typename
products
productVariants
}
}
value {
... on DiscountAmount {
appliesOnEachItem
amount {
amount
currencyCode
}
}
... on DiscountPercentage {
__typename
percentage
}
... on DiscountOnQuantity {
__typename
effect {
... on DiscountAmount {
appliesOnEachItem
amount {
amount
currencyCode
}
}
... on DiscountPercentage {
__typename
percentage
}
}
quantity {
quantity
}
}
}
}
discountCodeBasicDiscountClass:discountClass
}
... on DiscountCodeBxgy {
summary
appliesTimesPerCustomer
asyncUsageCount
codeCount
createdAt
customerSelection {
... on DiscountCustomers {
__typename
customers
}
... on DiscountCustomerAll {
allCustomers
}
... on DiscountCustomerSegments {
__typename
segments
}
}
endsAt
startsAt
status
title
usageLimit
usesPerOrderLimit
customerBuys {
items {
... on DiscountCollections {
__typename
collections
}
... on AllDiscountItems {
__typename
allItems
}
... on DiscountProducts {
__typename
productVariants
products
}
}
value {
... on DiscountQuantity {
__typename
quantity
}
... on DiscountPurchaseAmount {
amount
}
}
}
customerGets {
items {
... on DiscountCollections {
__typename
collections
}
... on DiscountProducts {
__typename
productVariants
products
}
... on AllDiscountItems {
__typename
allItems
}
}
value {
... on DiscountPercentage {
__typename
percentage
}
... on DiscountOnQuantity {
__typename
effect {
... on DiscountPercentage {
__typename
percentage
}
... on DiscountAmount {
appliesOnEachItem
amount {
amount
currencyCode
}
}
}
quantity {
quantity
}
}
... on DiscountAmount {
appliesOnEachItem
amount {
amount
currencyCode
}
}
}
}
combinesWith {
orderDiscounts
productDiscounts
shippingDiscounts
}
discountCodeBxgyDiscountClass:discountClass
shareableUrls {
targetType
title
url
}
totalSales {
amount
currencyCode
}
}
... on DiscountAutomaticFreeShipping {
summary
asyncUsageCount
totalSales {
amount
currencyCode
}
title
updatedAt
status
startsAt
shortSummary
minimumRequirement {
... on DiscountMinimumQuantity {
__typename
greaterThanOrEqualToQuantity
}
... on DiscountMinimumSubtotal {
__typename
greaterThanOrEqualToSubtotal {
amount
currencyCode
}
}
}
endsAt
createdAt
destinationSelection {
... on DiscountCountries {
includeRestOfWorld
countries
}
... on DiscountCountryAll {
allCountries
}
}
maximumShippingPrice {
amount
currencyCode
}
discountAutomaticFreeShippingDiscountClass:discountClass
}
... on DiscountCodeFreeShipping {
summary
asyncUsageCount
appliesTimesPerCustomer
codeCount
combinesWith {
orderDiscounts
productDiscounts
shippingDiscounts
}
createdAt
customerSelection {
... on DiscountCustomers {
__typename
customers
}
... on DiscountCustomerAll {
allCustomers
}
... on DiscountCustomerSegments {
__typename
segments
}
}
destinationSelection {
... on DiscountCountries {
includeRestOfWorld
countries
}
... on DiscountCountryAll {
allCountries
}
}
endsAt
maximumShippingPrice {
amount
currencyCode
}
minimumRequirement {
... on DiscountMinimumQuantity {
__typename
greaterThanOrEqualToQuantity
}
... on DiscountMinimumSubtotal {
__typename
greaterThanOrEqualToSubtotal {
amount
currencyCode
}
}
}
shareableUrls {
targetType
title
url
}
shortSummary
startsAt
status
title
totalSales {
amount
currencyCode
}
updatedAt
usageLimit
discountCodeFreeShippingDiscountClass:discountClass
}
... on DiscountAutomaticApp {
createdAt
appDiscountType {
appKey
description
discountClass
targetType
title
functionId
}
asyncUsageCount
combinesWith {
orderDiscounts
productDiscounts
shippingDiscounts
}
discountId
endsAt
startsAt
status
title
updatedAt
discountAutomaticAppDiscountClass:discountClass
}
... on DiscountAutomaticBxgy {
summary
asyncUsageCount
combinesWith {
orderDiscounts
productDiscounts
shippingDiscounts
}
createdAt
customerBuys {
items {
... on DiscountCollections {
__typename
collections
}
... on AllDiscountItems {
__typename
allItems
}
... on DiscountProducts {
__typename
productVariants
products
}
}
value {
... on DiscountQuantity {
__typename
quantity
}
... on DiscountPurchaseAmount {
amount
}
}
}
customerGets {
items {
... on DiscountCollections {
__typename
collections
}
... on AllDiscountItems {
__typename
allItems
}
... on DiscountProducts {
__typename
productVariants
products
}
}
value {
... on DiscountPercentage {
__typename
percentage
}
... on DiscountOnQuantity {
__typename
effect {
... on DiscountPercentage {
__typename
percentage
}
... on DiscountAmount {
appliesOnEachItem
amount {
amount
currencyCode
}
}
}
quantity {
quantity
}
}
... on DiscountAmount {
appliesOnEachItem
amount {
amount
currencyCode
}
}
}
}
endsAt
status
title
updatedAt
usesPerOrderLimit
discountAutomaticBxgyDiscountClass:discountClass
}
}
id
}
edges {
cursor
node {
discount {
... on DiscountCodeBxgy {
summary
asyncUsageCount
appliesTimesPerCustomer
codeCount
combinesWith {
orderDiscounts
productDiscounts
shippingDiscounts
}
createdAt
customerBuys {
items {
... on DiscountCollections {
__typename
collections
}
... on AllDiscountItems {
__typename
allItems
}
... on DiscountProducts {
__typename
productVariants
products
}
}
value {
... on DiscountQuantity {
__typename
quantity
}
... on DiscountPurchaseAmount {
amount
}
}
}
customerGets {
items {
... on DiscountCollections {
__typename
collections
}
... on AllDiscountItems {
__typename
allItems
}
... on DiscountProducts {
__typename
productVariants
products
}
}
value {
... on DiscountPercentage {
__typename
percentage
}
... on DiscountOnQuantity {
__typename
effect {
... on DiscountPercentage {
__typename
percentage
}
... on DiscountAmount {
appliesOnEachItem
amount {
amount
currencyCode
}
}
}
quantity {
quantity
}
}
... on DiscountAmount {
appliesOnEachItem
amount {
amount
currencyCode
}
}
}
}
customerSelection {
... on DiscountCustomers {
__typename
customers
}
... on DiscountCustomerSegments {
__typename
segments
}
... on DiscountCustomerAll {
allCustomers
}
}
endsAt
shareableUrls {
targetType
title
url
}
startsAt
status
title
totalSales {
amount
currencyCode
}
usageLimit
usesPerOrderLimit
discountCodeBxgyDiscountClass:discountClass
}
... on DiscountAutomaticBxgy {
summary
asyncUsageCount
combinesWith {
orderDiscounts
productDiscounts
shippingDiscounts
}
createdAt
customerBuys {
items {
... on DiscountCollections {
__typename
collections
}
... on AllDiscountItems {
__typename
allItems
}
... on DiscountProducts {
__typename
products
productVariants
}
}
value {
... on DiscountQuantity {
__typename
quantity
}
... on DiscountPurchaseAmount {
amount
}
}
}
customerGets {
items {
... on DiscountCollections {
__typename
collections
}
... on AllDiscountItems {
__typename
allItems
}
... on DiscountProducts {
__typename
products
productVariants
}
}
value {
... on DiscountPercentage {
__typename
percentage
}
... on DiscountOnQuantity {
__typename
effect {
... on DiscountPercentage {
__typename
percentage
}
... on DiscountAmount {
appliesOnEachItem
amount {
amount
currencyCode
}
}
}
quantity {
quantity
}
}
... on DiscountAmount {
appliesOnEachItem
amount {
amount
currencyCode
}
}
}
}
endsAt
status
title
updatedAt
usesPerOrderLimit
discountAutomaticBxgyDiscountClass:discountClass
}
... on DiscountAutomaticApp {
createdAt
appDiscountType {
appKey
description
discountClass
functionId
targetType
title
}
combinesWith {
orderDiscounts
productDiscounts
shippingDiscounts
}
asyncUsageCount
discountId
endsAt
startsAt
status
title
updatedAt
discountAutomaticAppDiscountClass:discountClass
}
... on DiscountCodeFreeShipping {
summary
asyncUsageCount
appliesTimesPerCustomer
codeCount
combinesWith {
orderDiscounts
productDiscounts
shippingDiscounts
}
createdAt
customerSelection {
... on DiscountCustomers {
__typename
customers
}
... on DiscountCustomerAll {
allCustomers
}
... on DiscountCustomerSegments {
__typename
segments
}
}
destinationSelection {
... on DiscountCountries {
includeRestOfWorld
countries
}
... on DiscountCountryAll {
allCountries
}
}
endsAt
maximumShippingPrice {
amount
currencyCode
}
minimumRequirement {
... on DiscountMinimumQuantity {
__typename
greaterThanOrEqualToQuantity
}
... on DiscountMinimumSubtotal {
__typename
greaterThanOrEqualToSubtotal {
amount
currencyCode
}
}
}
shareableUrls {
targetType
title
url
}
shortSummary
startsAt
status
title
totalSales {
amount
currencyCode
}
updatedAt
usageLimit
discountCodeFreeShippingDiscountClass:discountClass
}
... on DiscountCodeBasic {
summary
asyncUsageCount
appliesTimesPerCustomer
codeCount
combinesWith {
orderDiscounts
productDiscounts
shippingDiscounts
}
createdAt
customerGets {
items {
... on DiscountCollections {
__typename
collections
}
... on AllDiscountItems {
__typename
allItems
}
... on DiscountProducts {
__typename
productVariants
products
}
}
value {
... on DiscountPercentage {
__typename
percentage
}
... on DiscountOnQuantity {
__typename
effect {
... on DiscountPercentage {
__typename
percentage
}
... on DiscountAmount {
appliesOnEachItem
amount {
amount
currencyCode
}
}
}
quantity {
quantity
}
}
... on DiscountAmount {
appliesOnEachItem
amount {
amount
currencyCode
}
}
}
}
customerSelection {
... on DiscountCustomers {
__typename
customers
}
... on DiscountCustomerAll {
allCustomers
}
... on DiscountCustomerSegments {
__typename
segments
}
}
endsAt
minimumRequirement {
... on DiscountMinimumQuantity {
__typename
greaterThanOrEqualToQuantity
}
... on DiscountMinimumSubtotal {
__typename
greaterThanOrEqualToSubtotal {
amount
currencyCode
}
}
}
shareableUrls {
targetType
title
url
}
shortSummary
startsAt
status
title
totalSales {
amount
currencyCode
}
updatedAt
usageLimit
discountCodeBasicDiscountClass:discountClass
}
... on DiscountAutomaticFreeShipping {
summary
asyncUsageCount
combinesWith {
orderDiscounts
shippingDiscounts
productDiscounts
}
createdAt
destinationSelection {
... on DiscountCountries {
includeRestOfWorld
countries
}
... on DiscountCountryAll {
allCountries
}
}
endsAt
maximumShippingPrice {
amount
currencyCode
}
minimumRequirement {
... on DiscountMinimumQuantity {
__typename
greaterThanOrEqualToQuantity
}
... on DiscountMinimumSubtotal {
__typename
greaterThanOrEqualToSubtotal {
amount
currencyCode
}
}
}
shortSummary
startsAt
status
title
totalSales {
amount
currencyCode
}
updatedAt
discountAutomaticFreeShippingDiscountClass:discountClass
}
... on DiscountAutomaticBasic {
summary
asyncUsageCount
combinesWith {
orderDiscounts
productDiscounts
shippingDiscounts
}
createdAt
customerGets {
items {
... on DiscountCollections {
__typename
collections
}
... on AllDiscountItems {
__typename
allItems
}
... on DiscountProducts {
__typename
productVariants
products
}
}
value {
... on DiscountPercentage {
__typename
percentage
}
... on DiscountOnQuantity {
__typename
effect {
... on DiscountPercentage {
__typename
percentage
}
... on DiscountAmount {
appliesOnEachItem
amount {
amount
currencyCode
}
}
}
quantity {
quantity
}
}
... on DiscountAmount {
appliesOnEachItem
amount {
amount
currencyCode
}
}
}
}
endsAt
minimumRequirement {
... on DiscountMinimumQuantity {
__typename
greaterThanOrEqualToQuantity
}
... on DiscountMinimumSubtotal {
__typename
greaterThanOrEqualToSubtotal {
amount
currencyCode
}
}
}
shortSummary
startsAt
status
title
updatedAt
discountAutomaticBasicDiscountClass:discountClass
}
}
id
}
}
}
}
Response
{
"data": {
"discountNodes": {
"edges": [
{
"node": {
"discount": {
"usageLimit": 10,
"codeCount": 1,
"combinesWith": {
"productDiscounts": true,
"shippingDiscounts": true,
"orderDiscounts": true
},
"customerGets": {
"items": {
"__typename": "DiscountProducts",
"productVariants": [],
"products": [
"16064393365790313753160195",
"16064393365833431198690195",
"16064393365879904087440195",
"16064393365916813963040195",
"16064393365975701991600195",
"16064393366023181513580195"
]
},
"value": {
"__typename": "DiscountPercentage",
"percentage": 0.3
}
},
"customerSelection": {
"allCustomers": true
},
"minimumRequirement": {
"__typename": "DiscountMinimumQuantity",
"greaterThanOrEqualToQuantity": 2
},
"startsAt": "2026-07-18T08:47:47.000Z",
"summary": "30% off 6 products • Minimum quantity of 2",
"asyncUsageCount": 0,
"createdAt": "2026-07-16T12:47:47.000Z",
"endsAt": null,
"shareableUrls": [
{
"title": "demo",
"url": "https://ella01pre.myshoplinestg.com/activity/SL201SAS07614808542429578265",
"targetType": "HOME"
}
],
"shortSummary": "30% off 6 products",
"status": "SCHEDULED",
"title": "demo",
"updatedAt": "2026-07-16T12:47:47.000Z",
"appliesTimesPerCustomer": 11,
"discountCodeBasicDiscountClass": "PRODUCT",
"totalSales": {
"amount": "0",
"currencyCode": "SGD"
}
},
"id": "gid://shopline/DiscountCodeNode/SL201SAS07614808542429578265"
},
"cursor": "-"
}
],
"nodes": [
{
"id": "gid://shopline/DiscountCodeNode/SL201SAS07614808542429578265",
"discount": {
"minimumRequirement": {
"__typename": "DiscountMinimumQuantity",
"greaterThanOrEqualToQuantity": 2
},
"startsAt": "2026-07-18T08:47:47.000Z",
"summary": "30% off 6 products • Minimum quantity of 2",
"title": "demo",
"appliesTimesPerCustomer": 11,
"discountCodeBasicDiscountClass": "PRODUCT",
"endsAt": null,
"updatedAt": "2026-07-16T12:47:47.000Z",
"shareableUrls": [
{
"url": "https://ella01pre.myshoplinestg.com/activity/SL201SAS07614808542429578265",
"targetType": "HOME",
"title": "demo"
}
],
"shortSummary": "30% off 6 products",
"status": "SCHEDULED",
"usageLimit": 10,
"asyncUsageCount": 0,
"createdAt": "2026-07-16T12:47:47.000Z",
"customerSelection": {
"allCustomers": true
},
"totalSales": {
"amount": "0",
"currencyCode": "SGD"
},
"codeCount": 1,
"combinesWith": {
"orderDiscounts": true,
"productDiscounts": true,
"shippingDiscounts": true
},
"customerGets": {
"value": {
"__typename": "DiscountPercentage",
"percentage": 0.3
},
"items": {
"__typename": "DiscountProducts",
"productVariants": [],
"products": [
"16064393365790313753160195",
"16064393365833431198690195",
"16064393365879904087440195",
"16064393365916813963040195",
"16064393365975701991600195",
"16064393366023181513580195"
]
}
}
}
}
],
"pageInfo": {
"hasPreviousPage": false,
"startCursor": "2AAF90F13C58A5EF353DD555E8D6CCD6",
"endCursor": "C61FAE0199C84A33DB551A7831B8E034",
"hasNextPage": false
}
}
},
"extensions": {
"cost": {
"actualQueryCost": 55,
"requestedQueryCost": 55,
"throttleStatus": {
"currentlyAvailable": 49929,
"maximumAvailable": 50000,
"restoreRate": 50000
}
}
}
}
Was this article helpful to you?