younifyd
Menu

discountAutomaticActivate

Activates an automatic discount.

Use it in a workflow

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

Query

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

graphql
mutation DiscountAutomaticActivate($id: ID!) {
  discountAutomaticActivate(id: $id) {
    automaticDiscountNode {
      automaticDiscount
      id
    }
    userErrors {
      code
      extraInfo
      field
      message
    }
  }
}

Variables

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

idstringrequired

The ID of the automatic discount to activate.

json
{
  "id": "string"
}

Response

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

automaticDiscountNodeobject
automaticDiscountobject30 fields

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

idstring
userErrorsarray<object>
codeobject
extraInfoobject
fieldobject
messageobject

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

discountAutomaticActivate — Shopify — Documentation