Store Hugs Developers

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(): array

Name, logo, languages, currency, payment method labels and whether shoppers order through a cart.

Returns

A StorefrontShop array:

FieldTypeDescription
namestring
logostring (uri) or null
localestringThe language this response is in.
defaultLanguagestring
languagesarray of string
currencystring
pricesIncludeTaxboolean
paymentMethodsarray of object
paymentMethods[].idstring
paymentMethods[].labelstring
cartAvailablebooleanFalse when the shop takes no orders through a cart (cart endpoints answer 409 cart_disabled).
shippingEstimatesbooleanWhether POST /api/v1/cart/shipping-estimate is available.
siteUrlstring (uri) or nullThe merchant's own site, where checkout sends shoppers back to.

Errors

StatusWhen
401invalid_api_key: no active Storefront key of this shop, or invalid_customer_token: a bearer token not valid for this shop.
402The shop is suspended (message only).
403origin_not_allowed (publishable key from an unlisted site), secret_key_in_browser, or the shop is not live (message only).
404Not found, or the shop's plan has no Integration API.
429Rate limited.

Example

$shop = $storefront->shop();

Get a content page

$storefront->page(string $page): array

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 array:

FieldTypeDescription
slugstringOne of about, contact-us, terms-conditions, privacy-policy.
titlestring or null
contentstring or nullPurified HTML.

Errors

StatusWhen
401invalid_api_key: no active Storefront key of this shop, or invalid_customer_token: a bearer token not valid for this shop.
402The shop is suspended (message only).
403origin_not_allowed (publishable key from an unlisted site), secret_key_in_browser, or the shop is not live (message only).
404page_not_found, or the shop's plan has no Integration API.
429Rate limited.

Example

$terms = $storefront->page('terms-conditions');