Themes
30 endpoints. Each needs an API key or OAuth token with the scope shown; the key already names its store, so paths start at /v1/store. Generated from the live contract; also in openapi.json.
Installed themes, the stock theme library and which version is live
/v1/store/themesOr name the store: GET /v1/stores/{storeId}/themes
Response ListThemesResponse
themesThemeSummary[]requiredstockStockTheme[]requiredliveobject | nullrequired
Example
curl "https://api.shopfa.st/v1/store/themes" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/themes', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
},
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"GET",
"https://api.shopfa.st/v1/store/themes",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("GET", "https://api.shopfa.st/v1/store/themes", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)Try it with your key
Install a stock theme (with a style) or duplicate an installed one, unpublished
/v1/store/themesOr name the store: POST /v1/stores/{storeId}/themes
Body
stockIdstringrequiredpresetstring | nullrequirednamestringrequiredduplicateOfthm_… | nullrequired
Response ThemeSummary
idThemeIdrequiredstoreIdStoreIdrequirednamestringrequiredroleThemeRolerequiredstockobjectrequiredidstringrequirednamestringrequiredversionstringrequired
presetstringrequireddraftRevisionintegerrequireddraftUpdatedAtTimestamprequireddraftUpdatedByThemeAuthorrequiredhasUnpublishedChangesbooleanrequired
4 more fields
latestVersionThemeVersionSummary | nullrequiredcreatedAtTimestamprequiredupdateobject | nullrequiredunrequestedobject | nullrequired
Example
curl -X POST "https://api.shopfa.st/v1/store/themes" \
-H "Authorization: Bearer $SHOPFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"stockId": "string",
"preset": "string",
"name": "string",
"duplicateOf": "thm_0123456789abcdefghjk"
}'const res = await fetch('https://api.shopfa.st/v1/store/themes', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"stockId": "string",
"preset": "string",
"name": "string",
"duplicateOf": "thm_0123456789abcdefghjk"
}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"POST",
"https://api.shopfa.st/v1/store/themes",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
json={
"stockId": "string",
"preset": "string",
"name": "string",
"duplicateOf": "thm_0123456789abcdefghjk"
},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/themes", strings.NewReader(`{
"stockId": "string",
"preset": "string",
"name": "string",
"duplicateOf": "thm_0123456789abcdefghjk"
}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Try it with your key
The draft: every file, its revision and validation results
/v1/store/themes/{themeId}Or name the store: GET /v1/stores/{storeId}/themes/{themeId}
Parameters
themeIdthm_…pathrequired
Response ThemeDraft
themeThemeSummaryrequiredrevisionintegerrequiredfilesThemeFilesRecordrequiredissuesThemeIssue[]required
Example
curl "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
},
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"GET",
"https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("GET", "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)Try it with your key
Rename a theme
/v1/store/themes/{themeId}Or name the store: PATCH /v1/stores/{storeId}/themes/{themeId}
Parameters
themeIdthm_…pathrequired
Body
namestringrequired
Response ThemeSummary
idThemeIdrequiredstoreIdStoreIdrequirednamestringrequiredroleThemeRolerequiredstockobjectrequiredidstringrequirednamestringrequiredversionstringrequired
presetstringrequireddraftRevisionintegerrequireddraftUpdatedAtTimestamprequireddraftUpdatedByThemeAuthorrequiredhasUnpublishedChangesbooleanrequired
4 more fields
latestVersionThemeVersionSummary | nullrequiredcreatedAtTimestamprequiredupdateobject | nullrequiredunrequestedobject | nullrequired
Example
curl -X PATCH "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk" \
-H "Authorization: Bearer $SHOPFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "string"
}'const res = await fetch('https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk', {
method: 'PATCH',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "string"
}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"PATCH",
"https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
json={
"name": "string"
},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("PATCH", "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk", strings.NewReader(`{
"name": "string"
}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Try it with your key
Delete an unpublished theme
/v1/store/themes/{themeId}Or name the store: DELETE /v1/stores/{storeId}/themes/{themeId}
Parameters
themeIdthm_…pathrequired
Response Ok
okbooleanrequired
Example
curl -X DELETE "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
},
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"DELETE",
"https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("DELETE", "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)Try it with your key
Apply typed edits to the draft (all or nothing). 409 when baseRevision is not the current revision
/v1/store/themes/{themeId}/opsOr name the store: POST /v1/stores/{storeId}/themes/{themeId}/ops
Parameters
themeIdthm_…pathrequired
Body
baseRevisionintegerrequiredopsobject[]requiredauthor"seller" | "ai" | "code"requiredsummarystringrequiredpromptstring | nullrequiredaiProposalIdaipr_… | null
Response ThemeSaveResult
revisionintegerrequiredchangedFilesstring[]requiredpatchesobject[]requiredpathstringrequiredopsJsonPatchOp[]required
createdIdsstring[]requiredissuesThemeIssue[]requiredhasUnpublishedChangesbooleanrequired
Example
curl -X POST "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/ops" \
-H "Authorization: Bearer $SHOPFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"baseRevision": 0,
"ops": [
{
"op": "set_section_setting",
"file": "string",
"section": "string",
"key": "string",
"value": "string"
}
],
"author": "seller",
"summary": "string",
"prompt": "string",
"aiProposalId": null
}'const res = await fetch('https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/ops', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"baseRevision": 0,
"ops": [
{
"op": "set_section_setting",
"file": "string",
"section": "string",
"key": "string",
"value": "string"
}
],
"author": "seller",
"summary": "string",
"prompt": "string",
"aiProposalId": null
}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"POST",
"https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/ops",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
json={
"baseRevision": 0,
"ops": [
{
"op": "set_section_setting",
"file": "string",
"section": "string",
"key": "string",
"value": "string"
}
],
"author": "seller",
"summary": "string",
"prompt": "string",
"aiProposalId": None
},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/ops", strings.NewReader(`{
"baseRevision": 0,
"ops": [
{
"op": "set_section_setting",
"file": "string",
"section": "string",
"key": "string",
"value": "string"
}
],
"author": "seller",
"summary": "string",
"prompt": "string",
"aiProposalId": null
}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Try it with your key
Validate strictly, compile CSS, freeze the draft into a version and make the theme live
/v1/store/themes/{themeId}/publishOr name the store: POST /v1/stores/{storeId}/themes/{themeId}/publish
Parameters
themeIdthm_…pathrequired
Body
baseRevisionintegerrequirednamestring | nullrequired
Response PublishThemeResponse
versionThemeVersionSummaryrequiredthemeThemeSummaryrequiredwarningsThemeIssue[]required
Example
curl -X POST "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/publish" \
-H "Authorization: Bearer $SHOPFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"baseRevision": 0,
"name": "string"
}'const res = await fetch('https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/publish', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"baseRevision": 0,
"name": "string"
}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"POST",
"https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/publish",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
json={
"baseRevision": 0,
"name": "string"
},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/publish", strings.NewReader(`{
"baseRevision": 0,
"name": "string"
}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Try it with your key
Reset the draft to the latest published version
/v1/store/themes/{themeId}/discardOr name the store: POST /v1/stores/{storeId}/themes/{themeId}/discard
Parameters
themeIdthm_…pathrequired
Body
baseRevisionintegerrequired
Response ThemeDraft
themeThemeSummaryrequiredrevisionintegerrequiredfilesThemeFilesRecordrequiredissuesThemeIssue[]required
Example
curl -X POST "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/discard" \
-H "Authorization: Bearer $SHOPFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"baseRevision": 0
}'const res = await fetch('https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/discard', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"baseRevision": 0
}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"POST",
"https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/discard",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
json={
"baseRevision": 0
},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/discard", strings.NewReader(`{
"baseRevision": 0
}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Try it with your key
Published versions, newest first
/v1/store/themes/{themeId}/versionsOr name the store: GET /v1/stores/{storeId}/themes/{themeId}/versions
Parameters
themeIdthm_…pathrequired
Response ListThemeVersionsResponse
versionsThemeVersionSummary[]required
Example
curl "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/versions" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/versions', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
},
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"GET",
"https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/versions",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("GET", "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/versions", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)Try it with your key
One published version with its files
/v1/store/themes/{themeId}/versions/{versionId}Or name the store: GET /v1/stores/{storeId}/themes/{themeId}/versions/{versionId}
Parameters
themeIdthm_…pathrequiredversionIdthv_…pathrequired
Response GetThemeVersionResponse
versionThemeVersionSummaryrequiredfilesThemeFilesRecordrequired
Example
curl "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/versions/thv_0123456789abcdefghjk" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/versions/thv_0123456789abcdefghjk', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
},
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"GET",
"https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/versions/thv_0123456789abcdefghjk",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("GET", "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/versions/thv_0123456789abcdefghjk", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)Try it with your key
Roll back: copy a version into the draft, and publish it again when asked
/v1/store/themes/{themeId}/versions/{versionId}/restoreOr name the store: POST /v1/stores/{storeId}/themes/{themeId}/versions/{versionId}/restore
Parameters
themeIdthm_…pathrequiredversionIdthv_…pathrequired
Body
baseRevisionintegerrequiredpublishbooleanrequired
Response RestoreThemeVersionResponse
draftThemeDraftrequiredversionThemeVersionSummary | nullrequired
Example
curl -X POST "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/versions/thv_0123456789abcdefghjk/restore" \
-H "Authorization: Bearer $SHOPFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"baseRevision": 0,
"publish": false
}'const res = await fetch('https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/versions/thv_0123456789abcdefghjk/restore', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"baseRevision": 0,
"publish": false
}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"POST",
"https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/versions/thv_0123456789abcdefghjk/restore",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
json={
"baseRevision": 0,
"publish": False
},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/versions/thv_0123456789abcdefghjk/restore", strings.NewReader(`{
"baseRevision": 0,
"publish": false
}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Try it with your key
Draft history with authors and AI prompts
/v1/store/themes/{themeId}/revisionsOr name the store: GET /v1/stores/{storeId}/themes/{themeId}/revisions
Parameters
themeIdthm_…pathrequired
Response ListThemeRevisionsResponse
revisionsThemeRevisionSummary[]required
Example
curl "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/revisions" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/revisions', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
},
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"GET",
"https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/revisions",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("GET", "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/revisions", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)Try it with your key
Ask AI for a change. Returns validated ops to preview; nothing is saved until the seller applies them
/v1/store/themes/{themeId}/aiOr name the store: POST /v1/stores/{storeId}/themes/{themeId}/ai
Parameters
themeIdthm_…pathrequired
Body
promptstringrequiredbaseRevisionintegerrequiredtemplatestringrequiredselectionobject | nullrequiredmode"edit" | "code"requiredfilestring | nullrequiredimagesobject[]uploadIdupl_…required
conversationIdaicv_… | null
Response ThemeAiProposal
summarystringrequiredopsThemeOp[]requiredexplanationsstring[]requirednotesstring[]requiredmodelstringrequiredproposalIdAiProposalId | nullrequiredconversationIdAiConversationId | nullrequiredturnIdAiTurnId | nullrequired
Example
curl -X POST "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/ai" \
-H "Authorization: Bearer $SHOPFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"prompt": "string",
"baseRevision": 0,
"template": "string",
"selection": {
"file": "string",
"section": "string",
"block": "string"
},
"mode": "edit",
"file": "string",
"images": [],
"conversationId": null
}'const res = await fetch('https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/ai', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"prompt": "string",
"baseRevision": 0,
"template": "string",
"selection": {
"file": "string",
"section": "string",
"block": "string"
},
"mode": "edit",
"file": "string",
"images": [],
"conversationId": null
}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"POST",
"https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/ai",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
json={
"prompt": "string",
"baseRevision": 0,
"template": "string",
"selection": {
"file": "string",
"section": "string",
"block": "string"
},
"mode": "edit",
"file": "string",
"images": [],
"conversationId": None
},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/ai", strings.NewReader(`{
"prompt": "string",
"baseRevision": 0,
"template": "string",
"selection": {
"file": "string",
"section": "string",
"block": "string"
},
"mode": "edit",
"file": "string",
"images": [],
"conversationId": null
}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Try it with your key
Your AI requests for this theme, newest first: what you asked (with images), the answer and what you did with it
/v1/store/themes/{themeId}/ai/historyOr name the store: GET /v1/stores/{storeId}/themes/{themeId}/ai/history
Parameters
themeIdthm_…pathrequired
Response ThemeAiHistory
itemsThemeAiHistoryItem[]required
Example
curl "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/ai/history" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/ai/history', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
},
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"GET",
"https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/ai/history",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("GET", "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/ai/history", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)Try it with your key
A signed, expiring link that shows this draft on the real storefront (noindex), opening `path` (the page being edited)
/v1/store/themes/{themeId}/preview-linkOr name the store: POST /v1/stores/{storeId}/themes/{themeId}/preview-link
Parameters
themeIdthm_…pathrequired
Body
pathstring | null
Response CreateThemePreviewLinkResponse
urlstringrequiredexpiresAtstringrequired
Example
curl -X POST "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/preview-link" \
-H "Authorization: Bearer $SHOPFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"path": null
}'const res = await fetch('https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/preview-link', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"path": null
}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"POST",
"https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/preview-link",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
json={
"path": None
},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/preview-link", strings.NewReader(`{
"path": null
}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Try it with your key
Images uploaded into a theme
/v1/store/themes/{themeId}/assetsOr name the store: GET /v1/stores/{storeId}/themes/{themeId}/assets
Parameters
themeIdthm_…pathrequired
Response ListThemeAssetsResponse
assetsThemeAsset[]required
Example
curl "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/assets" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/assets', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
},
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"GET",
"https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/assets",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("GET", "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/assets", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)Try it with your key
Add a completed image upload to a theme (the editor then writes config/assets.json in the draft)
/v1/store/themes/{themeId}/assetsOr name the store: POST /v1/stores/{storeId}/themes/{themeId}/assets
Parameters
themeIdthm_…pathrequired
Body
uploadIdupl_…requirednamestring | nullrequired
Response ThemeAsset
idThemeAssetIdrequiredthemeIdThemeIdrequirednameThemeAssetNamerequiredurlstringrequiredcontentTypestringrequiredbytesintegerrequiredwidthinteger | nullrequiredheightinteger | nullrequiredcreatedAtTimestamprequired
Example
curl -X POST "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/assets" \
-H "Authorization: Bearer $SHOPFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"uploadId": "upl_0123456789abcdefghjk",
"name": "string"
}'const res = await fetch('https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/assets', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"uploadId": "upl_0123456789abcdefghjk",
"name": "string"
}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"POST",
"https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/assets",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
json={
"uploadId": "upl_0123456789abcdefghjk",
"name": "string"
},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/assets", strings.NewReader(`{
"uploadId": "upl_0123456789abcdefghjk",
"name": "string"
}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Try it with your key
Remove an image from a theme. Published versions that use it keep working.
/v1/store/themes/{themeId}/assets/{assetId}Or name the store: DELETE /v1/stores/{storeId}/themes/{themeId}/assets/{assetId}
Parameters
themeIdthm_…pathrequiredassetIdtha_…pathrequired
Response Ok
okbooleanrequired
Example
curl -X DELETE "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/assets/tha_0123456789abcdefghjk" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/assets/tha_0123456789abcdefghjk', {
method: 'DELETE',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
},
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"DELETE",
"https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/assets/tha_0123456789abcdefghjk",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("DELETE", "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/assets/tha_0123456789abcdefghjk", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)Try it with your key
Whether a newer stock version exists, and what merging it into this theme's draft or live version would change
/v1/store/themes/{themeId}/updateOr name the store: GET /v1/stores/{storeId}/themes/{themeId}/update
Parameters
themeIdthm_…pathrequiredtarget"draft" | "live"query
Response ThemeUpdatePreview
themeIdThemeIdrequiredstockIdstringrequiredstockNamestringrequiredtargetThemeUpdateTargetrequiredfromVersionstringrequiredtoVersionstringrequiredtargetsobject | nullrequiredavailablebooleanrequiredbase"snapshot" | "install_revision" | "none"requiredfilesobject[]requiredpathstringrequiredoutcomeThemeUpdateOutcomerequiredconflictsintegerrequired
3 more fields
conflictsThemeUpdateConflict[]requiredchangelogThemeChangelogEntry[]requiredmergedFilesobject | nullrequired
Example
curl "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/update" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/update', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
},
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"GET",
"https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/update",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("GET", "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/update", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)Try it with your key
Take the newest stock version, the way the seller chose: into the draft, as a new unpublished theme, or live (published at once)
/v1/store/themes/{themeId}/updateOr name the store: POST /v1/stores/{storeId}/themes/{themeId}/update
Parameters
themeIdthm_…pathrequired
Body
baseRevisionintegerrequiredresolutionsobjectmode"draft" | "new_theme" | "live"namestring | null
Response ApplyThemeUpdateResponse
draftThemeDraftrequiredupdateThemeUpdatePreviewrequiredthemeThemeSummary | nullrequiredversionThemeVersionSummary | nullrequiredrollbackobject | nullrequired
Example
curl -X POST "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/update" \
-H "Authorization: Bearer $SHOPFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"baseRevision": 0,
"resolutions": {},
"mode": "draft",
"name": null
}'const res = await fetch('https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/update', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"baseRevision": 0,
"resolutions": {},
"mode": "draft",
"name": null
}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"POST",
"https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/update",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
json={
"baseRevision": 0,
"resolutions": {},
"mode": "draft",
"name": None
},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/update", strings.NewReader(`{
"baseRevision": 0,
"resolutions": {},
"mode": "draft",
"name": null
}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Try it with your key
Every template in a theme draft, with how many products, collections and pages use each alternate
/v1/store/themes/{themeId}/templatesOr name the store: GET /v1/stores/{storeId}/themes/{themeId}/templates
Parameters
themeIdthm_…pathrequired
Response ListThemeTemplatesResponse
templatesThemeTemplate[]required
Example
curl "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/templates" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/templates', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
},
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"GET",
"https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/templates",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("GET", "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/templates", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)Try it with your key
Create an alternate template (templates/<type>.<suffix>.json) from the default template or by duplicating another
/v1/store/themes/{themeId}/templatesOr name the store: POST /v1/stores/{storeId}/themes/{themeId}/templates
Parameters
themeIdthm_…pathrequired
Body
baseRevisionintegerrequiredtype"product" | "collection" | "page"requiredsuffixstringrequiredfromstring | nullrequired
Response CreateThemeTemplateResponse
templateThemeTemplaterequiredrevisionintegerrequiredissuesThemeIssue[]required
Example
curl -X POST "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/templates" \
-H "Authorization: Bearer $SHOPFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"baseRevision": 0,
"type": "product",
"suffix": "string",
"from": "string"
}'const res = await fetch('https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/templates', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"baseRevision": 0,
"type": "product",
"suffix": "string",
"from": "string"
}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"POST",
"https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/templates",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
json={
"baseRevision": 0,
"type": "product",
"suffix": "string",
"from": "string"
},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/templates", strings.NewReader(`{
"baseRevision": 0,
"type": "product",
"suffix": "string",
"from": "string"
}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Try it with your key
Rename an alternate template. 409 while products, collections or pages use it, unless reassign moves them along
/v1/store/themes/{themeId}/templates/renameOr name the store: POST /v1/stores/{storeId}/themes/{themeId}/templates/rename
Parameters
themeIdthm_…pathrequired
Body
baseRevisionintegerrequiredtype"product" | "collection" | "page"requiredsuffixstringrequiredtostringrequiredreassignboolean
Response RenameThemeTemplateResponse
templateThemeTemplaterequiredrevisionintegerrequiredissuesThemeIssue[]requiredreassignedintegerrequired
Example
curl -X POST "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/templates/rename" \
-H "Authorization: Bearer $SHOPFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"baseRevision": 0,
"type": "product",
"suffix": "string",
"to": "string",
"reassign": false
}'const res = await fetch('https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/templates/rename', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"baseRevision": 0,
"type": "product",
"suffix": "string",
"to": "string",
"reassign": false
}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"POST",
"https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/templates/rename",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
json={
"baseRevision": 0,
"type": "product",
"suffix": "string",
"to": "string",
"reassign": False
},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/templates/rename", strings.NewReader(`{
"baseRevision": 0,
"type": "product",
"suffix": "string",
"to": "string",
"reassign": false
}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Try it with your key
Delete an alternate template. 409 (with who uses it) while products, collections or pages are assigned to it
/v1/store/themes/{themeId}/templates/deleteOr name the store: POST /v1/stores/{storeId}/themes/{themeId}/templates/delete
Parameters
themeIdthm_…pathrequired
Body
baseRevisionintegerrequiredtype"product" | "collection" | "page"requiredsuffixstringrequired
Response DeleteThemeTemplateResponse
revisionintegerrequired
Example
curl -X POST "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/templates/delete" \
-H "Authorization: Bearer $SHOPFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"baseRevision": 0,
"type": "product",
"suffix": "string"
}'const res = await fetch('https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/templates/delete', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"baseRevision": 0,
"type": "product",
"suffix": "string"
}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"POST",
"https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/templates/delete",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
json={
"baseRevision": 0,
"type": "product",
"suffix": "string"
},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/templates/delete", strings.NewReader(`{
"baseRevision": 0,
"type": "product",
"suffix": "string"
}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Try it with your key
Every section the theme can add, with its variants and the metadata the "Add section" library filters on
/v1/store/themes/{themeId}/libraryOr name the store: GET /v1/stores/{storeId}/themes/{themeId}/library
Parameters
themeIdthm_…pathrequired
Response GetSectionLibraryResponse
sectionsSectionLibraryEntry[]requiredcategoriesstring[]requiredlayoutsLibraryLayoutType[]requiredproductCard"configured" | "available" | "unsupported"required
Example
curl "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/library" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/library', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
},
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"GET",
"https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/library",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("GET", "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/library", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)Try it with your key
A page of this theme rendered before (the draft) or after (the draft with the stock update merged), for What's-new previews
/v1/store/themes/{themeId}/update/renderOr name the store: GET /v1/stores/{storeId}/themes/{themeId}/update/render
Parameters
themeIdthm_…pathrequiredtemplate"404" | "index" | "product" | "collection" | "list-collections" | "page" | "search" | "reviews" | "cart"queryside"before" | "after"querytarget"draft" | "live"query
Response GetThemeUpdatePreviewHtmlResponse
htmlstringrequiredtemplatestringrequiredside"before" | "after"required
Example
curl "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/update/render" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/update/render', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
},
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"GET",
"https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/update/render",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("GET", "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/update/render", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)Try it with your key
Keep a version ShopFast published without asking, or restore the version before it (live at once; the draft too, when untouched since)
/v1/store/themes/{themeId}/versions/{versionId}/answerOr name the store: POST /v1/stores/{storeId}/themes/{themeId}/versions/{versionId}/answer
Parameters
themeIdthm_…pathrequiredversionIdthv_…pathrequired
Body
decision"keep" | "restore"required
Response AnswerUnrequestedThemeVersionResponse
themeThemeSummaryrequiredrestoredThemeVersionSummary | nullrequireddraftRestoredbooleanrequiredatTimestamprequired
Example
curl -X POST "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/versions/thv_0123456789abcdefghjk/answer" \
-H "Authorization: Bearer $SHOPFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"decision": "keep"
}'const res = await fetch('https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/versions/thv_0123456789abcdefghjk/answer', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"decision": "keep"
}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"POST",
"https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/versions/thv_0123456789abcdefghjk/answer",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
json={
"decision": "keep"
},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/versions/thv_0123456789abcdefghjk/answer", strings.NewReader(`{
"decision": "keep"
}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Try it with your key
Regenerate a section's copy, rewrite it in the seller's tone, or translate it. Returns validated ops to preview
/v1/store/themes/{themeId}/ai/copyOr name the store: POST /v1/stores/{storeId}/themes/{themeId}/ai/copy
Parameters
themeIdthm_…pathrequired
Body
action"regenerate" | "tone" | "translate"requiredbaseRevisionintegerrequiredfilestringrequiredsectionstringrequiredtonestring | nulllanguagestring | nullhintstring | null
Response ThemeAiProposal
summarystringrequiredopsThemeOp[]requiredexplanationsstring[]requirednotesstring[]requiredmodelstringrequiredproposalIdAiProposalId | nullrequiredconversationIdAiConversationId | nullrequiredturnIdAiTurnId | nullrequired
Example
curl -X POST "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/ai/copy" \
-H "Authorization: Bearer $SHOPFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"action": "regenerate",
"baseRevision": 0,
"file": "string",
"section": "string",
"tone": null,
"language": null,
"hint": null
}'const res = await fetch('https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/ai/copy', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"action": "regenerate",
"baseRevision": 0,
"file": "string",
"section": "string",
"tone": null,
"language": null,
"hint": null
}),
});
if (!res.ok) throw new Error((await res.json()).detail);
const data = await res.json();import os, requests
res = requests.request(
"POST",
"https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/ai/copy",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
json={
"action": "regenerate",
"baseRevision": 0,
"file": "string",
"section": "string",
"tone": None,
"language": None,
"hint": None
},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/ai/copy", strings.NewReader(`{
"action": "regenerate",
"baseRevision": 0,
"file": "string",
"section": "string",
"tone": null,
"language": null,
"hint": null
}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)