Storeware Docs
REST

App settings

What a merchant set for your app, and pictures your components show.

Get what the merchant set for your app

GET /api/v1/app/settings

Every field your installed release declares in [[settings]], by its key: what the merchant saved, else its default, else null. A secret comes back in the clear, to your app alone. A key an older release declared and yours no longer does is left out. When the merchant saves, you are sent app.settings_updated.v1 with the keys that changed.

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

Answers 200

FieldTypeDescription
dataobject
data.valuesmap of string or number or boolean or null
data.updatedAtstring (date-time) or nullWhen the merchant last saved, or null when they never have.
curl "https://api.storeware.ai/api/v1/app/settings" \
  -H "Authorization: Bearer $TOKEN"

Put a picture on Storeware for your components

POST /api/v1/app/assets

Stores a PNG, JPEG, WebP, GIF or AVIF picture of at most 5 MB, for this shop, and answers with its address on cdn.mystoreware.com, the one host an image in your components may come from. Its bytes are checked, so the type you send must be the type it is; SVG is refused. Sending the same picture again gives the same address.

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

Body

FieldTypeRequiredDescription
datastringYesThe picture’s bytes, as base64. At most 5 MB of picture. 1 to 6,990,508 characters. Matches ^[A-Za-z0-9+/]+={0,2}$.
contentTypestringYesWhat the picture is. It must match the bytes, which are checked. One of image/png, image/jpeg, image/webp, image/gif, image/avif.

Answers 201

FieldTypeDescription
dataobject
data.urlstringWhere the picture is served from. Use it in an image node.
data.contentTypestring
data.sizeBytesinteger
data.sha256stringThe hash of the bytes, which names the file.
curl -X POST "https://api.storeware.ai/api/v1/app/assets" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d @body.json

On this page