younifyd
Menu

discountAutomaticFreeShippingUpdate

Updates existing automatic free shipping discounts, allowing merchants to modify promotion criteria, shipping destinations, and eligibility requirements without recreating the entire discount structure.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the discountAutomaticFreeShippingUpdate action (under Discount).
  3. Fill in the fields below, then reference the result from later steps as {{discountautomaticfreeshippingupdate.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 DiscountAutomaticFreeShippingUpdate($id: ID!, $freeShippingAutomaticDiscount: DiscountAutomaticFreeShippingInput!) {
  discountAutomaticFreeShippingUpdate(
    id: $id
    freeShippingAutomaticDiscount: $freeShippingAutomaticDiscount
  ) {
    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 free shipping discount to update.

freeShippingAutomaticDiscountobjectrequired

The input data used to update the automatic free shipping discount.

titlestring
startsAtstring
endsAtstring
contextobject4 fields
combinesWithobject4 fields
tagsarray<string>
minimumRequirementobject2 fields
destinationobject2 fields
maximumShippingPricestring
appliesOnOneTimePurchaseboolean
appliesOnSubscriptionboolean
recurringCycleLimitnumber
json
{
  "id": "string",
  "freeShippingAutomaticDiscount": {
    "title": "string",
    "startsAt": "string",
    "endsAt": "string",
    "context": {
      "all": "ALL",
      "customers": {
        "add": "string",
        "remove": "string"
      },
      "customerSegments": {
        "add": "string",
        "remove": "string"
      },
      "markets": {
        "add": "string",
        "remove": "string"
      }
    },
    "combinesWith": {
      "productDiscounts": false,
      "orderDiscounts": false,
      "shippingDiscounts": false,
      "productDiscountsWithTagsOnSameCartLine": {
        "add": "string",
        "remove": "string"
      }
    },
    "tags": [
      "string"
    ],
    "minimumRequirement": {
      "quantity": {
        "greaterThanOrEqualToQuantity": "string"
      },
      "subtotal": {
        "greaterThanOrEqualToSubtotal": "string"
      }
    },
    "destination": {
      "all": false,
      "countries": {
        "add": "string",
        "remove": "string",
        "includeRestOfWorld": "string"
      }
    },
    "maximumShippingPrice": "string",
    "appliesOnOneTimePurchase": false,
    "appliesOnSubscription": false,
    "recurringCycleLimit": 0
  }
}

Response

Read the result with {{discountautomaticfreeshippingupdate.response.data.data.discountAutomaticFreeShippingUpdate}}. If the API returns errors, the step fails and they are at {{discountautomaticfreeshippingupdate.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.