younifyd
Menu

discountAutomaticBasicUpdate

Updates an existing amount off discount that's automatically applied on a cart and at checkout.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the discountAutomaticBasicUpdate action (under Discount).
  3. Fill in the fields below, then reference the result from later steps as {{discountautomaticbasicupdate.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 DiscountAutomaticBasicUpdate($id: ID!, $automaticBasicDiscount: DiscountAutomaticBasicInput!) {
  discountAutomaticBasicUpdate(
    id: $id
    automaticBasicDiscount: $automaticBasicDiscount
  ) {
    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 amount off discount to update.

automaticBasicDiscountobjectrequired

The input data used to update the automatic amount off discount.

combinesWithobject4 fields
titlestring
startsAtstring
endsAtstring
contextobject4 fields
tagsarray<string>
minimumRequirementobject2 fields
customerGetsobject4 fields
recurringCycleLimitnumber
json
{
  "id": "string",
  "automaticBasicDiscount": {
    "combinesWith": {
      "productDiscounts": false,
      "orderDiscounts": false,
      "shippingDiscounts": false,
      "productDiscountsWithTagsOnSameCartLine": {
        "add": "string",
        "remove": "string"
      }
    },
    "title": "string",
    "startsAt": "string",
    "endsAt": "string",
    "context": {
      "all": "ALL",
      "customers": {
        "add": "string",
        "remove": "string"
      },
      "customerSegments": {
        "add": "string",
        "remove": "string"
      },
      "markets": {
        "add": "string",
        "remove": "string"
      }
    },
    "tags": [
      "string"
    ],
    "minimumRequirement": {
      "quantity": {
        "greaterThanOrEqualToQuantity": "string"
      },
      "subtotal": {
        "greaterThanOrEqualToSubtotal": "string"
      }
    },
    "customerGets": {
      "value": {
        "discountOnQuantity": "string",
        "percentage": "string",
        "discountAmount": "string"
      },
      "items": {
        "products": "string",
        "collections": "string",
        "all": "string"
      },
      "appliesOnOneTimePurchase": false,
      "appliesOnSubscription": false
    },
    "recurringCycleLimit": 0
  }
}

Response

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