Docs
Dashboard
On this page

    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

    GET/v1/store/themes

    Or name the store: GET /v1/stores/{storeId}/themes

    storefront:readlistThemes

    Response ListThemesResponse

    • themesThemeSummary[]required
    • stockStockTheme[]required
    • liveobject | 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

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    Install a stock theme (with a style) or duplicate an installed one, unpublished

    POST/v1/store/themes

    Or name the store: POST /v1/stores/{storeId}/themes

    storefront:writeinstallTheme

    Body

    • stockIdstringrequired
    • presetstring | nullrequired
    • namestringrequired
    • duplicateOfthm_… | nullrequired

    Response ThemeSummary

    • idThemeIdrequired
    • storeIdStoreIdrequired
    • namestringrequired
    • roleThemeRolerequired
    • stockobjectrequired
      • idstringrequired
      • namestringrequired
      • versionstringrequired
    • presetstringrequired
    • draftRevisionintegerrequired
    • draftUpdatedAtTimestamprequired
    • draftUpdatedByThemeAuthorrequired
    • hasUnpublishedChangesbooleanrequired
    4 more fields
    • latestVersionThemeVersionSummary | nullrequired
    • createdAtTimestamprequired
    • updateobject | nullrequired
    • unrequestedobject | 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

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    The draft: every file, its revision and validation results

    GET/v1/store/themes/{themeId}

    Or name the store: GET /v1/stores/{storeId}/themes/{themeId}

    storefront:readgetTheme

    Parameters

    • themeIdthm_…pathrequired

    Response ThemeDraft

    • themeThemeSummaryrequired
    • revisionintegerrequired
    • filesThemeFilesRecordrequired
    • issuesThemeIssue[]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

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    Rename a theme

    PATCH/v1/store/themes/{themeId}

    Or name the store: PATCH /v1/stores/{storeId}/themes/{themeId}

    storefront:writerenameTheme

    Parameters

    • themeIdthm_…pathrequired

    Body

    • namestringrequired

    Response ThemeSummary

    • idThemeIdrequired
    • storeIdStoreIdrequired
    • namestringrequired
    • roleThemeRolerequired
    • stockobjectrequired
      • idstringrequired
      • namestringrequired
      • versionstringrequired
    • presetstringrequired
    • draftRevisionintegerrequired
    • draftUpdatedAtTimestamprequired
    • draftUpdatedByThemeAuthorrequired
    • hasUnpublishedChangesbooleanrequired
    4 more fields
    • latestVersionThemeVersionSummary | nullrequired
    • createdAtTimestamprequired
    • updateobject | nullrequired
    • unrequestedobject | 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

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    Delete an unpublished theme

    DELETE/v1/store/themes/{themeId}

    Or name the store: DELETE /v1/stores/{storeId}/themes/{themeId}

    storefront:writedeleteTheme

    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

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    Apply typed edits to the draft (all or nothing). 409 when baseRevision is not the current revision

    POST/v1/store/themes/{themeId}/ops

    Or name the store: POST /v1/stores/{storeId}/themes/{themeId}/ops

    storefront:writeapplyThemeOps

    Parameters

    • themeIdthm_…pathrequired

    Body

    • baseRevisionintegerrequired
    • opsobject[]required
    • author"seller" | "ai" | "code"required
    • summarystringrequired
    • promptstring | nullrequired
    • aiProposalIdaipr_… | null

    Response ThemeSaveResult

    • revisionintegerrequired
    • changedFilesstring[]required
    • patchesobject[]required
      • pathstringrequired
      • opsJsonPatchOp[]required
    • createdIdsstring[]required
    • issuesThemeIssue[]required
    • hasUnpublishedChangesbooleanrequired

    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

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    Validate strictly, compile CSS, freeze the draft into a version and make the theme live

    POST/v1/store/themes/{themeId}/publish

    Or name the store: POST /v1/stores/{storeId}/themes/{themeId}/publish

    storefront:writepublishTheme

    Parameters

    • themeIdthm_…pathrequired

    Body

    • baseRevisionintegerrequired
    • namestring | nullrequired

    Response PublishThemeResponse

    • versionThemeVersionSummaryrequired
    • themeThemeSummaryrequired
    • warningsThemeIssue[]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

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    Reset the draft to the latest published version

    POST/v1/store/themes/{themeId}/discard

    Or name the store: POST /v1/stores/{storeId}/themes/{themeId}/discard

    storefront:writediscardThemeDraft

    Parameters

    • themeIdthm_…pathrequired

    Body

    • baseRevisionintegerrequired

    Response ThemeDraft

    • themeThemeSummaryrequired
    • revisionintegerrequired
    • filesThemeFilesRecordrequired
    • issuesThemeIssue[]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

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    Published versions, newest first

    GET/v1/store/themes/{themeId}/versions

    Or name the store: GET /v1/stores/{storeId}/themes/{themeId}/versions

    storefront:readlistThemeVersions

    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

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    One published version with its files

    GET/v1/store/themes/{themeId}/versions/{versionId}

    Or name the store: GET /v1/stores/{storeId}/themes/{themeId}/versions/{versionId}

    storefront:readgetThemeVersion

    Parameters

    • themeIdthm_…pathrequired
    • versionIdthv_…pathrequired

    Response GetThemeVersionResponse

    • versionThemeVersionSummaryrequired
    • filesThemeFilesRecordrequired

    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

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    Roll back: copy a version into the draft, and publish it again when asked

    POST/v1/store/themes/{themeId}/versions/{versionId}/restore

    Or name the store: POST /v1/stores/{storeId}/themes/{themeId}/versions/{versionId}/restore

    storefront:writerestoreThemeVersion

    Parameters

    • themeIdthm_…pathrequired
    • versionIdthv_…pathrequired

    Body

    • baseRevisionintegerrequired
    • publishbooleanrequired

    Response RestoreThemeVersionResponse

    • draftThemeDraftrequired
    • versionThemeVersionSummary | 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

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    Draft history with authors and AI prompts

    GET/v1/store/themes/{themeId}/revisions

    Or name the store: GET /v1/stores/{storeId}/themes/{themeId}/revisions

    storefront:readlistThemeRevisions

    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

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    Ask AI for a change. Returns validated ops to preview; nothing is saved until the seller applies them

    POST/v1/store/themes/{themeId}/ai

    Or name the store: POST /v1/stores/{storeId}/themes/{themeId}/ai

    storefront:writeproposeThemeEdit

    Parameters

    • themeIdthm_…pathrequired

    Body

    • promptstringrequired
    • baseRevisionintegerrequired
    • templatestringrequired
    • selectionobject | nullrequired
    • mode"edit" | "code"required
    • filestring | nullrequired
    • imagesobject[]
      • uploadIdupl_…required
    • conversationIdaicv_… | null

    Response ThemeAiProposal

    • summarystringrequired
    • opsThemeOp[]required
    • explanationsstring[]required
    • notesstring[]required
    • modelstringrequired
    • proposalIdAiProposalId | nullrequired
    • conversationIdAiConversationId | nullrequired
    • turnIdAiTurnId | 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

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    Your AI requests for this theme, newest first: what you asked (with images), the answer and what you did with it

    GET/v1/store/themes/{themeId}/ai/history

    Or name the store: GET /v1/stores/{storeId}/themes/{themeId}/ai/history

    storefront:readrole: ai:writethemeAiHistory

    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

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    Images uploaded into a theme

    GET/v1/store/themes/{themeId}/assets

    Or name the store: GET /v1/stores/{storeId}/themes/{themeId}/assets

    storefront:readlistThemeAssets

    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

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    Add a completed image upload to a theme (the editor then writes config/assets.json in the draft)

    POST/v1/store/themes/{themeId}/assets

    Or name the store: POST /v1/stores/{storeId}/themes/{themeId}/assets

    storefront:writeaddThemeAsset

    Parameters

    • themeIdthm_…pathrequired

    Body

    • uploadIdupl_…required
    • namestring | nullrequired

    Response ThemeAsset

    • idThemeAssetIdrequired
    • themeIdThemeIdrequired
    • nameThemeAssetNamerequired
    • urlstringrequired
    • contentTypestringrequired
    • bytesintegerrequired
    • widthinteger | nullrequired
    • heightinteger | nullrequired
    • createdAtTimestamprequired

    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

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    Remove an image from a theme. Published versions that use it keep working.

    DELETE/v1/store/themes/{themeId}/assets/{assetId}

    Or name the store: DELETE /v1/stores/{storeId}/themes/{themeId}/assets/{assetId}

    storefront:writedeleteThemeAsset

    Parameters

    • themeIdthm_…pathrequired
    • assetIdtha_…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

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    Whether a newer stock version exists, and what merging it into this theme's draft or live version would change

    GET/v1/store/themes/{themeId}/update

    Or name the store: GET /v1/stores/{storeId}/themes/{themeId}/update

    storefront:readgetThemeUpdate

    Parameters

    • themeIdthm_…pathrequired
    • target"draft" | "live"query

    Response ThemeUpdatePreview

    • themeIdThemeIdrequired
    • stockIdstringrequired
    • stockNamestringrequired
    • targetThemeUpdateTargetrequired
    • fromVersionstringrequired
    • toVersionstringrequired
    • targetsobject | nullrequired
    • availablebooleanrequired
    • base"snapshot" | "install_revision" | "none"required
    • filesobject[]required
      • pathstringrequired
      • outcomeThemeUpdateOutcomerequired
      • conflictsintegerrequired
    3 more fields
    • conflictsThemeUpdateConflict[]required
    • changelogThemeChangelogEntry[]required
    • mergedFilesobject | 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

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    Take the newest stock version, the way the seller chose: into the draft, as a new unpublished theme, or live (published at once)

    POST/v1/store/themes/{themeId}/update

    Or name the store: POST /v1/stores/{storeId}/themes/{themeId}/update

    storefront:writeapplyThemeUpdate

    Parameters

    • themeIdthm_…pathrequired

    Body

    • baseRevisionintegerrequired
    • resolutionsobject
    • mode"draft" | "new_theme" | "live"
    • namestring | null

    Response ApplyThemeUpdateResponse

    • draftThemeDraftrequired
    • updateThemeUpdatePreviewrequired
    • themeThemeSummary | nullrequired
    • versionThemeVersionSummary | nullrequired
    • rollbackobject | 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

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    Export a theme or one template as a share code (and the package file behind it)

    POST/v1/store/themes/{themeId}/shares

    Or name the store: POST /v1/stores/{storeId}/themes/{themeId}/shares

    storefront:writerole: storefront:writecreateThemeShare

    Parameters

    • themeIdthm_…pathrequired

    Body

    • scopeobjectrequired

    Response ThemeShare

    • codeThemeShareCoderequired
    • scopeThemeShareScoperequired
    • namestringrequired
    • stockIdstringrequired
    • fileCountintegerrequired
    • bytesintegerrequired
    • createdAtTimestamprequired
    • expiresAtTimestamprequired
    • packageThemeSharePackagerequired

    Example

    curl -X POST "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/shares" \
      -H "Authorization: Bearer $SHOPFAST_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
      "scope": {
        "kind": "theme"
      }
    }'
    const res = await fetch('https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/shares', {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "scope": {
          "kind": "theme"
        }
      }),
    });
    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/shares",
        headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
        json={
          "scope": {
            "kind": "theme"
          }
        },
    )
    res.raise_for_status()
    data = res.json()
    req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/shares", strings.NewReader(`{
      "scope": {
        "kind": "theme"
      }
    }`))
    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

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    Revoke a share code before it expires

    DELETE/v1/store/themes/{themeId}/shares/{code}

    Or name the store: DELETE /v1/stores/{storeId}/themes/{themeId}/shares/{code}

    storefront:writerole: storefront:writedeleteThemeShare

    Parameters

    • themeIdthm_…pathrequired
    • codestringpathrequired

    Response Ok

    • okbooleanrequired

    Example

    curl -X DELETE "https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/shares/string" \
      -H "Authorization: Bearer $SHOPFAST_API_KEY"
    const res = await fetch('https://api.shopfa.st/v1/store/themes/thm_0123456789abcdefghjk/shares/string', {
      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/shares/string",
        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/shares/string", nil)
    req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
    res, err := http.DefaultClient.Do(req)
    Try it with your key

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    Every template in a theme draft, with how many products, collections and pages use each alternate

    GET/v1/store/themes/{themeId}/templates

    Or name the store: GET /v1/stores/{storeId}/themes/{themeId}/templates

    storefront:readrole: storefront:readlistThemeTemplates

    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

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    Create an alternate template (templates/<type>.<suffix>.json) from the default template or by duplicating another

    POST/v1/store/themes/{themeId}/templates

    Or name the store: POST /v1/stores/{storeId}/themes/{themeId}/templates

    storefront:writerole: storefront:writecreateThemeTemplate

    Parameters

    • themeIdthm_…pathrequired

    Body

    • baseRevisionintegerrequired
    • type"product" | "collection" | "page"required
    • suffixstringrequired
    • fromstring | nullrequired

    Response CreateThemeTemplateResponse

    • templateThemeTemplaterequired
    • revisionintegerrequired
    • issuesThemeIssue[]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

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    Rename an alternate template. 409 while products, collections or pages use it, unless reassign moves them along

    POST/v1/store/themes/{themeId}/templates/rename

    Or name the store: POST /v1/stores/{storeId}/themes/{themeId}/templates/rename

    storefront:writerole: storefront:writerenameThemeTemplate

    Parameters

    • themeIdthm_…pathrequired

    Body

    • baseRevisionintegerrequired
    • type"product" | "collection" | "page"required
    • suffixstringrequired
    • tostringrequired
    • reassignboolean

    Response RenameThemeTemplateResponse

    • templateThemeTemplaterequired
    • revisionintegerrequired
    • issuesThemeIssue[]required
    • reassignedintegerrequired

    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

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    Delete an alternate template. 409 (with who uses it) while products, collections or pages are assigned to it

    POST/v1/store/themes/{themeId}/templates/delete

    Or name the store: POST /v1/stores/{storeId}/themes/{themeId}/templates/delete

    storefront:writerole: storefront:writedeleteThemeTemplate

    Parameters

    • themeIdthm_…pathrequired

    Body

    • baseRevisionintegerrequired
    • type"product" | "collection" | "page"required
    • suffixstringrequired

    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

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    Every section the theme can add, with its variants and the metadata the "Add section" library filters on

    GET/v1/store/themes/{themeId}/library

    Or name the store: GET /v1/stores/{storeId}/themes/{themeId}/library

    storefront:readrole: storefront:readgetSectionLibrary

    Parameters

    • themeIdthm_…pathrequired

    Response GetSectionLibraryResponse

    • sectionsSectionLibraryEntry[]required
    • categoriesstring[]required
    • layoutsLibraryLayoutType[]required
    • productCard"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

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    A page of this theme rendered before (the draft) or after (the draft with the stock update merged), for What's-new previews

    GET/v1/store/themes/{themeId}/update/render

    Or name the store: GET /v1/stores/{storeId}/themes/{themeId}/update/render

    storefront:readrole: storefront:readgetThemeUpdatePreviewHtml

    Parameters

    • themeIdthm_…pathrequired
    • template"404" | "index" | "product" | "collection" | "list-collections" | "page" | "search" | "reviews" | "cart"query
    • side"before" | "after"query
    • target"draft" | "live"query

    Response GetThemeUpdatePreviewHtmlResponse

    • htmlstringrequired
    • templatestringrequired
    • side"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

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    Keep a version ShopFast published without asking, or restore the version before it (live at once; the draft too, when untouched since)

    POST/v1/store/themes/{themeId}/versions/{versionId}/answer

    Or name the store: POST /v1/stores/{storeId}/themes/{themeId}/versions/{versionId}/answer

    storefront:writerole: storefront:writeanswerUnrequestedThemeVersion

    Parameters

    • themeIdthm_…pathrequired
    • versionIdthv_…pathrequired

    Body

    • decision"keep" | "restore"required

    Response AnswerUnrequestedThemeVersionResponse

    • themeThemeSummaryrequired
    • restoredThemeVersionSummary | nullrequired
    • draftRestoredbooleanrequired
    • atTimestamprequired

    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

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    Regenerate a section's copy, rewrite it in the seller's tone, or translate it. Returns validated ops to preview

    POST/v1/store/themes/{themeId}/ai/copy

    Or name the store: POST /v1/stores/{storeId}/themes/{themeId}/ai/copy

    storefront:writerole: storefront:writerewriteSectionCopy

    Parameters

    • themeIdthm_…pathrequired

    Body

    • action"regenerate" | "tone" | "translate"required
    • baseRevisionintegerrequired
    • filestringrequired
    • sectionstringrequired
    • tonestring | null
    • languagestring | null
    • hintstring | null

    Response ThemeAiProposal

    • summarystringrequired
    • opsThemeOp[]required
    • explanationsstring[]required
    • notesstring[]required
    • modelstringrequired
    • proposalIdAiProposalId | nullrequired
    • conversationIdAiConversationId | nullrequired
    • turnIdAiTurnId | 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)
    Try it with your key

    Use a test key on a development store. The key stays in this tab (sessionStorage) and is sent only to the base URL above.

    Was this page helpful?