younifyd
Menu

codeDiscountNodeByCode

Retrieves a code discount by its discount code. The search is case-insensitive, enabling you to find discounts regardless of how customers enter the code.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the codeDiscountNodeByCode action (under Code).
  3. Fill in the fields below, then reference the result from later steps as {{codediscountnodebycode.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 CodeDiscountNodeByCode($code: String!) {
  codeDiscountNodeByCode(code: $code) {
    codeDiscount
    id
  }
}

Variables

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

codestringrequired

The case-insensitive code of the `DiscountCodeNode` to return.

json
{
  "code": "string"
}

Response

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

codeDiscountobject

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

appDiscountTypeobject9 fields
appliesOnOneTimePurchaseboolean
appliesOnSubscriptionboolean
appliesOncePerCustomerboolean
asyncUsageCountnumber
codesCountobject2 fields
combinesWithobject4 fields
contextobject4 fields

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

createdAtstring
customerSelectionobject4 fields

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

discountClassstring

One ofPRODUCTORDERSHIPPING

discountClassesarray<object>
discountIdstring
endsAtstring
errorHistoryobject4 fields
hasTimelineCommentboolean
recurringCycleLimitnumber
shareableUrlsarray<object>
startsAtstring
statusstring

One ofACTIVEEXPIREDSCHEDULED

tagsarray<object>
titlestring
totalSalesobject2 fields
updatedAtstring
usageLimitnumber
customerGetsobject4 fields
minimumRequirementobject2 fields

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

shortSummarystring
summarystring
customerBuysobject4 fields
usesPerOrderLimitnumber
destinationSelectionobject3 fields

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

maximumShippingPriceobject2 fields
idstring

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

codeDiscountNodeByCode — Shopify — Documentation