Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

how obtain QuantityPriceBreak ID's

how obtain QuantityPriceBreak ID's

karat
Shopify Partner
1 0 0

Hi,

I am updating quantityPriceBreaks by mutation quantityPricingByVariantUpdate https://shopify.dev/docs/api/admin-graphql/2024-07/mutations/quantityPricingByVariantUpdate

but I don't know how return ID's of quantity price breaks which I need for deleting

by field quantityPriceBreaksToDelete.

 

mutation {
	quantityPricingByVariantUpdate(
		priceListId: "gid://shopify/PriceList/34456338679"
		input: {
			pricesToAdd: []
			pricesToDeleteByVariantId: []
			quantityPriceBreaksToAdd: [
				{
					variantId: "gid://shopify/ProductVariant/49036853477623"
					price: { amount: 8.7, currencyCode: EUR }
					minimumQuantity: 10
				}
				{
					variantId: "gid://shopify/ProductVariant/49036853477623"
					price: { amount: 7.1, currencyCode: EUR }
					minimumQuantity: 11
				}
				{
					variantId: "gid://shopify/ProductVariant/49036853510391"
					price: { amount: 3.7, currencyCode: EUR }
					minimumQuantity: 5
				}
			]
			quantityPriceBreaksToDelete: []
			quantityRulesToAdd: []
			quantityRulesToDeleteByVariantId: []
		}
	) {
		productVariants {
			id
		}
	}
}

 

karat_0-1726577007703.png

 

 

Replies 2 (2)

JT35
Shopify Partner
5 0 0

I'd also like to know this answer.

JT35
Shopify Partner
5 0 0

The documentation demonstrates a return payload, after some guessing I added "ID"  to the nodes and it appears to return an id

gid://shopify/QuantityPriceBreak/somenumber

 

My new question is where do you get the company location id (companyLocationId) input if you're not doing pricing for specific company locations.

 

I'm sure no one will answer here... if I figure it out I'll post again

 

productVariants {
id
contextualPricing(context: {companyLocationId: $companyLocationId}) {
quantityPriceBreaks(first: 1) {
nodes {

id
minimumQuantity
price {
amount
currencyCode
}
}
}