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/emailsOr name the store: GET /v1/stores/{storeId}/emails
Response EmailsOverview
templatesEmailTemplate[]requiredbrandingEmailBrandingrequireddelivery"resend" | "console"requiredfromstringrequired
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
Save a template (unknown variables are rejected)
PUT
/v1/store/emails/{kind}Or name the store: PUT /v1/stores/{storeId}/emails/{kind}
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
enabledbooleanrequiredsubjectstringrequiredheadingstringrequiredbodystringrequiredbuttonLabelstringrequiredfooterstringrequired
Response EmailTemplate
enabledbooleanrequiredsubjectstringrequiredheadingstringrequiredbodystringrequiredbuttonLabelstringrequiredfooterstringrequiredkindEmailTemplateKindrequirednamestringrequiredtriggerstringrequiredcustomizedbooleanrequiredupdatedAtTimestamp | nullrequiredsent30dintegerrequired
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
Go back to the ShopFast default
DELETE
/v1/store/emails/{kind}Or name the store: DELETE /v1/stores/{storeId}/emails/{kind}
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
enabledbooleanrequiredsubjectstringrequiredheadingstringrequiredbodystringrequiredbuttonLabelstringrequiredfooterstringrequiredkindEmailTemplateKindrequirednamestringrequiredtriggerstringrequiredcustomizedbooleanrequiredupdatedAtTimestamp | nullrequiredsent30dintegerrequired
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
Send the template (or unsaved edits) with sample values to your own email
POST
/v1/store/emails/{kind}/testOr name the store: POST /v1/stores/{storeId}/emails/{kind}/test
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
enabledbooleanrequiredsubjectstringrequiredheadingstringrequiredbodystringrequiredbuttonLabelstringrequiredfooterstringrequired
Response SendTestEmailResponse
tostringrequiredsubjectstringrequired
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
A transactional email as blocks, with its typed variables and preview data
GET
/v1/store/emails/{kind}/documentOr name the store: GET /v1/stores/{storeId}/emails/{kind}/document
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
kindEmailTemplateKindrequirednamestringrequiredtriggerstringrequiredenabledbooleanrequiredalwaysOnbooleanrequireddocEmailDocumentrequiredblocksbooleanrequiredvariablesobject[]requirednamestringrequiredlabelstringrequiredtype"text" | "url" | "money" | "date" | "number" | "code" | "list"requiredgroup"Store" | "Customer" | "Order" | "Product" | "Marketing" | "Subscription" | "Support"requiredsamplestringrequired
sampleobjectrequiredtextobjectrequireditemsobject[]requirednamestringrequiredquantityintegerrequiredpricestringrequired
linksobject[]requiredlabelstringrequiredurlstringrequired
keysobject[]requiredproductstringrequiredkeystringrequired
brandingEmailBrandingrequiredupdatedAtTimestamp | 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
Save a transactional email built with blocks (keeps a version)
PUT
/v1/store/emails/{kind}/documentOr name the store: PUT /v1/stores/{storeId}/emails/{kind}/document
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
enabledbooleanrequireddocobjectrequiredversionnumbersubjectstringrequiredpreheaderstringstyleobjectaccentstring | nullbackgroundstringsurfacestringtextstringmutedstringborderstringbuttonTextstringradiusintegerbuttonRadiusintegerfont"system" | "humanist" | "geometric" | "serif" | "mono"widthintegershowLogobooleanaccentBarboolean
blocksobject[]required
Response SaveEmailDocumentResponse
okbooleanrequiredupdatedAtTimestamprequired
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
Send yourself a test with sample data (rendered on the server exactly as buyers get it)
POST
/v1/store/emails/{kind}/document/testOr name the store: POST /v1/stores/{storeId}/emails/{kind}/document/test
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
docobjectrequiredversionnumbersubjectstringrequiredpreheaderstringstyleobjectaccentstring | nullbackgroundstringsurfacestringtextstringmutedstringborderstringbuttonTextstringradiusintegerbuttonRadiusintegerfont"system" | "humanist" | "geometric" | "serif" | "mono"widthintegershowLogobooleanaccentBarboolean
blocksobject[]required
Response TestEmailDocumentResponse
tostringrequiredsubjectstringrequired
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
The server render of a document (email HTML and text) with sample data
POST
/v1/store/emails/renderOr name the store: POST /v1/stores/{storeId}/emails/render
Body
docobjectrequiredversionnumbersubjectstringrequiredpreheaderstringstyleobjectaccentstring | nullbackgroundstringsurfacestringtextstringmutedstringborderstringbuttonTextstringradiusintegerbuttonRadiusintegerfont"system" | "humanist" | "geometric" | "serif" | "mono"widthintegershowLogobooleanaccentBarboolean
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" | nullrequiredflowstring | nullrequired
Response RenderEmailPreviewResponse
subjectstringrequiredhtmlstringrequiredtextstringrequiredissuesobject[]requiredpathstringrequiredmessagestringrequired
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)