Storeware Docs
REST

App automations

Triggers your app fires into a shop’s automations, and the menu they are built from.

Fire one of your automation triggers

POST /api/v1/app/events

Tells the shop that something your app declares under [[automations.triggers]] happened, so every automation the merchant built on it runs. trigger is the trigger's key in your installed release. data carries its declared fields: a field you did not declare is dropped, a declared field of the wrong type is refused with 400, and the whole may be at most 16 KB. Answered 202, before the automations run. At most 60 a minute and 1000 an hour for each installation; past that, 429 with Retry-After. The event is not sent to any app's webhooks, yours included.

Answers only your app’s own token for the shop, and needs no permission.

Body

FieldTypeRequiredDescription
triggerstringYesThe trigger’s key. Matches ^[a-z][a-z_]{1,31}$.
datamap of string or number or boolean or nullNoThe trigger’s fields, by key. A null or missing field is read as unknown.

Answers 202

FieldTypeDescription
dataobject
data.triggerstringThe trigger as a merchant’s rule names it: app:<slug>:<key>.
data.datamap of string or number or booleanWhat was kept, after undeclared fields were dropped.
curl -X POST "https://api.storeware.ai/api/v1/app/events" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d @body.json

Get what this shop’s automations may be made of

GET /api/v1/stores/{storeId}/automations/vocabulary

The platform’s triggers with the fields each carries, its steps and its exits, and the triggers and actions the shop’s installed apps add, each under the app’s name. An app’s trigger is named app:<slug>:<key>; a rule names it as \{ "kind": "app", "app": "<slug>", "trigger": "<key>" \} and an action as a step of type app_action.

Needs automations:read.

Parameters

ParameterInTypeDescription
storeIdpathstringThe shop.

Answers 200

FieldTypeDescription
dataobject
data.triggersarray of object
data.stepsarray of object
data.steps[].stepstring
data.steps[].doesstring
data.actionsarray of object
data.actions[].appstring
data.actions[].appNamestringThe app’s name, as the merchant sees it.
data.actions[].keystring
data.actions[].labelstring
data.actions[].descriptionstring or null
data.actions[].fieldsarray of object
data.actions[].fields[].keystring
data.actions[].fields[].labelstring
data.actions[].fields[].typestringOne of text, multi_line_text, number, boolean, url, select.
data.actions[].fields[].requiredboolean
data.actions[].fields[].optionsarray of object
data.actions[].fields[].options[].valuestring
data.actions[].fields[].options[].labelstring
data.exitsarray of object
data.exits[].exitstring
data.exits[].meansstring
curl "https://api.storeware.ai/api/v1/stores/$STORE_ID/automations/vocabulary" \
  -H "Authorization: Bearer $TOKEN"

On this page