Popups
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.
Popup offers with impressions and conversions per variant (last 30 days)
GET
/v1/store/popupsOr name the store: GET /v1/stores/{storeId}/popups
Parameters
status"all" | "live" | "draft" | "paused" | "archived"query
Response ListPopupsResponse
itemsPopup[]requiredcountsobjectrequiredallintegerrequiredliveintegerrequireddraftintegerrequiredpausedintegerrequiredarchivedintegerrequired
Example
curl "https://api.shopfa.st/v1/store/popups" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/popups', {
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/popups",
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/popups", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)Try it with your key
Create a popup offer
POST
/v1/store/popupsOr name the store: POST /v1/stores/{storeId}/popups
Body
namestringrequiredkind"coupon" | "email" | "exit" | "upsell" | "announcement"requiredstatus"draft" | "live" | "paused" | "archived"requiredtriggerobjectrequiredkind"delay" | "scroll" | "exit" | "add_to_cart" | "page_views"requireddelaySecondsintegerscrollPercentintegerpageViewsintegerexitOnMobileboolean
targetingobjectrequiredpages"home" | "product" | "collection" | "list-collections" | "cart" | "page" | "search" | "reviews" | "other"[]productHandlesstring[]collectionHandlesstring[]urlContainsstring[]urlExcludesstring[]devices"all" | "desktop" | "mobile"visitors"all" | "new" | "returning"buyers"all" | "buyers" | "non_buyers"cart"any" | "empty" | "has_items"utmSourcestring[]utmMediumstring[]utmCampaignstring[]
frequencyobjectrequiredshowAgainAfterDaysintegermaxShowsinteger | nullstopAfterConversionboolean
variantsobject[]requiredkey"a" | "b" | "c"requirednamestringrequiredweightintegerrequiredcontentobjectrequiredeyebrowstringheadingstringrequiredbodystringctaLabelstringctaLinkstringdismissLabelstringcouponMode"none" | "code" | "unique"discountIddsc_… | nullrevealAfterEmailbooleanemailCapturebooleanemailPlaceholderstringconsentLabelstringrequireConsentbooleansubmitLabelstringsuccessHeadingstringsuccessBodystringtimerMinutesinteger | nullupsellHandlestring | null
designobjectrequiredlayout"modal" | "split" | "corner" | "bar" | "sheet"position"center" | "bottom-right" | "bottom-left" | "top" | "bottom"surface"store" | "light" | "dark"accentstring | nullradiusintegermotion"rise" | "scale" | "slide" | "fade"width"sm" | "md" | "lg"imageUrlstring | nullbackdropintegershowCloseboolean
startsAtstring | nullendsAtstring | nullpriorityinteger
Response Popup
namestringrequiredkindPopupKindrequiredstatusPopupStatusrequiredtriggerPopupTriggerrequiredtargetingPopupTargetingrequiredfrequencyPopupFrequencyrequiredvariantsPopupVariant[]requiredstartsAtTimestamp | nullrequiredendsAtTimestamp | nullrequiredpriorityintegerrequired
5 more fields
idPopupIdrequiredshowingbooleanrequiredstatsPopupVariantStats[]requiredcreatedAtTimestamprequiredupdatedAtTimestamprequired
Example
curl -X POST "https://api.shopfa.st/v1/store/popups" \
-H "Authorization: Bearer $SHOPFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"kind": "coupon",
"status": "draft",
"trigger": {
"kind": "delay"
},
"targeting": {},
"frequency": {},
"variants": [
{
"key": "a",
"name": "string",
"weight": 0,
"content": {
"heading": "string"
},
"design": {}
}
],
"startsAt": null,
"endsAt": null,
"priority": 50
}'const res = await fetch('https://api.shopfa.st/v1/store/popups', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "string",
"kind": "coupon",
"status": "draft",
"trigger": {
"kind": "delay"
},
"targeting": {},
"frequency": {},
"variants": [
{
"key": "a",
"name": "string",
"weight": 0,
"content": {
"heading": "string"
},
"design": {}
}
],
"startsAt": null,
"endsAt": null,
"priority": 50
}),
});
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/popups",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
json={
"name": "string",
"kind": "coupon",
"status": "draft",
"trigger": {
"kind": "delay"
},
"targeting": {},
"frequency": {},
"variants": [
{
"key": "a",
"name": "string",
"weight": 0,
"content": {
"heading": "string"
},
"design": {}
}
],
"startsAt": None,
"endsAt": None,
"priority": 50
},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/popups", strings.NewReader(`{
"name": "string",
"kind": "coupon",
"status": "draft",
"trigger": {
"kind": "delay"
},
"targeting": {},
"frequency": {},
"variants": [
{
"key": "a",
"name": "string",
"weight": 0,
"content": {
"heading": "string"
},
"design": {}
}
],
"startsAt": null,
"endsAt": null,
"priority": 50
}`))
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
One popup with its daily series and recent email signups
GET
/v1/store/popups/{popupId}Or name the store: GET /v1/stores/{storeId}/popups/{popupId}
Parameters
popupIdpop_…pathrequireddaysinteger | stringquery
Response PopupDetail
popupPopuprequiredseriesobject[]requireddateIsoDaterequiredkeyPopupVariantKeyrequiredimpressionsintegerrequiredconversionsintegerrequired
leadsobject[]requiredemailEmailrequiredvariantPopupVariantKeyrequiredconsentbooleanrequiredcodestringrequiredcreatedAtTimestamprequired
leadCountintegerrequired
Example
curl "https://api.shopfa.st/v1/store/popups/pop_0123456789abcdefghjk" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/popups/pop_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/popups/pop_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/popups/pop_0123456789abcdefghjk", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)Try it with your key
Save a popup offer
PUT
/v1/store/popups/{popupId}Or name the store: PUT /v1/stores/{storeId}/popups/{popupId}
Parameters
popupIdpop_…pathrequired
Body
namestringrequiredkind"coupon" | "email" | "exit" | "upsell" | "announcement"requiredstatus"draft" | "live" | "paused" | "archived"requiredtriggerobjectrequiredkind"delay" | "scroll" | "exit" | "add_to_cart" | "page_views"requireddelaySecondsintegerscrollPercentintegerpageViewsintegerexitOnMobileboolean
targetingobjectrequiredpages"home" | "product" | "collection" | "list-collections" | "cart" | "page" | "search" | "reviews" | "other"[]productHandlesstring[]collectionHandlesstring[]urlContainsstring[]urlExcludesstring[]devices"all" | "desktop" | "mobile"visitors"all" | "new" | "returning"buyers"all" | "buyers" | "non_buyers"cart"any" | "empty" | "has_items"utmSourcestring[]utmMediumstring[]utmCampaignstring[]
frequencyobjectrequiredshowAgainAfterDaysintegermaxShowsinteger | nullstopAfterConversionboolean
variantsobject[]requiredkey"a" | "b" | "c"requirednamestringrequiredweightintegerrequiredcontentobjectrequiredeyebrowstringheadingstringrequiredbodystringctaLabelstringctaLinkstringdismissLabelstringcouponMode"none" | "code" | "unique"discountIddsc_… | nullrevealAfterEmailbooleanemailCapturebooleanemailPlaceholderstringconsentLabelstringrequireConsentbooleansubmitLabelstringsuccessHeadingstringsuccessBodystringtimerMinutesinteger | nullupsellHandlestring | null
designobjectrequiredlayout"modal" | "split" | "corner" | "bar" | "sheet"position"center" | "bottom-right" | "bottom-left" | "top" | "bottom"surface"store" | "light" | "dark"accentstring | nullradiusintegermotion"rise" | "scale" | "slide" | "fade"width"sm" | "md" | "lg"imageUrlstring | nullbackdropintegershowCloseboolean
startsAtstring | nullendsAtstring | nullpriorityinteger
Response Popup
namestringrequiredkindPopupKindrequiredstatusPopupStatusrequiredtriggerPopupTriggerrequiredtargetingPopupTargetingrequiredfrequencyPopupFrequencyrequiredvariantsPopupVariant[]requiredstartsAtTimestamp | nullrequiredendsAtTimestamp | nullrequiredpriorityintegerrequired
5 more fields
idPopupIdrequiredshowingbooleanrequiredstatsPopupVariantStats[]requiredcreatedAtTimestamprequiredupdatedAtTimestamprequired
Example
curl -X PUT "https://api.shopfa.st/v1/store/popups/pop_0123456789abcdefghjk" \
-H "Authorization: Bearer $SHOPFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"kind": "coupon",
"status": "draft",
"trigger": {
"kind": "delay"
},
"targeting": {},
"frequency": {},
"variants": [
{
"key": "a",
"name": "string",
"weight": 0,
"content": {
"heading": "string"
},
"design": {}
}
],
"startsAt": null,
"endsAt": null,
"priority": 50
}'const res = await fetch('https://api.shopfa.st/v1/store/popups/pop_0123456789abcdefghjk', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"name": "string",
"kind": "coupon",
"status": "draft",
"trigger": {
"kind": "delay"
},
"targeting": {},
"frequency": {},
"variants": [
{
"key": "a",
"name": "string",
"weight": 0,
"content": {
"heading": "string"
},
"design": {}
}
],
"startsAt": null,
"endsAt": null,
"priority": 50
}),
});
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/popups/pop_0123456789abcdefghjk",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
json={
"name": "string",
"kind": "coupon",
"status": "draft",
"trigger": {
"kind": "delay"
},
"targeting": {},
"frequency": {},
"variants": [
{
"key": "a",
"name": "string",
"weight": 0,
"content": {
"heading": "string"
},
"design": {}
}
],
"startsAt": None,
"endsAt": None,
"priority": 50
},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("PUT", "https://api.shopfa.st/v1/store/popups/pop_0123456789abcdefghjk", strings.NewReader(`{
"name": "string",
"kind": "coupon",
"status": "draft",
"trigger": {
"kind": "delay"
},
"targeting": {},
"frequency": {},
"variants": [
{
"key": "a",
"name": "string",
"weight": 0,
"content": {
"heading": "string"
},
"design": {}
}
],
"startsAt": null,
"endsAt": null,
"priority": 50
}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)Try it with your key
Delete a popup with its stats (email signups stay in the export until then)
DELETE
/v1/store/popups/{popupId}Or name the store: DELETE /v1/stores/{storeId}/popups/{popupId}
Parameters
popupIdpop_…pathrequired
Response Ok
okbooleanrequired
Example
curl -X DELETE "https://api.shopfa.st/v1/store/popups/pop_0123456789abcdefghjk" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/popups/pop_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/popups/pop_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/popups/pop_0123456789abcdefghjk", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)Try it with your key
Publish, pause or archive a popup
POST
/v1/store/popups/{popupId}/statusOr name the store: POST /v1/stores/{storeId}/popups/{popupId}/status
Parameters
popupIdpop_…pathrequired
Body
status"draft" | "live" | "paused" | "archived"required
Response Popup
namestringrequiredkindPopupKindrequiredstatusPopupStatusrequiredtriggerPopupTriggerrequiredtargetingPopupTargetingrequiredfrequencyPopupFrequencyrequiredvariantsPopupVariant[]requiredstartsAtTimestamp | nullrequiredendsAtTimestamp | nullrequiredpriorityintegerrequired
5 more fields
idPopupIdrequiredshowingbooleanrequiredstatsPopupVariantStats[]requiredcreatedAtTimestamprequiredupdatedAtTimestamprequired
Example
curl -X POST "https://api.shopfa.st/v1/store/popups/pop_0123456789abcdefghjk/status" \
-H "Authorization: Bearer $SHOPFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"status": "draft"
}'const res = await fetch('https://api.shopfa.st/v1/store/popups/pop_0123456789abcdefghjk/status', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"status": "draft"
}),
});
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/popups/pop_0123456789abcdefghjk/status",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
json={
"status": "draft"
},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/popups/pop_0123456789abcdefghjk/status", strings.NewReader(`{
"status": "draft"
}`))
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
Copy a popup as a draft
POST
/v1/store/popups/{popupId}/duplicateOr name the store: POST /v1/stores/{storeId}/popups/{popupId}/duplicate
Parameters
popupIdpop_…pathrequired
Response Popup
namestringrequiredkindPopupKindrequiredstatusPopupStatusrequiredtriggerPopupTriggerrequiredtargetingPopupTargetingrequiredfrequencyPopupFrequencyrequiredvariantsPopupVariant[]requiredstartsAtTimestamp | nullrequiredendsAtTimestamp | nullrequiredpriorityintegerrequired
5 more fields
idPopupIdrequiredshowingbooleanrequiredstatsPopupVariantStats[]requiredcreatedAtTimestamprequiredupdatedAtTimestamprequired
Example
curl -X POST "https://api.shopfa.st/v1/store/popups/pop_0123456789abcdefghjk/duplicate" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/popups/pop_0123456789abcdefghjk/duplicate', {
method: 'POST',
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(
"POST",
"https://api.shopfa.st/v1/store/popups/pop_0123456789abcdefghjk/duplicate",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/popups/pop_0123456789abcdefghjk/duplicate", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)Try it with your key
Email signups of a popup as CSV, with consent and the code each got
GET
/v1/store/popups/{popupId}/leads/exportOr name the store: GET /v1/stores/{storeId}/popups/{popupId}/leads/export
Parameters
popupIdpop_…pathrequired
Response FileExport
filenamestringrequiredcontentTypestringrequiredbodystringrequiredrowsintegerrequired
Example
curl "https://api.shopfa.st/v1/store/popups/pop_0123456789abcdefghjk/leads/export" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/popups/pop_0123456789abcdefghjk/leads/export', {
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/popups/pop_0123456789abcdefghjk/leads/export",
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/popups/pop_0123456789abcdefghjk/leads/export", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)