--- title: >- We're making changes to how variants are matched with options when products are updated. - Shopify developer changelog description: >- Shopify’s developer changelog documents all changes to Shopify’s platform. Find the latest news and learn about new platform opportunities. source_url: html: >- https://shopify.dev/changelog/we-re-making-changes-to-how-variants-are-matched-with-options-when-products-are-updated md: >- https://shopify.dev/changelog/we-re-making-changes-to-how-variants-are-matched-with-options-when-products-are-updated.md metadata: effectiveApiVersion: '' affectedApi: [] primaryTag: displayName: API handle: api secondaryTag: displayName: Update handle: update indicatesActionRequired: false createdAt: '2019-05-13T14:57:20-04:00' postedAt: '2019-06-03T00:00:00-04:00' updatedAt: '2024-02-02T10:04:53-05:00' effectiveAt: '2019-06-03T00:00:00-04:00' --- June 3, 2019 Tags: * API # We're making changes to how variants are matched with options when products are updated. ## We're making a change to how variants are matched based on any given options when you update products. Although we don't expect this change to impact existing apps, please review the following information to make sure that your own apps don't include any use cases that might be affected. Currently, our [Product Update endpoint](https://help.shopify.com/en/api/reference/products/product-variant#update) takes a variant ID as an optional argument when you update a variant. If you provide an ID in your request, then the existing variant with that matching ID is updated as expected. However, if you don't provide a variant ID, then Shopify will attempt to search for the variant that you want to update based on matching on the options provided (such as **"option1": "Small"**). If we find a matching variant with all of the provided options, then we delete the existing variant, and create a new variant with all the previous and newly updated information from the API call. This results in a new variant with a unique ID. The following example shows a product update API call where a variant ID isn’t supplied: ``` PUT /admin/api/2019-04/products/#{product_id}.json { "product": { "id": 632910392, "variants": [ { "sku": "Updating the Product SKU", "option1": "Small" # we will attempt to match any variant with this option. } ] } } ``` ### What’s changing? As of June 3, 2019, if you don’t pass a variant ID in a product update API call, then we will update the related variant if it matches the provided options rather than deleting it and creating a new one. The variant that's returned in the product update call will have the same ID as the previously existing one, rather than a new ID. If we can't determine a match based on the provided options, then a new variant is created with a unique ID. **From an API point of view, the variant returned in the product update call will have the same ID as the previously existing one, rather than a new ID.** We do not expect this to have any negative impact on existing apps. However, if you have any concerns or questions about this change, then contact us through your [Partner Dashboard](https://partners.shopify.com/current/support/form) or in our [API forums](https://community.shopify.com/c/Shopify-APIs-SDKs/bd-p/shopify-apis-and-technology).