Skip to main content

Resource Picker API

The Resource Picker API lets merchants search for and select products, collections, or product variants. Use this API when your app needs merchants to choose Shopify resources to work with. The resource picker returns detailed resource information including IDs, titles, images, and metadata.

Tip

If you need to pick app-specific resources like product reviews, email templates, or subscription options, use the Picker API instead.

  • Product selection: Help users find and select products from the store catalog.
  • Collection selection: Allow users to pick collections for promotions, automations, or display.
  • Variant selection: Enable selection of specific product variants for targeted operations.
  • Permission-aware: Select resources that both the app and the user have permissions to access.

The ResourcePickerOptions object defines how the resource picker behaves, including which resource type to display, selection limits, filters, and preselected items.

ResourceType
required

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 action
action
'add' | 'select'
Default: 'add'

The action verb that appears in the title as the primary action of the resource picker. "Add" prompts merchants that they are appending to an existing list, while "select" they'll choose a resource for a specific purpose or replacing selections.

Anchor to filter
filter

Filtering options that control which resources appear in the resourcepicker. 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 multiple
multiple
boolean | number
Default: false

Whether to allow selecting multiple items of a specific type. If a number is provided, limit selections to that maximum. When type is 'product', merchants can still select multiple variants from a single product even when multiple is false.

Anchor to query
query
string
Default: ''

Initial GraphQL search query for filtering resources available in the resource picker. See search syntax for more information. This is displayed in the search bar when the picker is opened and can be edited by users. For most use cases, you should use the filter.query option instead which doesn't show the query in the UI.

Anchor to selectionIds
selectionIds
[]
Default: []

Resources that should be preselected when the picker is opened. Use this for edit workflows to show what products are already in a bundle, collection, or promotional set. Merchants can see current selections and modify them before confirming.

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.

Anchor to when type is "collection":
when type is "collection":
[]
Anchor to when type is "product":
when type is "product":
[]
Anchor to when type is "variant":
when type is "variant":
[]

Was this page helpful?