Skip to content
Priolekha.Get early access

Priolekha API

Starter and Growth stores can read their Shopify catalog, INR price observations and eligible prior-price disclosures through a server-side API.

Create a token

In Shopify admin, open Priolekha and choose API access. Create a token as the store owner and save it as a private environment variable such as PRIOLEKHA_TOKEN. Every request uses the Authorization: Bearer header.

Read your catalog and evidence

  • GET /api/v1/catalog?limit=50 lists variants. Pass the returned nextCursor as after to continue. The maximum page size is 100.
  • GET /api/v1/variants/123/observations?page=1 returns up to 50 observations per page. Use your numeric Shopify variant ID or the UUID returned by the catalog API. Pass nextPage to continue.
  • GET /api/v1/variants/123/disclosure returns the currently eligible prior price when you supply the live buyer context.

Hydrogen integration

Call Priolekha from a route loader or your storefront server. Use Shopify’s India buyer context to get the selected variant’s availability, live public price and currency first. Check that your headless storefront actually offers the same public, tax-inclusive item price as the tracked India Online Store, including at checkout. A different storefront offer needs its own evidence.

// Inside a Hydrogen server loader after reading the selected variant.
const id = variant.id.split("/").at(-1);
const match = /^(\d{1,10})(?:\.(\d{1,2}))?$/.exec(variant.price.amount);
if (!id || !match || countryCode !== "IN") return { priorPrice: null };

const priceMinor = BigInt(match[1]) * 100n + BigInt((match[2] ?? "").padEnd(2, "0"));
const query = new URLSearchParams({
  country: countryCode,
  currency: variant.price.currencyCode,
  priceMinor: priceMinor.toString(),
  available: String(variant.availableForSale),
});
const response = await fetch(
  `https://priolekha.com/api/v1/variants/${id}/disclosure?${query}`,
  { headers: { Authorization: `Bearer ${context.env.PRIOLEKHA_TOKEN}` } },
);
const result = response.ok ? await response.json() : null;
return { priorPrice: result?.status === "ready" ? result : null };

Format the returned minor-unit amount as INR. Keep the 30-day meaning visible and show the result only alongside the matching live variant. Use the returned expiry and avoid shared caching. Hide the disclosure on unavailable responses, price or variant mismatch, expired data and API failure.

Limits and errors

Starter has 60 requests per minute and 6,000 per UTC day. Growth has 240 per minute and 24,000 per UTC day. All tokens share the store limit. When the API returns 429, honor Retry-After. A 401 means the token is missing, expired or revoked. A 403 means the store no longer has paid API access.