Skip to content

Storefront

StorefrontApi

Methods

addCartLines()

addCartLines(lines): Promise<Cart>
Parameters
ParameterType
linesOptimisticCartLine[]
Returns

Promise<Cart>

authorize()

authorize(): Promise<void>
Returns

Promise<void>

createAddress()

createAddress(args): Promise<Customer>
Parameters
ParameterType
argsobject
args.addressMailingAddress
args.defaultAddressboolean
Returns

Promise<Customer>

createCart()

createCart(args): Promise<undefined | Cart>
Parameters
ParameterType
argsobject
args.discountCodesstring[]
args.linesobject[]
Returns

Promise<undefined | Cart>

deleteAddress()

deleteAddress(args): Promise<Customer>
Parameters
ParameterType
argsobject
args.addressIdstring
Returns

Promise<Customer>

getCart()

getCart(): Promise<Cart>
Returns

Promise<Cart>

getCategories()

getCategories(params): Promise<CategoriesQuery>
Parameters
ParameterType
paramsobject
params.endCursor?string
params.first?number
params.last?number
params.startCursor?string
Returns

Promise<CategoriesQuery>

getCategory()

getCategory(params): Promise<undefined | CategoryQuery>
Parameters
ParameterType
paramsobject
params.endCursor?string
params.first?number
params.handlestring
params.last?number
params.startCursor?string
Returns

Promise<undefined | CategoryQuery>

getCategoryTree()

getCategoryTree(): Promise<CategoryTree>
Returns

Promise<CategoryTree>

getCustomerDetails()

getCustomerDetails(): Promise<null | Customer>
Returns

Promise<null | Customer>

getCustomerOrder()

getCustomerOrder(args): Promise<undefined | Order>
Parameters
ParameterType
argsobject
args.orderIdstring
Returns

Promise<undefined | Order>

getCustomerOrders()

getCustomerOrders(args): Promise<CustomerOrdersQuery>
Parameters
ParameterType
argsobject
args.endCursor?string
args.first?number
args.last?number
args.startCursor?string
Returns

Promise<CustomerOrdersQuery>

getProduct()

getProduct(params): Promise<undefined | Product>
Parameters
ParameterType
paramsobject
params.handlestring
params.selectedOptionsSelectedOption[]
Returns

Promise<undefined | Product>

getRecommendedProducts()

getRecommendedProducts(params): Promise<RecommendedProductsQuery>
Parameters
ParameterType
paramsobject
params.product?string
Returns

Promise<RecommendedProductsQuery>

getShop()

getShop(): Promise<Shop>
Returns

Promise<Shop>

getSitemap()

getSitemap(): Promise<SitemapQuery>
Returns

Promise<SitemapQuery>

getUser()

getUser(): null | User
Returns

null | User

loginUsernamePassword()

loginUsernamePassword(__namedParameters): Promise<string>
Parameters
ParameterType
__namedParametersobject
__namedParameters.passwordstring
__namedParameters.usernamestring
Returns

Promise<string>

predictiveSearch()

predictiveSearch(params): Promise<PredictiveSearchQuery>
Parameters
ParameterType
paramsobject
params.limitnumber
params.limitScopestring
params.searchTermstring
params.types( | "ARTICLE" | "COLLECTION" | "PAGE" | "PRODUCT" | "QUERY")[]
Returns

Promise<PredictiveSearchQuery>

removeCartLines()

removeCartLines(lineIds): Promise<Cart>
Parameters
ParameterType
lineIdsstring[]
Returns

Promise<Cart>

search(params): Promise<SearchQuery>
Parameters
ParameterType
paramsobject
params.endCursor?string
params.first?number
params.last?number
params.query?string
params.startCursor?string
Returns

Promise<SearchQuery>

updateAddress()

updateAddress(args): Promise<Customer>
Parameters
ParameterType
argsobject
args.addressMailingAddress
args.addressIdstring
args.defaultAddressboolean
Returns

Promise<Customer>

updateBuyerIdentity()

updateBuyerIdentity(params): Promise<Cart>
Parameters
ParameterType
paramsCartBuyerIdentity
Returns

Promise<Cart>

updateCartLines()

updateCartLines(lines): Promise<Cart>
Parameters
ParameterType
linesCartLine[]
Returns

Promise<Cart>

updateCustomer()

updateCustomer(customer): Promise<Customer>
Parameters
ParameterType
customerCustomerUpdateInput
Returns

Promise<Customer>

updateDiscountCodes()

updateDiscountCodes(discountCodes): Promise<Cart>
Parameters
ParameterType
discountCodesstring[]
Returns

Promise<Cart>


PredictiveSearchQuery

type PredictiveSearchQuery: object;

Type declaration

NameType
predictiveSearchobject
predictiveSearch.articlesPick<Article, "id" | "title" | "handle" | "trackingParameters"> & object[]
predictiveSearch.collectionsPick<Category, "id" | "title" | "handle" | "trackingParameters"> & object[]
predictiveSearch.pagesPick<Page, "id" | "title" | "handle" | "trackingParameters">[]
predictiveSearch.productsProduct[]
predictiveSearch.queriesPick<SearchQuerySuggestion, "text" | "styledText" | "trackingParameters">[]

SearchQuery

type SearchQuery: object;

Type declaration

NameType
articlesobject
articles.nodesPick<Article, "handle" | "id" | "title" | "trackingParameters">[]
pagesobject
pages.nodesPick<Page, "handle" | "id" | "title" | "trackingParameters">[]
productsobject
products.nodesProduct[]
products.pageInfoPick<PageInfo, | "total" | "hasNextPage" | "hasPreviousPage" | "startCursor" | "endCursor">

SearchQuerySuggestion

type SearchQuerySuggestion: object;

A search query suggestion.

Type declaration

NameType
styledTextstring
textstring
trackingParametersstring

SitemapQuery

type SitemapQuery: object;

Type declaration

NameType
collectionsobject
collections.nodesPick<Category, "updatedAt" | "handle" | "onlineStoreUrl">[]
pagesobject
pages.nodesPick<Page, "updatedAt" | "handle" | "onlineStoreUrl">[]
productsobject
products.nodesPick<Product, "updatedAt" | "handle" | "onlineStoreUrl" | "title"> & object[]