Docs
Dashboard
On this page

    Emails

    8 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.

    Transactional email templates with branding and 30-day send counts

    GET/v1/store/emails

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

    storefront:readrole: storefront:readlistEmailTemplates

    Response EmailsOverview

    • templatesEmailTemplate[]required
    • brandingEmailBrandingrequired
    • delivery"resend" | "console"required
    • fromstringrequired

    Example

    curl "https://api.shopfa.st/v1/store/emails" \
      -H "Authorization: Bearer $SHOPFAST_API_KEY"
    const res = await fetch('https://api.shopfa.st/v1/store/emails', {
      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/emails",
        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/emails", 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.

    Save a template (unknown variables are rejected)

    PUT/v1/store/emails/{kind}

    Or name the store: PUT /v1/stores/{storeId}/emails/{kind}

    storefront:writerole: storefront:writeupdateEmailTemplate

    Parameters

    • kind"receipt" | "download_ready" | "license_key" | "subscription_renewed" | "subscription_cancelled" | "review_request" | "abandoned_checkout" | "otp" | "subscription_renewal_due" | "subscription_payment_failed" | "subscription_action_required" | "subscription_renewal_paused" | "ticket_received" | "ticket_reply" | "ticket_solved" | "subscribe_confirm" | "status_update" | "back_in_stock" | "payment_waiting" | "payment_reminder" | "payment_expired" | "payment_declined"pathrequired

    Body

    • enabledbooleanrequired
    • subjectstringrequired
    • headingstringrequired
    • bodystringrequired
    • buttonLabelstringrequired
    • footerstringrequired

    Response EmailTemplate

    • enabledbooleanrequired
    • subjectstringrequired
    • headingstringrequired
    • bodystringrequired
    • buttonLabelstringrequired
    • footerstringrequired
    • kindEmailTemplateKindrequired
    • namestringrequired
    • triggerstringrequired
    • customizedbooleanrequired
    • updatedAtTimestamp | nullrequired
    • sent30dintegerrequired

    Example

    curl -X PUT "https://api.shopfa.st/v1/store/emails/receipt" \
      -H "Authorization: Bearer $SHOPFAST_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
      "enabled": false,
      "subject": "string",
      "heading": "string",
      "body": "string",
      "buttonLabel": "string",
      "footer": "string"
    }'
    const res = await fetch('https://api.shopfa.st/v1/store/emails/receipt', {
      method: 'PUT',
      headers: {
        Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "enabled": false,
        "subject": "string",
        "heading": "string",
        "body": "string",
        "buttonLabel": "string",
        "footer": "string"
      }),
    });
    if (!res.ok) throw new Error((await res.json()).detail);
    const data = await res.json();
    import os, requests
    
    res = requests.request(
        "PUT",
        "https://api.shopfa.st/v1/store/emails/receipt",
        headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
        json={
          "enabled": False,
          "subject": "string",
          "heading": "string",
          "body": "string",
          "buttonLabel": "string",
          "footer": "string"
        },
    )
    res.raise_for_status()
    data = res.json()
    req, _ := http.NewRequest("PUT", "https://api.shopfa.st/v1/store/emails/receipt", strings.NewReader(`{
      "enabled": false,
      "subject": "string",
      "heading": "string",
      "body": "string",
      "buttonLabel": "string",
      "footer": "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.

    Go back to the ShopFast default

    DELETE/v1/store/emails/{kind}

    Or name the store: DELETE /v1/stores/{storeId}/emails/{kind}

    storefront:writerole: storefront:writeresetEmailTemplate

    Parameters

    • kind"receipt" | "download_ready" | "license_key" | "subscription_renewed" | "subscription_cancelled" | "review_request" | "abandoned_checkout" | "otp" | "subscription_renewal_due" | "subscription_payment_failed" | "subscription_action_required" | "subscription_renewal_paused" | "ticket_received" | "ticket_reply" | "ticket_solved" | "subscribe_confirm" | "status_update" | "back_in_stock" | "payment_waiting" | "payment_reminder" | "payment_expired" | "payment_declined"pathrequired

    Response EmailTemplate

    • enabledbooleanrequired
    • subjectstringrequired
    • headingstringrequired
    • bodystringrequired
    • buttonLabelstringrequired
    • footerstringrequired
    • kindEmailTemplateKindrequired
    • namestringrequired
    • triggerstringrequired
    • customizedbooleanrequired
    • updatedAtTimestamp | nullrequired
    • sent30dintegerrequired

    Example

    curl -X DELETE "https://api.shopfa.st/v1/store/emails/receipt" \
      -H "Authorization: Bearer $SHOPFAST_API_KEY"
    const res = await fetch('https://api.shopfa.st/v1/store/emails/receipt', {
      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/emails/receipt",
        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/emails/receipt", 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.

    Send the template (or unsaved edits) with sample values to your own email

    POST/v1/store/emails/{kind}/test

    Or name the store: POST /v1/stores/{storeId}/emails/{kind}/test

    storefront:writerole: storefront:writesendTestEmail

    Parameters

    • kind"receipt" | "download_ready" | "license_key" | "subscription_renewed" | "subscription_cancelled" | "review_request" | "abandoned_checkout" | "otp" | "subscription_renewal_due" | "subscription_payment_failed" | "subscription_action_required" | "subscription_renewal_paused" | "ticket_received" | "ticket_reply" | "ticket_solved" | "subscribe_confirm" | "status_update" | "back_in_stock" | "payment_waiting" | "payment_reminder" | "payment_expired" | "payment_declined"pathrequired

    Body

    • enabledbooleanrequired
    • subjectstringrequired
    • headingstringrequired
    • bodystringrequired
    • buttonLabelstringrequired
    • footerstringrequired

    Response SendTestEmailResponse

    • tostringrequired
    • subjectstringrequired

    Example

    curl -X POST "https://api.shopfa.st/v1/store/emails/receipt/test" \
      -H "Authorization: Bearer $SHOPFAST_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
      "enabled": false,
      "subject": "string",
      "heading": "string",
      "body": "string",
      "buttonLabel": "string",
      "footer": "string"
    }'
    const res = await fetch('https://api.shopfa.st/v1/store/emails/receipt/test', {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "enabled": false,
        "subject": "string",
        "heading": "string",
        "body": "string",
        "buttonLabel": "string",
        "footer": "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/emails/receipt/test",
        headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
        json={
          "enabled": False,
          "subject": "string",
          "heading": "string",
          "body": "string",
          "buttonLabel": "string",
          "footer": "string"
        },
    )
    res.raise_for_status()
    data = res.json()
    req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/emails/receipt/test", strings.NewReader(`{
      "enabled": false,
      "subject": "string",
      "heading": "string",
      "body": "string",
      "buttonLabel": "string",
      "footer": "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.

    A transactional email as blocks, with its typed variables and preview data

    GET/v1/store/emails/{kind}/document

    Or name the store: GET /v1/stores/{storeId}/emails/{kind}/document

    storefront:readrole: storefront:readgetEmailDocument

    Parameters

    • kind"receipt" | "download_ready" | "license_key" | "subscription_renewed" | "subscription_cancelled" | "review_request" | "abandoned_checkout" | "otp" | "subscription_renewal_due" | "subscription_payment_failed" | "subscription_action_required" | "subscription_renewal_paused" | "ticket_received" | "ticket_reply" | "ticket_solved" | "subscribe_confirm" | "status_update" | "back_in_stock" | "payment_waiting" | "payment_reminder" | "payment_expired" | "payment_declined"pathrequired

    Response GetEmailDocumentResponse

    • kindEmailTemplateKindrequired
    • namestringrequired
    • triggerstringrequired
    • enabledbooleanrequired
    • alwaysOnbooleanrequired
    • docEmailDocumentrequired
    • blocksbooleanrequired
    • variablesobject[]required
      • namestringrequired
      • labelstringrequired
      • type"text" | "url" | "money" | "date" | "number" | "code" | "list"required
      • group"Store" | "Customer" | "Order" | "Product" | "Marketing" | "Subscription" | "Support"required
      • samplestringrequired
    • sampleobjectrequired
      • textobjectrequired
      • itemsobject[]required
        • namestringrequired
        • quantityintegerrequired
        • pricestringrequired
      • linksobject[]required
        • labelstringrequired
        • urlstringrequired
      • keysobject[]required
        • productstringrequired
        • keystringrequired
    • brandingEmailBrandingrequired
    • updatedAtTimestamp | nullrequired

    Example

    curl "https://api.shopfa.st/v1/store/emails/receipt/document" \
      -H "Authorization: Bearer $SHOPFAST_API_KEY"
    const res = await fetch('https://api.shopfa.st/v1/store/emails/receipt/document', {
      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/emails/receipt/document",
        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/emails/receipt/document", 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.

    Save a transactional email built with blocks (keeps a version)

    PUT/v1/store/emails/{kind}/document

    Or name the store: PUT /v1/stores/{storeId}/emails/{kind}/document

    storefront:writerole: storefront:writesaveEmailDocument

    Parameters

    • kind"receipt" | "download_ready" | "license_key" | "subscription_renewed" | "subscription_cancelled" | "review_request" | "abandoned_checkout" | "otp" | "subscription_renewal_due" | "subscription_payment_failed" | "subscription_action_required" | "subscription_renewal_paused" | "ticket_received" | "ticket_reply" | "ticket_solved" | "subscribe_confirm" | "status_update" | "back_in_stock" | "payment_waiting" | "payment_reminder" | "payment_expired" | "payment_declined"pathrequired

    Body

    • enabledbooleanrequired
    • docobjectrequired
      • versionnumber
      • subjectstringrequired
      • preheaderstring
      • styleobject
        • accentstring | null
        • backgroundstring
        • surfacestring
        • textstring
        • mutedstring
        • borderstring
        • buttonTextstring
        • radiusinteger
        • buttonRadiusinteger
        • font"system" | "humanist" | "geometric" | "serif" | "mono"
        • widthinteger
        • showLogoboolean
        • accentBarboolean
      • blocksobject[]required

    Response SaveEmailDocumentResponse

    • okbooleanrequired
    • updatedAtTimestamprequired

    Example

    curl -X PUT "https://api.shopfa.st/v1/store/emails/receipt/document" \
      -H "Authorization: Bearer $SHOPFAST_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
      "enabled": false,
      "doc": {
        "subject": "string",
        "blocks": [
          {
            "id": "string",
            "type": "heading",
            "text": "string"
          }
        ]
      }
    }'
    const res = await fetch('https://api.shopfa.st/v1/store/emails/receipt/document', {
      method: 'PUT',
      headers: {
        Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "enabled": false,
        "doc": {
          "subject": "string",
          "blocks": [
            {
              "id": "string",
              "type": "heading",
              "text": "string"
            }
          ]
        }
      }),
    });
    if (!res.ok) throw new Error((await res.json()).detail);
    const data = await res.json();
    import os, requests
    
    res = requests.request(
        "PUT",
        "https://api.shopfa.st/v1/store/emails/receipt/document",
        headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
        json={
          "enabled": False,
          "doc": {
            "subject": "string",
            "blocks": [
              {
                "id": "string",
                "type": "heading",
                "text": "string"
              }
            ]
          }
        },
    )
    res.raise_for_status()
    data = res.json()
    req, _ := http.NewRequest("PUT", "https://api.shopfa.st/v1/store/emails/receipt/document", strings.NewReader(`{
      "enabled": false,
      "doc": {
        "subject": "string",
        "blocks": [
          {
            "id": "string",
            "type": "heading",
            "text": "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.

    Send yourself a test with sample data (rendered on the server exactly as buyers get it)

    POST/v1/store/emails/{kind}/document/test

    Or name the store: POST /v1/stores/{storeId}/emails/{kind}/document/test

    storefront:writerole: storefront:writetestEmailDocument

    Parameters

    • kind"receipt" | "download_ready" | "license_key" | "subscription_renewed" | "subscription_cancelled" | "review_request" | "abandoned_checkout" | "otp" | "subscription_renewal_due" | "subscription_payment_failed" | "subscription_action_required" | "subscription_renewal_paused" | "ticket_received" | "ticket_reply" | "ticket_solved" | "subscribe_confirm" | "status_update" | "back_in_stock" | "payment_waiting" | "payment_reminder" | "payment_expired" | "payment_declined"pathrequired

    Body

    • docobjectrequired
      • versionnumber
      • subjectstringrequired
      • preheaderstring
      • styleobject
        • accentstring | null
        • backgroundstring
        • surfacestring
        • textstring
        • mutedstring
        • borderstring
        • buttonTextstring
        • radiusinteger
        • buttonRadiusinteger
        • font"system" | "humanist" | "geometric" | "serif" | "mono"
        • widthinteger
        • showLogoboolean
        • accentBarboolean
      • blocksobject[]required

    Response TestEmailDocumentResponse

    • tostringrequired
    • subjectstringrequired

    Example

    curl -X POST "https://api.shopfa.st/v1/store/emails/receipt/document/test" \
      -H "Authorization: Bearer $SHOPFAST_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
      "doc": {
        "subject": "string",
        "blocks": [
          {
            "id": "string",
            "type": "heading",
            "text": "string"
          }
        ]
      }
    }'
    const res = await fetch('https://api.shopfa.st/v1/store/emails/receipt/document/test', {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "doc": {
          "subject": "string",
          "blocks": [
            {
              "id": "string",
              "type": "heading",
              "text": "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/emails/receipt/document/test",
        headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
        json={
          "doc": {
            "subject": "string",
            "blocks": [
              {
                "id": "string",
                "type": "heading",
                "text": "string"
              }
            ]
          }
        },
    )
    res.raise_for_status()
    data = res.json()
    req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/emails/receipt/document/test", strings.NewReader(`{
      "doc": {
        "subject": "string",
        "blocks": [
          {
            "id": "string",
            "type": "heading",
            "text": "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.

    The server render of a document (email HTML and text) with sample data

    POST/v1/store/emails/render

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

    storefront:writerole: storefront:readrenderEmailPreview

    Body

    • docobjectrequired
      • versionnumber
      • subjectstringrequired
      • preheaderstring
      • styleobject
        • accentstring | null
        • backgroundstring
        • surfacestring
        • textstring
        • mutedstring
        • borderstring
        • buttonTextstring
        • radiusinteger
        • buttonRadiusinteger
        • font"system" | "humanist" | "geometric" | "serif" | "mono"
        • widthinteger
        • showLogoboolean
        • accentBarboolean
      • blocksobject[]required
    • kind"receipt" | "download_ready" | "license_key" | "subscription_renewed" | "subscription_cancelled" | "review_request" | "abandoned_checkout" | "otp" | "subscription_renewal_due" | "subscription_payment_failed" | "subscription_action_required" | "subscription_renewal_paused" | "ticket_received" | "ticket_reply" | "ticket_solved" | "subscribe_confirm" | "status_update" | "back_in_stock" | "payment_waiting" | "payment_reminder" | "payment_expired" | "payment_declined" | nullrequired
    • flowstring | nullrequired

    Response RenderEmailPreviewResponse

    • subjectstringrequired
    • htmlstringrequired
    • textstringrequired
    • issuesobject[]required
      • pathstringrequired
      • messagestringrequired

    Example

    curl -X POST "https://api.shopfa.st/v1/store/emails/render" \
      -H "Authorization: Bearer $SHOPFAST_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
      "doc": {
        "subject": "string",
        "blocks": [
          {
            "id": "string",
            "type": "heading",
            "text": "string"
          }
        ]
      },
      "kind": "receipt",
      "flow": "string"
    }'
    const res = await fetch('https://api.shopfa.st/v1/store/emails/render', {
      method: 'POST',
      headers: {
        Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        "doc": {
          "subject": "string",
          "blocks": [
            {
              "id": "string",
              "type": "heading",
              "text": "string"
            }
          ]
        },
        "kind": "receipt",
        "flow": "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/emails/render",
        headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
        json={
          "doc": {
            "subject": "string",
            "blocks": [
              {
                "id": "string",
                "type": "heading",
                "text": "string"
              }
            ]
          },
          "kind": "receipt",
          "flow": "string"
        },
    )
    res.raise_for_status()
    data = res.json()
    req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/emails/render", strings.NewReader(`{
      "doc": {
        "subject": "string",
        "blocks": [
          {
            "id": "string",
            "type": "heading",
            "text": "string"
          }
        ]
      },
      "kind": "receipt",
      "flow": "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.

    Was this page helpful?