Skip to content

Save a page’s draft

PUT
/storefront/pages/{id}/draft
curl --request PUT \
--url https://example.com/storefront/pages/019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f/draft \
--header 'Content-Type: application/json' \
--cookie __Host-bottle.session_token=<__Host-bottle.session_token> \
--data '{ "title": "example", "slug": "refills-and-swaps", "seoTitle": "example", "seoDescription": "example", "showInNav": true, "sections": [ { "id": "example", "width": "full", "type": "banners" } ] }'

The page as the owner is changing it, whole: title, address, search words, menu choice and sections. Shoppers do not see it until POST /storefront/pages/{id}/publish; the preview does. An address another page has is 409. A draft the same as the published page is cleared. 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).

id
required

UUID v7

string format: uuid

Example

019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f

UUID v7

base

The page’s version as the sender last had it. When the page has changed since, somewhere else, nothing is saved and the answer is 409 (draft_changed).

string
<= 64 characters

The page’s version as the sender last had it. When the page has changed since, somewhere else, nothing is saved and the answer is 409 (draft_changed).

Media typeapplication/json
object
title
required
string
>= 1 characters <= 120 characters
slug
required

Lower-case letters, digits and single dashes. Not one of the shop’s own addresses (products, basket, account, blog and the like).

string
>= 1 characters <= 80 characters /^[a-z0-9]+(?:-[a-z0-9]+)*$/

Example

refills-and-swaps
seoTitle
required
string
<= 70 characters
seoDescription
required
string
<= 300 characters
showInNav
required
boolean
sections
required
Array
<= 30 items
One of:
object
id
required

Stable within the page. Lower-case letters, digits and dashes.

string
/^[a-z0-9-]{1,40}$/
width

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.

string
Allowed values: full threeQuarters twoThirds half third quarter
type
required
string
Allowed values: banners

The page, with its draft

Media typeapplication/json
object
id
required

UUID v7

string format: uuid
slug
required
string
title
required
string
sections
required
Array
One of:
object
id
required

Stable within the page. Lower-case letters, digits and dashes.

string
/^[a-z0-9-]{1,40}$/
width

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.

string
Allowed values: full threeQuarters twoThirds half third quarter
type
required
string
Allowed values: banners
seoTitle
required
string
seoDescription
required
string
showInNav
required
boolean
status
required

Draft: only the business sees it, in the preview. published: on the shop.

string
Allowed values: draft published
draft
required
object
title
required
string
>= 1 characters <= 120 characters
slug
required

Lower-case letters, digits and single dashes. Not one of the shop’s own addresses (products, basket, account, blog and the like).

string
>= 1 characters <= 80 characters /^[a-z0-9]+(?:-[a-z0-9]+)*$/
seoTitle
required
string
<= 70 characters
seoDescription
required
string
<= 300 characters
showInNav
required
boolean
sections
required
Array
<= 30 items
One of:
object
id
required

Stable within the page. Lower-case letters, digits and dashes.

string
/^[a-z0-9-]{1,40}$/
width

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.

string
Allowed values: full threeQuarters twoThirds half third quarter
type
required
string
Allowed values: banners
unpublishedChanges
required
boolean
assets
required
object
key
additional properties
object
alt
required
string | null
width
required
integer
height
required
integer
thumb
required
string
card
required
string
large
required
string
publishedAt
required
string | null format: date-time
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
oldSlugs
required
Array<string>
version
required
string

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

Media typeapplication/json
object
error
required
string
message
required
string

Example

{
"error": "not_found",
"message": "Customer not found"
}

The plan does not include a shop

Media typeapplication/json
object
error
required
string
message
required
string

Example

{
"error": "not_found",
"message": "Customer not found"
}

Not a member, or without the permission this needs

Media typeapplication/json
object
error
required
string
message
required
string

Example

{
"error": "not_found",
"message": "Customer not found"
}

No such page

Media typeapplication/json
object
error
required
string
message
required
string

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

Media typeapplication/json
object
error
required
string
message
required
string

Example

{
"error": "not_found",
"message": "Customer not found"
}

Validation failed

Media typeapplication/json
object
error
required
string
Allowed values: validation
message
required
string
issues
required
Array<object>
object
path
required
string
message
required
string

Example

{
"error": "validation",
"issues": [
{
"path": "email",
"message": "Invalid email"
}
]
}