Adding products (or variants) to a Shipping Profile with api

Topic summary

A developer is attempting to assign products or variants to specific Shipping Profiles using Shopify’s GraphQL API (v2025-07) but encountering errors.

Problem encountered:

  • Using productUpdate mutation with deliveryProfileId parameter returns error: “InputObject ‘ProductInput’ doesn’t accept argument ‘deliveryProfileId’”
  • Also tried variantsToAssociate with the same negative result

Use case:
The goal is to assign different shipping profiles to different products so that when customers purchase items with different profiles, shipping costs are calculated separately (doubled in the checkout for two different profiles).

Current status:
The question remains unanswered - seeking guidance on the correct GraphQL approach to programmatically associate products/variants with delivery profiles.

Summarized with AI on October 27. AI used: claude-sonnet-4-5-20250929.

Hi,

I am trying to add products (or variants) to a Shipping Profile using GraphQL v2025-07.

According to Shopify’s documentation AI I should be able to use productUpdate mutation with:

input: {
id: “gid://shopify/Product/1234567890”
deliveryProfileId: “gid://shopify/DeliveryProfile/987654321”
}

But I got “InputObject ‘ProductInput’ doesn’t accept argument ‘deliveryProfileId’”

I also tried variantsToAssociate, with the same response.

I need to be able to set different Shipping Profiles for different products, so the checkout double the shipping if 2 products with 2 different Shipping Profiles are bought.

How can I achieve this with GraphQL?

With kind regards, Johan.

Try https://shopify.dev/docs/api/admin-graphql/latest/mutations/deliveryprofileupdate#arguments-profile.fields.variantsToAssociate

Hey @johstrom,

Can you try with this format instead?

mutation {
  deliveryProfileUpdate(
    id: "gid://shopify/DeliveryProfile/987654321"
    profile: {
      variantsToAssociate: ["gid://shopify/ProductVariant/456789"]
    }
  ) {
    profile {
      id
    }
    userErrors {
      field
      message
    }
  }
}

Thanks, that worked!

Strange that Shopify AI documentation couldn’t figure this out!

“AI” is a probabilistic system DO NOT use it in place of actual expertise.
Only use it as a starting point, boilerplate, you then first and immediately back up with ACTUAL documentation.

Nonsense is the core feature of LLMs, factual output is a side-effect when it happens.

1 Like