Skip to main content
Your app often needs to remember something about a merchant’s resource: a product’s review rating, an order’s sync state with another system, a customer’s loyalty points, a setting for the whole business. App data keeps those values in Tassyir, next to the resource, so your app needs no database of its own for them.

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: app values are read by your app only. merchant values are meant for the dashboard and storefront values 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 no write_* 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 never null: remove one with DELETE.
  • A missing value answers 404 NOT_FOUND (its detail says whether the owner or the value is missing).
  • GET /data lists your installation’s values, newest first. Filters: ownerType, ownerId (with ownerType), key. Values whose owner you can no longer read are left out, so a page can be shorter than limit while nextCursor is set: keep reading until it is null.

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_INVALID and a reason: wrong_type, not_finite, nul_character, lone_surrogate, reserved_key (an object key __proto__, constructor or prototype), 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 409 APP_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).