Resource Picker
The Resource Picker API provides a search-based interface to help users find and select one or more products, collections, or product variants, and then returns the selected resources to your app. Both the app and the user must have the necessary permissions to access the resources selected.
If you are picking app resources such as product reviews, email templates, or subscription options, you should use the Picker API instead.
Anchor to resource picker optionsResource Picker Options
The Resource Picker
accepts a variety of options to customize the picker's behavior.
- Anchor to typetype'product' | 'variant' | 'collection'required
The type of resource you want to pick.
- Anchor to actionaction'add' | 'select'Default: 'add'
The action verb appears in the title and as the primary action of the Resource Picker.
- Anchor to filterfilter
Filters for what resource to show.
- Anchor to multiplemultipleboolean | numberDefault: false
Whether to allow selecting multiple items of a specific type or not. If a number is provided, then limit the selections to a maximum of that number of items. When type is Product, the user may still select multiple variants of a single product, even if multiple is false.
- Anchor to queryquerystringDefault: ''
GraphQL initial search query for filtering resources available in the 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 selectionIdsselectionIds[]Default: []
Resources that should be preselected when the picker is opened.
ResourcePickerOptions
- action
The action verb appears in the title and as the primary action of the Resource Picker.
'add' | 'select'
- filter
Filters for what resource to show.
Filters
- multiple
Whether to allow selecting multiple items of a specific type or not. If a number is provided, then limit the selections to a maximum of that number of items. When type is Product, the user may still select multiple variants of a single product, even if multiple is false.
boolean | number
- query
GraphQL initial search query for filtering resources available in the picker. See [search syntax](https://shopify.dev/docs/api/usage/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.
string
- selectionIds
Resources that should be preselected when the picker is opened.
BaseResource[]
- type
The type of resource you want to pick.
'product' | 'variant' | 'collection'
export interface ResourcePickerOptions {
/**
* The type of resource you want to pick.
*/
type: 'product' | 'variant' | 'collection';
/**
* The action verb appears in the title and as the primary action of the Resource Picker.
* @defaultValue 'add'
*/
action?: 'add' | 'select';
/**
* Filters for what resource to show.
*/
filter?: Filters;
/**
* Whether to allow selecting multiple items of a specific type or not. If a number is provided, then limit the selections to a maximum of that number of items. When type is Product, the user may still select multiple variants of a single product, even if multiple is false.
* @defaultValue false
*/
multiple?: boolean | number;
/**
* GraphQL initial search query for filtering resources available in the picker. See [search syntax](https://shopify.dev/docs/api/usage/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.
* @defaultValue ''
*/
query?: string;
/**
* Resources that should be preselected when the picker is opened.
* @defaultValue []
*/
selectionIds?: BaseResource[];
}
Filters
- archived
Whether to show [archived products](https://help.shopify.com/en/manual/products/details?shpxid=70af7d87-E0F2-4973-8B09-B972AAF0ADFD#product-availability). Only applies to the Product resource type picker. Setting this to undefined will show a badge on draft products.
boolean | undefined
- draft
Whether to show [draft products](https://help.shopify.com/en/manual/products/details?shpxid=70af7d87-E0F2-4973-8B09-B972AAF0ADFD#product-availability). Only applies to the Product resource type picker. Setting this to undefined will show a badge on draft products.
boolean | undefined
- hidden
Whether to show hidden resources, referring to products that are not published on any sales channels.
boolean
- query
GraphQL initial search query for filtering resources available in the picker. See [search syntax](https://shopify.dev/docs/api/usage/search-syntax) for more information. This is not displayed in the search bar when the picker is opened.
string
- variants
Whether to show product variants. Only applies to the Product resource type picker.
boolean
interface Filters {
/**
* Whether to show hidden resources, referring to products that are not published on any sales channels.
* @defaultValue true
*/
hidden?: boolean;
/**
* Whether to show product variants. Only applies to the Product resource type picker.
* @defaultValue true
*/
variants?: boolean;
/**
* Whether to show [draft products](https://help.shopify.com/en/manual/products/details?shpxid=70af7d87-E0F2-4973-8B09-B972AAF0ADFD#product-availability).
* Only applies to the Product resource type picker.
* Setting this to undefined will show a badge on draft products.
* @defaultValue true
*/
draft?: boolean | undefined;
/**
* Whether to show [archived products](https://help.shopify.com/en/manual/products/details?shpxid=70af7d87-E0F2-4973-8B09-B972AAF0ADFD#product-availability).
* Only applies to the Product resource type picker.
* Setting this to undefined will show a badge on draft products.
* @defaultValue true
*/
archived?: boolean | undefined;
/**
* GraphQL initial search query for filtering resources available in the picker.
* See [search syntax](https://shopify.dev/docs/api/usage/search-syntax) for more information.
* This is not displayed in the search bar when the picker is opened.
*/
query?: string;
}
BaseResource
- id
in GraphQL id format, ie 'gid://shopify/Product/1'
string
- variants
Resource[]
interface BaseResource extends Resource {
variants?: Resource[];
}
Resource
- id
in GraphQL id format, ie 'gid://shopify/Product/1'
string
interface Resource {
/** in GraphQL id format, ie 'gid://shopify/Product/1' */
id: string;
}
Anchor to resource picker return payloadResource Picker Return Payload
The Resource Picker
returns a Promise with an array of the selected resources. The object type in the array varies based on the provided type
option.
If the picker is cancelled, the Promise resolves to undefined
- 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":[]
ReturnPayload
- when type is "collection":
Collection[]
- when type is "product":
Product[]
- when type is "variant":
ProductVariant[]
interface ReturnPayload {
['when type is "product":']?: Product[];
['when type is "variant":']?: ProductVariant[];
['when type is "collection":']?: Collection[];
}
Collection
- availablePublicationCount
number
- description
string
- descriptionHtml
string
- handle
string
- id
in GraphQL id format, ie 'gid://shopify/Product/1'
string
- image
Image | null
- productsAutomaticallySortedCount
number
- productsCount
number
- productsManuallySortedCount
number
- publicationCount
number
- ruleSet
RuleSet | null
- seo
{ description?: string; title?: string; }
- sortOrder
CollectionSortOrder
- storefrontId
string
- templateSuffix
string | null
- title
string
- updatedAt
string
export interface Collection extends Resource {
availablePublicationCount: number;
description: string;
descriptionHtml: string;
handle: string;
id: string;
image?: Image | null;
productsAutomaticallySortedCount: number;
productsCount: number;
productsManuallySortedCount: number;
publicationCount: number;
ruleSet?: RuleSet | null;
seo: {
description?: string | null;
title?: string | null;
};
sortOrder: CollectionSortOrder;
storefrontId: string;
templateSuffix?: string | null;
title: string;
updatedAt: string;
}
Image
- altText
string
- id
string
- originalSrc
string
interface Image {
id: string;
altText?: string;
originalSrc: string;
}
RuleSet
- appliedDisjunctively
boolean
- rules
CollectionRule[]
interface RuleSet {
appliedDisjunctively: boolean;
rules: CollectionRule[];
}
CollectionRule
- column
string
- condition
string
- relation
string
interface CollectionRule {
column: string;
condition: string;
relation: string;
}
CollectionSortOrder
- Manual
MANUAL
- BestSelling
BEST_SELLING
- AlphaAsc
ALPHA_ASC
- AlphaDesc
ALPHA_DESC
- PriceDesc
PRICE_DESC
- PriceAsc
PRICE_ASC
- CreatedDesc
CREATED_DESC
- Created
CREATED
- MostRelevant
MOST_RELEVANT
enum CollectionSortOrder {
Manual = 'MANUAL',
BestSelling = 'BEST_SELLING',
AlphaAsc = 'ALPHA_ASC',
AlphaDesc = 'ALPHA_DESC',
PriceDesc = 'PRICE_DESC',
PriceAsc = 'PRICE_ASC',
CreatedDesc = 'CREATED_DESC',
Created = 'CREATED',
MostRelevant = 'MOST_RELEVANT',
}
Product
- availablePublicationCount
number
- createdAt
string
- descriptionHtml
string
- handle
string
- hasOnlyDefaultVariant
boolean
- id
in GraphQL id format, ie 'gid://shopify/Product/1'
string
- images
Image[]
- options
{ id: string; name: string; position: number; values: string[]; }[]
- productType
string
- publishedAt
string | null
- status
ProductStatus
- tags
string[]
- templateSuffix
string | null
- title
string
- totalInventory
number
- totalVariants
number
- tracksInventory
boolean
- updatedAt
string
- variants
Partial<ProductVariant>[]
- vendor
string
export interface Product extends Resource {
availablePublicationCount: number;
createdAt: string;
descriptionHtml: string;
handle: string;
hasOnlyDefaultVariant: boolean;
images: Image[];
options: {
id: string;
name: string;
position: number;
values: string[];
}[];
productType: string;
publishedAt?: string | null;
tags: string[];
templateSuffix?: string | null;
title: string;
totalInventory: number;
totalVariants: number;
tracksInventory: boolean;
variants: Partial<ProductVariant>[];
vendor: string;
updatedAt: string;
status: ProductStatus;
}
ProductStatus
- Active
ACTIVE
- Archived
ARCHIVED
- Draft
DRAFT
enum ProductStatus {
Active = 'ACTIVE',
Archived = 'ARCHIVED',
Draft = 'DRAFT',
}
ProductVariant
- availableForSale
boolean
- barcode
string | null
- compareAtPrice
Money | null
- createdAt
string
- displayName
string
- fulfillmentService
{ id: string; inventoryManagement: boolean; productBased: boolean; serviceName: string; type: FulfillmentServiceType; }
- id
in GraphQL id format, ie 'gid://shopify/Product/1'
string
- image
Image | null
- inventoryItem
{ id: string; }
- inventoryManagement
ProductVariantInventoryManagement
- inventoryPolicy
ProductVariantInventoryPolicy
- inventoryQuantity
number | null
- position
number
- price
Money
- product
Partial<Product>
- requiresShipping
boolean
- selectedOptions
{ value?: string; }[]
- sku
string | null
- taxable
boolean
- title
string
- updatedAt
string
- weight
number | null
- weightUnit
WeightUnit
export interface ProductVariant extends Resource {
availableForSale: boolean;
barcode?: string | null;
compareAtPrice?: Money | null;
createdAt: string;
displayName: string;
fulfillmentService?: {
id: string;
inventoryManagement: boolean;
productBased: boolean;
serviceName: string;
type: FulfillmentServiceType;
};
image?: Image | null;
inventoryItem: {id: string};
inventoryManagement: ProductVariantInventoryManagement;
inventoryPolicy: ProductVariantInventoryPolicy;
inventoryQuantity?: number | null;
position: number;
price: Money;
product: Partial<Product>;
requiresShipping: boolean;
selectedOptions: {value?: string | null}[];
sku?: string | null;
taxable: boolean;
title: string;
weight?: number | null;
weightUnit: WeightUnit;
updatedAt: string;
}
Money
string
FulfillmentServiceType
- GiftCard
GIFT_CARD
- Manual
MANUAL
- ThirdParty
THIRD_PARTY
enum FulfillmentServiceType {
GiftCard = 'GIFT_CARD',
Manual = 'MANUAL',
ThirdParty = 'THIRD_PARTY',
}
ProductVariantInventoryManagement
- Shopify
SHOPIFY
- NotManaged
NOT_MANAGED
- FulfillmentService
FULFILLMENT_SERVICE
enum ProductVariantInventoryManagement {
Shopify = 'SHOPIFY',
NotManaged = 'NOT_MANAGED',
FulfillmentService = 'FULFILLMENT_SERVICE',
}
ProductVariantInventoryPolicy
- Deny
DENY
- Continue
CONTINUE
enum ProductVariantInventoryPolicy {
Deny = 'DENY',
Continue = 'CONTINUE',
}
WeightUnit
- Kilograms
KILOGRAMS
- Grams
GRAMS
- Pounds
POUNDS
- Ounces
OUNCES
enum WeightUnit {
Kilograms = 'KILOGRAMS',
Grams = 'GRAMS',
Pounds = 'POUNDS',
Ounces = 'OUNCES',
}
Product picker
examples
Product picker
const selected = await shopify.resourcePicker({type: 'product'});
Preview

Anchor to examplesExamples
Resource Pickers with different options
Anchor to example-alternate-resourcesAlternate resources
Alternate resources
Anchor to example-product-picker-with-preselected-resourcesProduct picker with preselected resources
Preselected resources
Anchor to example-product-picker-with-action-verbProduct picker with action verb
Action verb
Anchor to example-product-picker-with-multiple-selectionProduct picker with multiple selection
Multiple selection
Anchor to example-product-picker-with-filtersProduct picker with filters
Filters
Anchor to example-product-picker-with-a-custom-filter-queryProduct picker with a custom filter query
Filter query
Anchor to example-product-picker-using-returned-selection-payloadProduct picker using returned selection payload
Selection
Anchor to example-product-picker-with-initial-query-providedProduct picker with initial query provided
Initial query
Product picker with preselected resources
examples
Alternate resources
description
Alternate resources
Collection picker
const selected = await shopify.resourcePicker({type: 'collection'});
Product variant picker
const selected = await shopify.resourcePicker({type: 'variant'});
Product picker with preselected resources
description
Preselected resources
const selected = await shopify.resourcePicker({ type: 'product', selectionIds: [ { id: 'gid://shopify/Product/12345', variants: [ { id: 'gid://shopify/ProductVariant/1', }, ], }, { id: 'gid://shopify/Product/67890', }, ], });
Product picker with action verb
description
Action verb
const selected = await shopify.resourcePicker({ type: 'product', action: 'select', });
Product picker with multiple selection
description
Multiple selection
Unlimited selectable items
const selected = await shopify.resourcePicker({ type: 'product', multiple: true, });
Maximum selectable items
const selected = await shopify.resourcePicker({ type: 'product', multiple: 5, });
Product picker with filters
description
Filters
const selected = await shopify.resourcePicker({ type: 'product', filter: { hidden: true, variants: false, draft: false, archived: false, }, });
Product picker with a custom filter query
description
Filter query
const selected = await shopify.resourcePicker({ type: 'product', filter: { query: 'Sweater', }, });
Product picker using returned selection payload
description
Selection
const selected = await shopify.resourcePicker({type: 'product'}); if (selected) { console.log(selected); } else { console.log('Picker was cancelled by the user'); }
Product picker with initial query provided
description
Initial query
const selected = await shopify.resourcePicker({ type: 'product', query: 'Sweater', });