Shop and pages
The shop's details and its content pages, for your site's header and footer. Its classifications and their terms have [their own page](taxonomies).
Call them on storefront. A publishable or a secret key reads them.
Get the shop
storefront.shop(): Promise<StorefrontShop>
Name, logo, languages, currency, payment method labels and whether shoppers order through a cart.
Returns
A StorefrontShop:
| Field | Type | Description |
|---|---|---|
name | string | |
logo | string (uri) or null | |
locale | string | The language this response is in. |
defaultLanguage | string | |
languages | array of string | |
currency | string | |
pricesIncludeTax | boolean | |
paymentMethods | array of object | |
paymentMethods[].id | string | |
paymentMethods[].label | string | |
cartAvailable | boolean | False when the shop takes no orders through a cart (cart endpoints answer 409 cart_disabled). |
shippingEstimates | boolean | Whether POST /api/v1/cart/shipping-estimate is available. |
siteUrl | string (uri) or null | The merchant's own site, where checkout sends shoppers back to. |
Errors
| Status | When |
|---|---|
401 | invalid_api_key: no active Storefront key of this shop, or invalid_customer_token: a bearer token not valid for this shop. |
402 | The shop is suspended (message only). |
403 | origin_not_allowed (publishable key from an unlisted site), secret_key_in_browser, or the shop is not live (message only). |
404 | Not found, or the shop's plan has no Integration API. |
429 | Rate limited. |
Example
const shop = await storefront.shop();
Get a content page
storefront.page(page: 'about' | 'contact-us' | 'terms-conditions' | 'privacy-policy'): Promise<StorefrontPage>
One of the shop's published information pages, its content as purified HTML.
Parameters
| Parameter | Type | |
|---|---|---|
page |
string |
'about', 'contact-us', 'terms-conditions' or 'privacy-policy'. |
Returns
A StorefrontPage:
| Field | Type | Description |
|---|---|---|
slug | string | One of about, contact-us, terms-conditions, privacy-policy. |
title | string or null | |
content | string or null | Purified HTML. |
Errors
| Status | When |
|---|---|
401 | invalid_api_key: no active Storefront key of this shop, or invalid_customer_token: a bearer token not valid for this shop. |
402 | The shop is suspended (message only). |
403 | origin_not_allowed (publishable key from an unlisted site), secret_key_in_browser, or the shop is not live (message only). |
404 | page_not_found, or the shop's plan has no Integration API. |
429 | Rate limited. |
Example
const terms = await storefront.page('terms-conditions');