Copy the WooCommerce website into the shop
const url = 'https://example.com/storefront/import';const options = { method: 'POST', headers: { cookie: '__Host-bottle.session_token=<__Host-bottle.session_token>', 'Content-Type': 'application/json' }, body: '{"shopId":"019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f","replaceDraft":false}'};
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/import \ --header 'Content-Type: application/json' \ --cookie __Host-bottle.session_token=<__Host-bottle.session_token> \ --data '{ "shopId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "replaceDraft": false }'Starts copying a connected WooCommerce shop’s WordPress website into this business’s shop, in the background: published pages and blog posts (as drafts), menus, pictures, then a first draft of the look and home page. It replaces the shop’s draft, never the live shop, and publishes nothing. When the shop has been published, has pages or posts, or its draft has been changed, send replaceDraft true, or it is 409 and nothing starts. Starting again after one stopped carries on where it left off. Watch it with GET /storefront/import.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
UUID v7
Example
019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8fResponses
Section titled “Responses”Started
object
object
UUID v7
UUID v7
Queued: waiting to start. running: under way. done: finished. failed: stopped; starting again carries on. undone: what it made was taken out again.
Fetching: reading the website. pictures: copying its pictures. converting: making pages and blog posts. drafting: setting up the look, home page and menus. done: finished.
object
object
object
UUID v7
Example
{ "import": { "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "shopId": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f", "status": "queued", "step": "fetching", "notes": [ { "values": {} } ] }, "sources": [ { "id": "019205d1-6e7a-7c3b-9f6e-3a2b1c0d9e8f" } ]}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 person signed in as an owner or admin, or without the permission
object
Example
{ "error": "not_found", "message": "Customer not found"}No such shop connection
object
Example
{ "error": "not_found", "message": "Customer not found"}One is already running, the shop is not WooCommerce, or replaceDraft is needed
object
Example
{ "error": "not_found", "message": "Customer not found"}Validation failed
object
object
Example
{ "error": "validation", "issues": [ { "path": "email", "message": "Invalid email" } ]}Five started in the last day already
object
Example
{ "error": "not_found", "message": "Customer not found"}It could not be started; nothing was done
object
Example
{ "error": "not_found", "message": "Customer not found"}