TanqoryDocs

App proxy

Serve a page or an API on the store's own address from your server, and check that each request comes from Tanqory.

An app proxy puts a path of the store's own address, such as https://example-store.mytanqory.com/apps/book, in front of your server. A shopper's browser calls the store; Tanqory adds who the store and the shopper are, signs the request, sends it to your server and returns your answer. Your page can call it with fetch from a theme app embed, with no cross-origin setup.

Set it up

In the partner dashboard open your app's Configuration, turn on Use an app proxy and fill in:

FieldValue
Prefixa, apps, community or tools
Subpath1 to 30 letters, digits, _ or -; not admin, services, password or login
Proxy URLyour server's https address, for example https://booking.example.com/proxy

Turning the proxy on adds the write_app_proxy scope to what the app asks for. Then select Save version. A request to /<prefix>/<subpath>/rest/of/path goes to <Proxy URL>/rest/of/path, with the shopper's query string.

What your server receives

Tanqory adds these five query parameters to every request, and drops any parameter of the same name that the shopper sent:

ParameterWhat it contains
shopthe store's address on Tanqory, for example example-store.mytanqory.com
logged_in_customer_idthe signed-in shopper's customer id in this store (the last part of its Admin API id gid://tanqory/Customer/<id>), or empty when nobody is signed in
path_prefix/<prefix>/<subpath>, for example /apps/book
timestampwhen Tanqory sent the request, in Unix seconds
signaturethe hex HMAC-SHA256 of the other parameters, keyed with your client secret

Of the shopper's request headers, only Accept, Accept-Language, Content-Type, User-Agent and X-Forwarded-For are passed on. Cookies are not, and Tanqory adds no headers of its own: no X-Tanqory-Shop-Domain here. The store is the shop parameter. (X-Tanqory-Shop-Domain is a header of webhook deliveries, with the same value as shop.)

Check the signature

Build the message from every parameter except signature: for each name, name=value, with the values of a repeated name joined by ,. Sort these strings and join them with nothing between them. The hex HMAC-SHA256 of that message, keyed with your client secret, must equal signature. Compare in constant time and refuse an old timestamp.

Node.js
import { createHmac, timingSafeEqual } from 'node:crypto';

// query: the URLSearchParams of the request as your server received it.
export function proxyRequestIsFromTanqory(query, clientSecret, maxAgeSeconds = 300) {
  const byName = new Map();
  for (const [k, v] of query) if (k !== 'signature') byName.set(k, [...(byName.get(k) ?? []), v]);
  const message = [...byName].map(([k, vs]) => `${k}=${vs.join(',')}`).sort().join('');
  const expected = Buffer.from(createHmac('sha256', clientSecret).update(message).digest('hex'));
  const given = Buffer.from(query.get('signature') ?? '');
  const fresh = Math.abs(Date.now() / 1000 - Number(query.get('timestamp'))) <= maxAgeSeconds;
  return fresh && given.length === expected.length && timingSafeEqual(given, expected);
}

Answer 401 when the check fails. While a rotated client secret has not been revoked, Tanqory signs with the old one (Secrets).

Your answer

  • Up to 5 MB, within 10 seconds, with at most 5 redirects. Your server must be on a public address.
  • Set-Cookie, Server, X-Powered-By, Date, Pragma, connection headers and your own X-Tq-* headers are removed. Without a Cache-Control of your own the answer gets private, no-store.
  • A Content-Type of application/liquid is refused: send HTML or JSON.

When no installed app owns the path, or the installation does not hold write_app_proxy, the shopper gets 404 with X-Tanqory-App-Proxy: none. When your server cannot be reached or breaks a limit, they get 502 with X-Tanqory-App-Proxy: failed:<why>.

Built from commit c0b3fb3fdef7 · API version 2026-10