younifyd
Menu

quantityRulesAdd

Creates or updates existing quantity rules on a price list. You can use the quantityRulesAdd mutation to set order level minimums, maximumums and increments for specific product variants.

Use it in a workflow

  1. Add a step and choose the Shopify connector.
  2. Pick the quantityRulesAdd action (under Quantity).
  3. Fill in the fields below, then reference the result from later steps as {{quantityrulesadd.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 QuantityRulesAdd($priceListId: ID!, $quantityRules: [QuantityRuleInput!]!) {
  quantityRulesAdd(priceListId: $priceListId, quantityRules: $quantityRules) {
    quantityRules {
      increment
      isDefault
      maximum
      minimum
      originType
      productVariant {
        availableForSale
        availablePublicationsCount
        barcode
        compareAtPrice
        createdAt
        defaultCursor
        deliveryProfile
        displayName
        id
        inventoryItem
        inventoryPolicy
        inventoryQuantity
        legacyResourceId
        position
        price
        product
        publishedOnCurrentChannel
        publishedOnCurrentPublication
        requiresComponents
        selectedOptions
        sellableOnlineQuantity
        sellingPlanGroupCount
        sellingPlanGroupsCount
        showUnitPrice
        sku
        storefrontId
        taxCode
        taxable
        title
        unitPrice
        unitPriceMeasurement
        updatedAt
      }
    }
    userErrors {
      code
      field
      message
    }
  }
}

Variables

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

priceListIdstringrequired

The ID of the price list to which the quantity rules will be added or updated.

quantityRulesarray<object>required

The list of quantity rules to add or update in the price list.

incrementnumberrequired
maximumnumber
minimumnumberrequired
variantIdstringrequired
json
{
  "priceListId": "string",
  "quantityRules": [
    {
      "increment": 0,
      "minimum": 0,
      "variantId": "string",
      "maximum": 0
    }
  ]
}

Response

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

quantityRulesarray<object>
incrementobject
isDefaultobject
maximumobject
minimumobject
originTypeobject
productVariantobject
userErrorsarray<object>
codeobject
fieldobject
messageobject

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

quantityRulesAdd — Shopify — Documentation