Declare the keys
Every key is declared in the manifest:- The installation’s version decides. A key your new version adds can be written on an installation only once its merchant accepts that version.
- The type is checked on every write. The visibility comes from the declaration, never from the request.
visibility:appvalues are read by your app only.merchantvalues are meant for the dashboard andstorefrontvalues for the store’s pages; neither is shown there yet, so declare them only for values you would be happy to see shown.- A key a newer version drops keeps its values: still readable
(
declared: false) and deletable, never writable. A key whose type changes keeps its old values; the next write must match the new type.
Owners and scopes
Reading or writing a value needs the scope that reads its owner. Writing a value changes nothing about the owner, so nowrite_* scope is needed.
The owner is read first, as
GET /products/{id} (or the others) would read
it: an owner your token cannot read is 404 NOT_FOUND, a store outside your
installation’s is 460. So an online token never touches a value about
something its person cannot see.
Write, read, delete
- The body is
{ "value": … }and nothing else. A value is nevernull: remove one withDELETE. - A missing value answers 404
NOT_FOUND(itsdetailsays whether the owner or the value is missing). GET /datalists your installation’s values, newest first. Filters:ownerType,ownerId(withownerType),key. Values whose owner you can no longer read are left out, so a page can be shorter thanlimitwhilenextCursoris set: keep reading until it isnull.
Values
- At most 16,384 bytes of compact JSON in UTF-8 (an Arabic letter is two
bytes): 400
APP_DATA_VALUE_TOO_LARGE. - Refused with 400
APP_DATA_VALUE_INVALIDand areason:wrong_type,not_finite,nul_character,lone_surrogate,reserved_key(an object key__proto__,constructororprototype),too_deep(more than 32 levels). - An object’s keys come back in the order Tassyir stores them (shorter keys first), not the order you sent.
- A key the version does not declare for that owner is 400
APP_DATA_KEY_NOT_DECLARED.
Limits
An installation holds at most 50,000 values, whatever their owners. Writing a new key past that is 409APP_DATA_LIMIT_REACHED (limit,
used); rewriting a value that exists is never refused, and DELETE frees a
slot. Values of keys a version dropped count until you delete them.
When values go away
- Values stay when their owner is deleted, until you delete them; they drop out of lists and reads.
- When the merchant uninstalls your app, its values are deleted 48 hours
later, and your app receives
business/redact. A reinstall, even within those 48 hours, is a new installation that starts empty, and an uninstalled installation can no longer read its values: if a value must survive a reinstall, keep your own copy (Compliance and uninstall).