--- title: API updates description: Learn the changes to the product-related elements in the GraphQL and REST Admin APIs. source_url: html: https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/api-updates md: https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/api-updates.md --- ExpandOn this page * [New queries for variant and option resource limits](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/api-updates#new-queries-for-variant-and-option-resource-limits) * [Mutations for managing product options and variants](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/api-updates#mutations-for-managing-product-options-and-variants) * [New mutation for syncing product data](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/api-updates#new-mutation-for-syncing-product-data) * [Deprecated Graph​QL component fields](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/api-updates#deprecated-graphql-component-fields) * [Deprecated REST endpoints](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/api-updates#deprecated-rest-endpoints) * [Webhook updates](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/api-updates#webhook-updates) * [Next steps](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/api-updates#next-steps) # API updates Legacy The REST Admin API is a legacy API as of October 1, 2024. All apps and integrations should be built with the [GraphQL Admin API](https://shopify.dev/docs/api/admin-graphql). For details and migration steps, visit our [migration guide](https://shopify.dev/docs/apps/build/graphql/migrate). Learn about the changes to the product-related elements in version 2024-04 of the GraphQL and REST Admin APIs. *** ## New queries for variant and option resource limits To determine the total number of variants and options that can be added to each product in a shop, you can now query a shop's product variants and options resource limits using [`ShopResourceLimits`](https://shopify.dev/docs/api/admin-graphql/unstable/objects/ShopResourceLimits): ## POST https\://{shop}.myshopify.com/api/{api\_version}/graphql.json ```graphql query ShopResourceLimits { shop { resourceLimits { maxProductVariants maxProductOptions } } } ``` *** ## Mutations for managing product options and variants Tip For apps with an [interactive UI workflow](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/product-model-components#interactive-ui-workflow). ### New mutations to manage product options We've added the following mutations to the GraphQL Admin API that enable you to manage product options directly: * [`productOptionsCreate`](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/productOptionsCreate) * [`productOptionUpdate`](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/productOptionUpdate) * [`productOptionsReorder`](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/productOptionsReorder) * [`productOptionsDelete`](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/productOptionsDelete) ### Updated inputs to manage option values To manage option values with the new product model, we've added an `optionValues` field to the variants input on the following mutations in the GraphQL Admin API: * [`productVariantsBulkCreate`](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/productVariantsBulkCreate#argument-variants) * [`productVariantsBulkUpdate`](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/productVariantsBulkUpdate#argument-variants) We've also added a `productOptions` field to the input on the [`productCreate`](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/productCreate#argument-input) mutation. *** ## New mutation for syncing product data Tip For apps with a [database sync workflow](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/product-model-components#database-sync-workflow). We've added the [`productSet`](https://shopify.dev/docs/api/admin-graphql/unstable/mutations/productSet) mutation to the GraphQL Admin API, to create and update the state of a product per an external database. The mutation is available to sync in both [asynchronous and synchronous modes](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/sync-data). It has a `productOption` and a `variants` input. The `variants` input has an `optionValues` input for pulling product and variant data from the external database. Use this mutation when you're managing the state of the product model outside of Shopify, and want to update Shopify's product model state to reflect your external state. Examples are Enterprise Resource Planning (ERP) systems and Worksheets. The [`productSet`](https://shopify.dev/docs/api/admin-graphql/latest/mutations/productSet) mutation has an input limit of 2K variants when run asynchronously and only 100 variants when run synchronously. *** ## Deprecated Graph​QL component fields The following table lists deprecated fields and what you should use instead. | Component | Deprecated | Use instead | | - | - | - | | `productCreate` | `ProductInput.options` field | `ProductInput.productOptions` field | | `productCreate` | `ProductInput.variants` field | `productVariantsBulkCreate` | | `productUpdate` | `ProductInput.options` field | * `productOptionsCreate` * `productOptionUpdate` * `productOptionsReorder` * `productOptionsDelete` | | `productUpdate` | `ProductInput.variants` field | - `productVariantsBulkCreate` - `productVariantsBulkUpdate` - `productVariantsBulkDelete` - `productVariantsBulkReorder` | | `productVariantsBulkCreate` | `variants.options` field | `variants.optionValues` field | | `productVariantsBulkUpdate` | `variants.options` field | `variants.optionValues` field | | `ProductInput` | `images` field | Learn more about [managing media](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/product-model-components#asynchronous-media-management). | *** ## Deprecated REST endpoints The following REST endpoints and their operations are being deprecated: * `products` * `products/{product-id}/variants` Learn more about addressing your use cases with the GraphQL Admin API's queries for [retrieving data](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/retrieve-data) and mutations for [adding](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/add-data) and [editing](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/edit-data) data. *** ## Webhook updates * A `variant_gids` field will be retroactively added to all webhook versions. The field will list all variant GIDs in the format `variant_gids: [{admin_graphql_api_id: ID!}]`. * Product webhooks will return a full variants payload for the first 100 records. For variants 101+, the payload won't include the full variant details, but the `variant_gids` field will still be included for these variants. The following is an example payload: ## Example webhook payload for product variant data ```json { "variants": [ { "admin_graphql_api_id": "gid://shopify/ProductVariant/46610383339576", "barcode": null, "compare_at_price": "12.00", "created_at": "2024-01-18T18:16:09+01:00", "fulfillment_service": "manual", "id": 46610383339576, "inventory_management": null, "inventory_policy": "deny", "position": 1, "price": "0.00", "product_id": 8685870907448, "sku": "", "taxable": true, "title": "Red / Testing1 / Size-test-1", "updated_at": "2024-01-31T10:56:05+01:00", "option1": "Red", "option2": "Testing1", "option3": "Size-test-1", "grams": 0, "image_id": null, "weight": 0, "weight_unit": "g", "inventory_item_id": 48657068654648, "inventory_quantity": 0, "old_inventory_quantity": 0, "requires_shipping": true } ], "variant_gids": [ { "admin_graphql_api_id": "gid://shopify/ProductVariant/46610383339576", "updated_at": "2024-01-31T10:56:05+01:00" } ] } ``` *** ## Next steps [![](https://shopify.dev/images/icons/48/growth.png)![](https://shopify.dev/images/icons/48/growth-dark.png)](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/product-model-components) [New product model](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/product-model-components) [Learn the relationships between products, variants, and options in the new product model and how we're making products easier to work with.](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/product-model-components) [![](https://shopify.dev/images/icons/48/graphql.png)![](https://shopify.dev/images/icons/48/graphql-dark.png)](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/retrieve-data) [Retrieve data](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/retrieve-data) [Learn how to retrieve product data, including for a large number of variants.](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/retrieve-data) [![](https://shopify.dev/images/icons/48/graphql.png)![](https://shopify.dev/images/icons/48/graphql-dark.png)](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/add-data) [Add data](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/add-data) [Learn how to add product data, including variants and options.](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/add-data) [![](https://shopify.dev/images/icons/48/graphql.png)![](https://shopify.dev/images/icons/48/graphql-dark.png)](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/edit-data) [Edit data](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/edit-data) [Learn how to edit product data, including variants and options.](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/edit-data) [![](https://shopify.dev/images/icons/48/graphql.png)![](https://shopify.dev/images/icons/48/graphql-dark.png)](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/sync-data) [Sync data](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/sync-data) [Learn how you can sync product data from an external source into Shopify.](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/sync-data) *** * [New queries for variant and option resource limits](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/api-updates#new-queries-for-variant-and-option-resource-limits) * [Mutations for managing product options and variants](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/api-updates#mutations-for-managing-product-options-and-variants) * [New mutation for syncing product data](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/api-updates#new-mutation-for-syncing-product-data) * [Deprecated Graph​QL component fields](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/api-updates#deprecated-graphql-component-fields) * [Deprecated REST endpoints](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/api-updates#deprecated-rest-endpoints) * [Webhook updates](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/api-updates#webhook-updates) * [Next steps](https://shopify.dev/docs/apps/build/graphql/migrate/new-product-model/api-updates#next-steps)