Skip to main content

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. For details and migration steps, visit our migration guide.

Learn about the changes to the product-related elements in version 2024-04 of the GraphQL and REST Admin APIs.


Anchor to New queries for variant and option resource limitsNew 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:

POST https://{shop}.myshopify.com/api/{api_version}/graphql.json

query ShopResourceLimits {
shop {
resourceLimits {
maxProductVariants
maxProductOptions
}
}
}

Anchor to Mutations for managing product options and variantsMutations for managing product options and variants

Tip

For apps with an interactive UI workflow.

Anchor to New mutations to manage product optionsNew mutations to manage product options

We've added the following mutations to the GraphQL Admin API that enable you to manage product options directly:

Anchor to Updated inputs to manage option valuesUpdated 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:


Anchor to New mutation for syncing product dataNew mutation for syncing product data

Tip

For apps with a database sync workflow.

We've added the 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. 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 mutation has an input limit of 2K variants when run asynchronously and only 100 variants when run synchronously.


Anchor to Deprecated GraphQL component fieldsDeprecated GraphQL component fields

The following table lists deprecated fields and what you should use instead.


Anchor to Deprecated REST endpointsDeprecated 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 and mutations for adding and editing data.


  • 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

{
"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"
}
]
}

New product model

Learn the relationships between products, variants, and options in the new product model and how we're making products easier to work with.

Retrieve data

Learn how to retrieve product data, including for a large number of variants.

Add data

Learn how to add product data, including variants and options.

Edit data

Learn how to edit product data, including variants and options.

Sync data

Learn how you can sync product data from an external source into Shopify.


Was this page helpful?