Write a page
const url = 'https://example.com/storefront/pages';const options = { method: 'POST', headers: { cookie: '__Host-bottle.session_token=<__Host-bottle.session_token>', 'Content-Type': 'application/json' }, body: '{"title":"example","slug":"refills-and-swaps","sections":[{"id":"example","width":"full","type":"banners"}],"seoTitle":"","seoDescription":"","showInNav":false,"status":"draft","bodyHtml":"example","heroKey":"example","heroAlt":"example","hero":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/storefront/pages \ --header 'Content-Type: application/json' \ --cookie __Host-bottle.session_token=<__Host-bottle.session_token> \ --data '{ "title": "example", "slug": "refills-and-swaps", "sections": [ { "id": "example", "width": "full", "type": "banners" } ], "seoTitle": "", "seoDescription": "", "showInNav": false, "status": "draft", "bodyHtml": "example", "heroKey": "example", "heroAlt": "example", "hero": "example" }'A new page, a draft unless status says published. Without a slug, one is made from the title. A page is a list of sections from the same library as the home page, apart from the banners: text, text and picture, a picture, a call to action, products and the rest (StorefrontPageSection). The words of a text section are rich text: paragraphs, two sizes of heading, bold, italic, lists, quotes, links (https, email, or a path on the shop such as /delivery), pictures and product blocks. Anything else is removed, and they are cleaned again whenever they are read. A picture in the words is <img src="/api/public/images/{key}/large" alt="…"> with a key from POST /storefront/assets and words saying what it shows; one without words, or from anywhere else, is dropped. A product block is <bottle-products data-ids="{id},{id}"></bottle-products> with up to four of the business’s own product ids; the shop draws each as a card with its live name, picture and price, and leaves out any not on sale. Pictures, products and pages a section names must be the business’s own (422).
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Lower-case letters, digits and single dashes. Not one of the shop’s own addresses (products, basket, account, blog and the like).
Example
refills-and-swapsobject
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Featured: the home page’s featured products first, then the rest by price. price-low, price-high: by the price the shopper pays. name: A to Z. newest: added most recently first.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
Paragraphs, headings, lists, bold, italic and links. On a page, pictures and product blocks too. Cleaned on every save and read.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
object
Every category the shop shows, in the shop’s order, one link each.
object
object
UUID v7
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8fobject
UUID v7
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8fobject
An https address. Anything else is refused.
No link: words with links under them, as a heading at the foot or a list that opens at the top.
object
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
Draft: only the business sees it, in the preview. published: on the shop.
Removed. Send sections instead.
Removed. Send sections instead.
Removed. Send sections instead.
Removed. Send sections instead.
Responses
Section titled “Responses”The page
object
UUID v7
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Featured: the home page’s featured products first, then the rest by price. price-low, price-high: by the price the shopper pays. name: A to Z. newest: added most recently first.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
Paragraphs, headings, lists, bold, italic and links. On a page, pictures and product blocks too. Cleaned on every save and read.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
object
Every category the shop shows, in the shop’s order, one link each.
object
object
UUID v7
object
UUID v7
object
An https address. Anything else is refused.
No link: words with links under them, as a heading at the foot or a list that opens at the top.
object
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
Draft: only the business sees it, in the preview. published: on the shop.
object
Lower-case letters, digits and single dashes. Not one of the shop’s own addresses (products, basket, account, blog and the like).
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Featured: the home page’s featured products first, then the rest by price. price-low, price-high: by the price the shopper pays. name: A to Z. newest: added most recently first.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
Paragraphs, headings, lists, bold, italic and links. On a page, pictures and product blocks too. Cleaned on every save and read.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
object
Every category the shop shows, in the shop’s order, one link each.
object
object
UUID v7
object
UUID v7
object
An https address. Anything else is refused.
No link: words with links under them, as a heading at the foot or a list that opens at the top.
object
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
Stable within the page. Lower-case letters, digits and dashes.
How wide the section is on a wide screen, in parts of the page: full, threeQuarters, twoThirds, half, third or quarter. Absent: full. Each kind allows only some (see the help guide). Every section is full width on a phone.
object
object
Example
{ "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "sections": [ { "width": "full", "type": "banners" } ], "status": "draft", "draft": { "slug": "refills-and-swaps", "sections": [ { "width": "full", "type": "banners" } ] }}Not signed in
object
Example
{ "error": "not_found", "message": "Customer not found"}The plan does not include a shop
object
Example
{ "error": "not_found", "message": "Customer not found"}Not a member, or without the permission this needs
object
Example
{ "error": "not_found", "message": "Customer not found"}Another page has that address: one in use (storefrontSlugTaken), or one in the bin, which holds it until it is restored or deleted for good
object
Example
{ "error": "not_found", "message": "Customer not found"}Validation failed
object
object
Example
{ "error": "validation", "issues": [ { "path": "email", "message": "Invalid email" } ]}