Have your say in Community Polls: What was/is your greatest motivation to start your own business?
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.

Unable to update Fixed Price List via GQL priceListFixedPricesByProductUpdate

Unable to update Fixed Price List via GQL priceListFixedPricesByProductUpdate

dmaithonis
Shopify Partner
1 0 0

Hi, I'm trying use a shopify catalog to manage a separate price scheme for our wholesale customers.  I figured I could just add every item with a fixed price to that catalog so that way wholesale customers would get that catalog price aka the wholesale price.

 

I'm using https://shopify.dev/docs/api/admin-graphql/unstable/mutations/priceListFixedPricesByProductUpdate

 

This is the error I'm getting:

 

{"priceListFixedPricesByProductUpdate":{"priceList":null,"pricesToAddProducts":null,"pricesToDeleteProducts":null,"userErrors":[{"field":null,"message":"No update operations are specified. `pricesToAdd` and `pricesToDeleteByProductIds` 
are empty."}]}}

 

 

And here's my code:

 

async function mutation_UpdateCatalogPrice(productId,wsprice){

    const UPDATE_CATALOG_PRICE = gql`
        mutation priceListFixedPricesByProductUpdate($priceListId: ID!) {
            priceListFixedPricesByProductUpdate(priceListId: $priceListId) {
                priceList {
                    id
                }
                pricesToAddProducts {
                    id
                }
                pricesToDeleteProducts {
                    id
                }
                userErrors {
                    field
                    message
                }
            }
        }
    `
    
    const inputVariables = {
        "priceListId": "gid://shopify/PriceList/30721769755",
        "pricesToAdd": [
            {
            "price": {
                "amount": wsprice,
                "currencyCode": "USD"
            },
            "productId": productId
            }
        ]
    }

    const queryData1 = await gqlc.graphQLClient.request(UPDATE_CATALOG_PRICE, inputVariables)
    console.log(JSON.stringify(queryData1))
    return 
}

 

 

I've got dozens of other query set up like this but the error I'm getting doesn't make sense. I have "pricesToAdd" in my variables but it says very clearly that it doesn't see it.  I tried passing it into the query in other ways with still no luck.  I'm on 2023-07.  I've also got the correct scopes I think... I'm not sure what

 

"Also: The shop has the international_price_overrides or Markets or B2B features enabled, or the user has edit product price permissions."

means but I'm sure I have it.

 

I appreciate any help, thanks!

Replies 0 (0)