younifyd
Menu

discountNode

Fetch a single discount node by its ID.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the discountNode action (under Discount).
  3. Fill in the fields below, then reference the result from later steps as {{discountnode.response.data}}.

Query

This is the query the action sends by default. Edit it in the step's Query field to change which fields come back.

graphql
query DiscountNode($id: ID!) {
  discountNode(id: $id) {
    discount
    id
  }
}

Variables

Pass these as a JSON object in the step's Variables field.

idstringrequired

The ID of the `DiscountNode` to return.

json
{
  "id": "string"
}

Response

Read the result with {{discountnode.response.data.data.discountNode}}. If the API returns errors, the step fails and they are at {{discountnode.response.data.errors}}.

discountobject

This field can return one of several different object shapes — properties from every possible shape are shown together.

appDiscountTypeobject9 fields
appliesOnOneTimePurchaseboolean
appliesOnSubscriptionboolean
asyncUsageCountnumber
combinesWithobject4 fields
contextobject4 fields

This field can return one of several different object shapes — properties from every possible shape are shown together.

createdAtstring
discountClassstring

One ofPRODUCTORDERSHIPPING

discountClassesarray<object>
discountIdstring
endsAtstring
errorHistoryobject4 fields
recurringCycleLimitnumber
startsAtstring
statusstring

One ofACTIVEEXPIREDSCHEDULED

tagsarray<object>
titlestring
updatedAtstring
customerGetsobject4 fields
minimumRequirementobject2 fields

This field can return one of several different object shapes — properties from every possible shape are shown together.

shortSummarystring
summarystring
usageCountnumber
customerBuysobject4 fields
idstring
usesPerOrderLimitnumber
destinationSelectionobject3 fields

This field can return one of several different object shapes — properties from every possible shape are shown together.

hasTimelineCommentboolean
maximumShippingPriceobject2 fields
totalSalesobject2 fields
appliesOncePerCustomerboolean
codesCountobject2 fields
customerSelectionobject4 fields

This field can return one of several different object shapes — properties from every possible shape are shown together.

shareableUrlsarray<object>
usageLimitnumber
idstring

Need more? See the Shopify guide for connection setup and behaviour shared by every action.