Hello everyone
We’re building Volume pricing and Quantity Rules into our integration.
While doing this, it seems like we are supposed to use the follow mutation: ‘quantityPricingByVariantUpdate’ (We’re running on 2024-10)
When we’re setting price breaks for the variants we’d like the price break Ids returned. This allows us to remove them later on if needed.
This can be done with the following mutation:
mutation CatalogProductEditorQuantityPricingByVariantUpdateMutation($priceListId: ID!, $pricesToDeleteByVariantId: [ID!]!, $quantityPriceBreaksToAdd: [QuantityPriceBreakInput!]!, $quantityPriceBreaksToDelete: [ID!]!, $pricesToAdd: [PriceListPriceInput!]!, $quantityRulesToAdd: [QuantityRuleInput!]!, $quantityRulesToDeleteByVariantId: [ID!]!) {
quantityPricingByVariantUpdate(
priceListId: $priceListId
input: {pricesToAdd: $pricesToAdd, pricesToDeleteByVariantId: $pricesToDeleteByVariantId, quantityPriceBreaksToAdd: $quantityPriceBreaksToAdd, quantityPriceBreaksToDelete: $quantityPriceBreaksToDelete, quantityRulesToAdd: $quantityRulesToAdd, quantityRulesToDeleteByVariantId: $quantityRulesToDeleteByVariantId}
) {
productVariants {
price
contextualPricing(
context: {companyLocationId: "gid://shopify/CompanyLocation/123"}
) {
quantityPriceBreaks(first: 10) {
edges {
cursor
node {
id
minimumQuantity
}
}
}
}
}
userErrors {
message
code
field
}
}
}
However, why is ‘companyLocationId’ required to get the price breaks? A catalog can exist without any company locations attached, so can price breaks. A price break Id will be the same regardless of the company location Id injected in the context. Are there any workarounds for this? You can speculate that sometimes there will be some time from a Catalog is created to a Company Location is connected. You might even want to ensure that all price breaks are applied, before the catalog is visible to the b2b customer. Anyone else has been working with price breaks that came to another solution?
Thanks!