Licenses
3 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.
Sold keys with their state, devices and expiry. `q` matches an exact key, an email, an order number or a key id
GET
/v1/store/licensesOr name the store: GET /v1/stores/{storeId}/licenses
Parameters
qstring | nullqueryfilter"all" | "active" | "expiring" | "expired" | "not_started" | "revoked" | "suspended"queryproductIdprd_… | nullquerycursorstring | nullquerylimitinteger | stringquerysort"sold" | "product" | "buyer" | "state" | "left" | "devices" | "seen"querydir"asc" | "desc"query
Response LicenseList
itemsLicenseRow[]requiredcountsobjectrequirednextCursorstringrequiredexactKeybooleanrequired
Example
curl "https://api.shopfa.st/v1/store/licenses" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/licenses', {
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/licenses",
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/licenses", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)Try it with your key
One key: devices, history and limits
GET
/v1/store/licenses/{licenseId}Or name the store: GET /v1/stores/{storeId}/licenses/{licenseId}
Parameters
licenseIdkey_…pathrequired
Response LicenseDetail
idLicenseKeyIdrequiredproductIdProductIdrequiredproductNamestringrequiredplanLicensePlanOutrequiredkeyMaskedstringrequiredorderIdOrderId | nullrequiredorderNumberstringrequiredbuyerEmailstringrequiredstateLicenseStaterequiredclockLicenseClockrequired
16 more fields
startedAtTimestamp | nullrequiredexpiresAtTimestamp | nullrequiredactivatedAtTimestamp | nullrequireddevicesUsedintegerrequiredmaxDevicesinteger | nullrequiredvalidationsintegerrequiredlastValidatedAtTimestamp | nullrequiredassignedAtTimestamp | nullrequiredproductPausedbooleanrequiredextraSecondsintegerrequiredrevokedReasonstringrequiredmaxDevicesOverrideinteger | nullrequireddevicesLicenseDevice[]requiredeventsLicenseEvent[]requiredcheckoutSessionIdCheckoutSessionId | nullrequiredbuyerResetsobjectrequiredused30dintegerrequiredper30dintegerrequired
Example
curl "https://api.shopfa.st/v1/store/licenses/key_0123456789abcdefghjk" \
-H "Authorization: Bearer $SHOPFAST_API_KEY"const res = await fetch('https://api.shopfa.st/v1/store/licenses/key_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/licenses/key_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/licenses/key_0123456789abcdefghjk", nil)
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
res, err := http.DefaultClient.Do(req)Try it with your key
Revoke, restore, suspend, resume, add time, start the clock, release or reset devices, or change the device limit
POST
/v1/store/licenses/{licenseId}/actionsOr name the store: POST /v1/stores/{storeId}/licenses/{licenseId}/actions
Parameters
licenseIdkey_…pathrequired
Response LicenseDetail
idLicenseKeyIdrequiredproductIdProductIdrequiredproductNamestringrequiredplanLicensePlanOutrequiredkeyMaskedstringrequiredorderIdOrderId | nullrequiredorderNumberstringrequiredbuyerEmailstringrequiredstateLicenseStaterequiredclockLicenseClockrequired
16 more fields
startedAtTimestamp | nullrequiredexpiresAtTimestamp | nullrequiredactivatedAtTimestamp | nullrequireddevicesUsedintegerrequiredmaxDevicesinteger | nullrequiredvalidationsintegerrequiredlastValidatedAtTimestamp | nullrequiredassignedAtTimestamp | nullrequiredproductPausedbooleanrequiredextraSecondsintegerrequiredrevokedReasonstringrequiredmaxDevicesOverrideinteger | nullrequireddevicesLicenseDevice[]requiredeventsLicenseEvent[]requiredcheckoutSessionIdCheckoutSessionId | nullrequiredbuyerResetsobjectrequiredused30dintegerrequiredper30dintegerrequired
Example
curl -X POST "https://api.shopfa.st/v1/store/licenses/key_0123456789abcdefghjk/actions" \
-H "Authorization: Bearer $SHOPFAST_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"kind": "revoke"
}'const res = await fetch('https://api.shopfa.st/v1/store/licenses/key_0123456789abcdefghjk/actions', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.SHOPFAST_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"kind": "revoke"
}),
});
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/licenses/key_0123456789abcdefghjk/actions",
headers={"Authorization": f"Bearer {os.environ['SHOPFAST_API_KEY']}"},
json={
"kind": "revoke"
},
)
res.raise_for_status()
data = res.json()req, _ := http.NewRequest("POST", "https://api.shopfa.st/v1/store/licenses/key_0123456789abcdefghjk/actions", strings.NewReader(`{
"kind": "revoke"
}`))
req.Header.Set("Authorization", "Bearer "+os.Getenv("SHOPFAST_API_KEY"))
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)