Product Search API
The Product Search API gives the UI Extension access to the native product search and fetching functionality of Shopify POS. The interface provides numerous functions to search for products by query, or to fetch the details of one or more products or product variants.
Searching for products
Anchor link to section titled "Searching for products"The following example shows how a UI Extension can use the searchProducts
method to easily access search results based on a queryString
passed in the ProductSearchParams object.
Product search and fetch methods
Anchor link to section titled "Product search and fetch methods"The following functions allow your UI Extension to fetch products and variants using various input types.
Search for products using a query
Anchor link to section titled "Search for products using a query"
Name | Type | Description | |
---|---|---|---|
searchParams | ProductSearchParams |
The search parameters for the search query. |
Fetch a product's details
Anchor link to section titled "Fetch a product's details"
Name | Type | Description | |
---|---|---|---|
productId | number |
The ID for the product details to fetch. |
Fetch multiple products' details
Anchor link to section titled "Fetch multiple products' details"
Name | Type | Description | |
---|---|---|---|
productIds | number[] |
The IDs belonging to the products to fetch. This function returns a maximum of 50 products, so any IDs after the 50th in the array will be ignored. |
Fetch a product variant's details
Anchor link to section titled "Fetch a product variant's details"
Name | Type | Description | |
---|---|---|---|
productVariantId | number |
The ID for the product variant details to fetch. |
Fetch multiple product variants' details
Anchor link to section titled "Fetch multiple product variants' details"
Name | Type | Description | |
---|---|---|---|
productVariantIds | number[] |
The IDs belonging to the product variants to fetch. This function returns a maximum of 50 product variants, so any IDs after the 50th in the array will be ignored. |
Fetch all product variants belonging to a product
Anchor link to section titled "Fetch all product variants belonging to a product"
Name | Type | Description | |
---|---|---|---|
productId | number |
The product ID for whose product variants should be fetched. |
ProductSearchParams
Anchor link to section titled "ProductSearchParams"Name | Type | Description |
---|---|---|
queryString | string? |
The search term to be used to search for POS products. |
first | number? |
Specifies the number of results to be returned in this page of products. The maximum number of products that will be returned is 50. |
afterCursor | string? |
Specifies the page cursor. Products after this cursor will be returned. |
sortType | 'RECENTLY_ADDED' 'RECENTLY_ADDED_ASCENDING' 'ALPHABETICAL_A_TO_Z' 'ALPHABETICAL_Z_TO_A' |
Specifies the order in which products should be sorted. When a queryString is provided, sortType will not have any effect, as the results will be returned in order by relevance to the queryString . |
Name | Type | Description |
---|---|---|
id | number |
The unique Shopify ID for the product. |
createdAt | string |
The date that the product was created. |
updatedAt | string |
The date that the product was last updated. |
title | string |
The title of the product. |
description | string |
The description of the product. |
descriptionHtml | string? |
The description of the product with HTML formatting. |
featuredImage | string? |
The URL where the product image can be found. |
isGiftCard | boolean |
Whether the product is a giftcard. |
tracksInventory | boolean |
Whether the product's inventory is tracked. |
vendor | string |
The name of the product vendor. |
minVariantPrice | string |
The price of the least expensive variant belonging to the product. |
maxVariantPrice | string |
The price of the most expensive variant belonging to the product. |
productType | string |
The type of product. |
productCategory | string |
The product's category. |
tags | string[] |
The tags associated with the product. |
numVariants | number |
The total number of variants tied to this product. |
totalAvailableInventory | number? |
The total inventory available for this product at the current location. |
totalInventory | number |
The total inventory available for this product across all locations. |
variants | ProductVariant[] |
The variants associated with this product. |
options | ProductOption[] |
The different options for this product. |
hasOnlyDefaultVariant | boolean |
Whether the product has only a single default variant. |
hasInStockVariants | boolean |
Whether any variants are in stock at the current location. |
ProductVariant
Anchor link to section titled "ProductVariant"Name | Type | Description |
---|---|---|
id | number |
The unique Shopify ID for the variant. |
createdAt | string |
The date that the variant was created. |
updatedAt | string |
The date that the variant was last updated. |
title | string |
The title of the variant. |
compareAtPrice | string |
The comparison price point. |
taxable | boolean |
Whether the variant is taxed. |
sku | string |
The SKU belonging to the variant. |
barcode | string? |
The barcode belonging to the variant. |
displayName | string |
A combination of the product and variant's names. |
image | string? |
The variant image's URL. |
inventoryIsTracked | boolean |
Whether the variant's inventory is tracked. |
inventoryAtLocation | number |
The number of variants stocked at the current location. |
inventoryAtAllLocations | number |
The number of variants stocked at all the locations. |
inventoryPolicy | 'DENY' |
'CONTINUE' |
hasInStockVariants | boolean |
Whether any other variants belonging to the product are in stock. |
options | ProductVariantOption[] |
The options associated with the variant. |
product | Product |
The product associated with the variant. |
productId | number |
The product ID associated with the variant. |
position | number |
The variant's position in the list of variants associated with the product. |
ProductOption
Anchor link to section titled "ProductOption"Name | Type | Description |
---|---|---|
id | number |
The unique Shopify ID for the product option. |
name | string |
The name of the product option. |
optionValues | string[] |
The possible options. |
productId | number |
The ID of the product associated with the option. |
ProductVariantOption
Anchor link to section titled "ProductVariantOption"Name | Type | Description |
---|---|---|
name | string |
The name of the variant option. |
value | string |
The value of the option. |