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.

error on updating delivery profile with graphql api

error on updating delivery profile with graphql api

Antonio84
Shopify Partner
51 1 3

Hello I am getting error when I try to associate a variant to a delivery profile, I am using python, this is the code:

query = """
            mutation deliveryProfileUpdate($id: ID!, $profile: DeliveryProfileInput!) 
                {  
                    deliveryProfileUpdate(id: $id, profile: $profile) 
                    {    
                        profile {      
                            id    
                        }    
                        userErrors {      
                            field      
                            message    
                        }
                    }
                }  
            """
        variables = {
            "id":"gid://shopify/DeliveryProfile/DID",
            "profile":{
                "variantsToAssociate":"gid://shopify/ProductVariant/VID"
            }
        }
        result = shopify.GraphQL().execute(query, variables=variables)

This is the error message:

[{'field': None, 'message': 'Profile could not be updated.'}]
Replies 2 (2)

JamesG
Shopify Staff
42 10 11

Hey @Antonio84 

 

I'm able to add and remove variants to my test stores' delivery profiles using the deliveryProfileUpdate mutation and the Shopify Python API library.

 

Have you tried making the same request in an HTTP client like Postman or Insomnia? Can you update other delivery profiles on your store?

 

We can't provide authenticated support in the forums, but if there's something specific about one of the deliveryProfiles on your store that cannot be updated I'd recommend reaching out to our support directly with an example.  

 

Cheers

JamesG | API Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

edweis
Shopify Partner
16 0 4

I have this issue; it happens when you update the delivery profile too often.

I guess they throttle API calls for this mutation to allow only 1 call per 30 seconds roughly.