Version 2025-07 is the last API version to support React-based UI components. Later versions use web components, native UI elements with built-in accessibility, better performance, and consistent styling with Shopify's design system. Check out the migration guide to upgrade your extension.
Resource Picker API
The Resource Picker API lets merchants search for and select products, collections, or product variants. Use this API when your extension needs merchants to choose Shopify resources to work with. The resource picker returns detailed resource information including IDs, titles, images, and metadata.
If you need to pick app-specific resources like product reviews, email templates, or subscription options, use the Picker API instead.
If you need to pick app-specific resources like product reviews, email templates, or subscription options, use the Picker API instead.
Anchor to Use casesUse cases
- Resource selection: Display resource picker interfaces for selecting Shopify resources.
- Product selection: Enable product selection in bundle or collection configuration workflows.
- Customer selection: Select customers for targeting or segmentation purposes.
- Bulk selection: Support bulk resource selection for batch operations.
Anchor to PropertiesProperties
The object defines how the resource picker behaves, including which resource type to display, selection limits, filters, and preselected items. Access the following properties on the object to configure the resource picker's appearance and functionality.
- Anchor to typetypetype'product' | 'variant' | 'collection''product' | 'variant' | 'collection'requiredrequired
The type of Shopify resource to select:
'product'for products,'variant'for specific product variants, or'collection'for collections. This determines what appears in the picker and what data structure is returned.- Anchor to actionactionaction'add' | 'select''add' | 'select'Default: 'add'Default: 'add'
The action verb that appears in the picker's title and primary button. Use
'add'for actions that add new items (for example, "Add products") or'select'for choosing existing items (for example, "Select products"). This helps merchants understand the picker's purpose.- Anchor to filterfilterfilterFiltersFilters
Filtering options that control which resources appear in the picker. Use filters to restrict resources by publication status, include or exclude variants, or apply custom search criteria. This helps merchants find relevant items faster.
- Anchor to multiplemultiplemultipleboolean | numberboolean | numberDefault: falseDefault: false
The selection mode for the picker. Pass
trueto allow unlimited selections,falsefor single-item selection only, or a number to set a maximum selection limit (for example,5allows up to five items). Whentypeis'product', merchants can still select multiple variants from a single product even ifmultipleisfalse.- Anchor to queryqueryquerystringstringDefault: ''Default: ''
An initial search query that appears in the picker's search bar when it opens. Merchants can see and edit this query. See search syntax for the query format. For most use cases, use
filter.queryinstead, which filters results without exposing the query to merchants.- Anchor to selectionIdsselectionIdsselectionIdsBaseResource[]BaseResource[]Default: []Default: []
Resources that should be preselected when the picker opens. Pass an array of resource objects with IDs (and optional variant IDs) to show which items are already selected. Merchants can deselect these preselected items. Use this to show current selections or default choices.
Filters
Filter options that control which resources appear in the resource picker. Use filters to restrict the available resources based on publication status, resource type, or custom search criteria.
- archived
Whether to include archived products in the picker. When `false`, archived products are hidden. When `undefined`, archived products appear with an archived badge. Only applies when `type` is `'product'`. Use this to prevent selecting discontinued products.
boolean | undefined - draft
Whether to include draft products in the picker. When `false`, draft products are hidden. When `undefined`, draft products appear with a draft badge. Only applies when `type` is `'product'`. Use this to prevent selecting products that aren't ready for use.
boolean | undefined - hidden
Whether to include products that aren't published on any sales channels. When `false`, only products published to at least one sales channel appear in the picker. Use this to ensure merchants only select products that customers can purchase.
boolean - query
A GraphQL search query that filters the available resources without showing the query in the picker's search bar. Merchants won't see or edit this filter. See [search syntax](/docs/api/usage/search-syntax) for the query format. Use this to programmatically restrict resources based on attributes like tags, vendor, or product type (for example, `"tag:featured"` or `"vendor:Acme"`).
string - variants
Whether to show product variants in the picker. When `false`, merchants can only select products, not individual variants. Only applies when `type` is `'product'`. Use this to simplify selection when you only need product-level data.
boolean
BaseResource
A resource that can have associated variants. Products and collections extend this interface.
- id
The resource's unique global identifier (GID) in GraphQL format (for example, `'gid://shopify/Product/1'`). Use this to reference the resource in GraphQL queries.
string - variants
An array of variant resources associated with this resource. Use this for products that have multiple variants with different options.
Resource[]
Resource
A base resource with a unique identifier. All Shopify resources extend from this interface.
- id
The resource's unique global identifier (GID) in GraphQL format (for example, `'gid://shopify/Product/1'`). Use this to reference the resource in GraphQL queries.
string
Anchor to ResourcePicker return payloadResource Picker return payload
The resource picker returns an array of selected resources when the merchant confirms their selection, or undefined if they cancel. The resource structure in the array varies based on the type option: products include variants and images, collections include rule sets, and variants include pricing and inventory data.
SelectPayload<Type>SelectPayload<Type>SelectPayload
Anchor to Best practicesBest practices
- Filter query runs server-side: The
queryproperty in filters isn't visible to merchants and runs as a GraphQL search query. Use it to programmatically restrict results (for example,vendor:Acme) without exposing the filter logic. - Handle undefined return on cancellation: When merchants close the picker without selecting, it returns
undefinedrather than an empty array. Check forundefinedexplicitly.
Anchor to LimitationsLimitations
- Only products, variants, and collections are supported. Other resource types like customers, orders, or locations can't be selected. Use the Picker API for custom resources.
- Product selection with
multiple: falsedoesn't prevent multi-variant selection from the same product. Merchants can select multiple variants from a single product even whenmultiple: false. - Filter options are limited to predefined fields (
hidden,variants,draft,archived,query). Custom filter criteria beyond these aren't supported. - Returned data structure varies by resource type. Products include a
variantsarray, variants includepriceandinventoryQuantity, and collections includeruleSet.