Save the draft
const url = 'https://example.com/storefront/draft';const options = { method: 'PUT', headers: { cookie: 'bottle.session_token=<bottle.session_token>', 'Content-Type': 'application/json' }, body: '{"template":"yard","theme":{"primary":"#1F3A5F","accent":"#E4572E","background":"#FAF7F2","fontPair":"classic","radius":12,"logoKey":null,"iconKey":null},"content":{"headline":"","strapline":"","banners":[],"sections":[{"section":"hero","visible":true},{"section":"categories","visible":true},{"section":"featured","visible":true},{"section":"delivery","visible":true},{"section":"reviews","visible":true},{"section":"about","visible":true},{"section":"faq","visible":true},{"section":"contact","visible":true}],"featuredProductIds":[],"about":"","deliveryPromise":"","faq":[],"phone":"","email":"","address":"","openingHours":"","socials":{}},"commerce":{"askForEmpties":true,"collection":{"enabled":false,"address":"","notes":""},"tradeEnquiries":false,"offerPhoneOrders":true,"ageCheck":false,"whenLow":"sell","whenOut":"stop","termsUrl":null},"seo":{"title":"","description":"","imageKey":null}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://example.com/storefront/draft \ --header 'Content-Type: application/json' \ --cookie bottle.session_token=<bottle.session_token> \ --data '{ "template": "yard", "theme": { "primary": "#1F3A5F", "accent": "#E4572E", "background": "#FAF7F2", "fontPair": "classic", "radius": 12, "logoKey": null, "iconKey": null }, "content": { "headline": "", "strapline": "", "banners": [], "sections": [ { "section": "hero", "visible": true }, { "section": "categories", "visible": true }, { "section": "featured", "visible": true }, { "section": "delivery", "visible": true }, { "section": "reviews", "visible": true }, { "section": "about", "visible": true }, { "section": "faq", "visible": true }, { "section": "contact", "visible": true } ], "featuredProductIds": [], "about": "", "deliveryPromise": "", "faq": [], "phone": "", "email": "", "address": "", "openingHours": "", "socials": {} }, "commerce": { "askForEmpties": true, "collection": { "enabled": false, "address": "", "notes": "" }, "tradeEnquiries": false, "offerPhoneOrders": true, "ageCheck": false, "whenLow": "sell", "whenOut": "stop", "termsUrl": null }, "seo": { "title": "", "description": "", "imageKey": null } }'Replaces the draft. Shoppers see nothing until it is published. Featured products and banner products must be this business’s; picture keys must come from POST /storefront/assets or be the business’s product pictures.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Yard: classic, photography first. flame: bold type and colour blocks. ledger: quiet, product grid first. Only yard is built today.
object
Classic: Fraunces and Inter. modern: Bricolage Grotesque and Inter. friendly: Nunito throughout. editorial: Playfair Display and Source Sans 3.
object
object
object
object
object
object
object
object
Responses
Section titled “Responses”The shop as it now stands
object
object
Yard: classic, photography first. flame: bold type and colour blocks. ledger: quiet, product grid first. Only yard is built today.
object
Classic: Fraunces and Inter. modern: Bricolage Grotesque and Inter. friendly: Nunito throughout. editorial: Playfair Display and Source Sans 3.
object
object
object
object
object
object
object
object
object
Yard: classic, photography first. flame: bold type and colour blocks. ledger: quiet, product grid first. Only yard is built today.
object
Classic: Fraunces and Inter. modern: Bricolage Grotesque and Inter. friendly: Nunito throughout. editorial: Playfair Display and Source Sans 3.
object
object
object
object
object
object
object
object
object
UUID v7
object
object
object
Example
{ "status": "off", "draft": { "template": "yard", "theme": { "primary": "#1F3A5F", "accent": "#E4572E", "background": "#FAF7F2", "fontPair": "classic", "radius": 12, "logoKey": null, "iconKey": null }, "content": { "headline": "", "strapline": "", "banners": [], "sections": [ { "section": "hero", "visible": true }, { "section": "categories", "visible": true }, { "section": "featured", "visible": true }, { "section": "delivery", "visible": true }, { "section": "reviews", "visible": true }, { "section": "about", "visible": true }, { "section": "faq", "visible": true }, { "section": "contact", "visible": true } ], "featuredProductIds": [], "about": "", "deliveryPromise": "", "faq": [], "phone": "", "email": "", "address": "", "openingHours": "", "socials": {} }, "commerce": { "askForEmpties": true, "collection": { "enabled": false, "address": "", "notes": "" }, "tradeEnquiries": false, "offerPhoneOrders": true, "ageCheck": false, "whenLow": "sell", "whenOut": "stop", "termsUrl": null }, "seo": { "title": "", "description": "", "imageKey": null } }, "live": { "template": "yard", "theme": { "primary": "#1F3A5F", "accent": "#E4572E", "background": "#FAF7F2", "fontPair": "classic", "radius": 12, "logoKey": null, "iconKey": null }, "content": { "headline": "", "strapline": "", "banners": [], "sections": [ { "section": "hero", "visible": true }, { "section": "categories", "visible": true }, { "section": "featured", "visible": true }, { "section": "delivery", "visible": true }, { "section": "reviews", "visible": true }, { "section": "about", "visible": true }, { "section": "faq", "visible": true }, { "section": "contact", "visible": true } ], "featuredProductIds": [], "about": "", "deliveryPromise": "", "faq": [], "phone": "", "email": "", "address": "", "openingHours": "", "socials": {} }, "commerce": { "askForEmpties": true, "collection": { "enabled": false, "address": "", "notes": "" }, "tradeEnquiries": false, "offerPhoneOrders": true, "ageCheck": false, "whenLow": "sell", "whenOut": "stop", "termsUrl": null }, "seo": { "title": "", "description": "", "imageKey": null } }, "domains": [ { "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "host": "shop.northgategas.co.uk", "kind": "bottle", "records": [ { "type": "CNAME" } ] } ]}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"}The shop has not been switched on
object
Example
{ "error": "not_found", "message": "Customer not found"}Validation failed
object
object
Example
{ "error": "validation", "issues": [ { "path": "email", "message": "Invalid email" } ]}