Quickstart
In five minutes you will read a shop’s products through the Storefront API and draw a product’s price the way the shop wants it shown. You need a Kaladan shop you can sign in to, or the storefront key of one whose owner gave it to you.
-
Get a storefront key.
In the shop’s admin, open Settings → Storefront API. Under Storefront keys, copy the key.
The key is public by design: it ships inside a theme’s JavaScript and in any page that shows the shop’s products. It reads the catalogue, the content and a cart, and nothing else. If you will call the API from a browser, add your site’s origin to the key’s allowed origins on the same page.
-
Send a request.
Every shop answers at its own address. Use the shop’s
POST {shop}.kaladan.store/api/2026-10/graphql{handle}.kaladan.storehost, or its own domain if it has one:Terminal window curl https://golnar.kaladan.store/api/2026-10/graphql \-H 'Content-Type: application/json' \-H 'X-Kaladan-Storefront-Token: YOUR_STOREFRONT_KEY' \-d '{"query":"query @inContext(locale: \"fa-IR\") { shop { name moneyPresentation { unit divisor } } products(first: 3) { nodes { title handle priceRange { min { amount } } } } }"}'const response = await fetch('https://golnar.kaladan.store/api/2026-10/graphql', {method: 'POST',headers: {'Content-Type': 'application/json','X-Kaladan-Storefront-Token': process.env.KALADAN_STOREFRONT_KEY,},body: JSON.stringify({query: /* GraphQL */ `query FirstProducts @inContext(locale: "fa-IR") {shop { name moneyPresentation { unit divisor } }products(first: 3) {nodes { title handle priceRange { min { amount } } }}}`,}),});const { data, errors } = await response.json();@inContext(locale: "fa-IR")picks the language translatable content comes back in. Without it you get the shop’s default. -
Read the answer.
{"data": {"shop": {"name": "گلنار","moneyPresentation": { "unit": "TOMAN", "divisor": 10 }},"products": {"nodes": [{"title": "کوزهی سفالی لالجین","handle": "lalejin-jar","priceRange": { "min": { "amount": "12500000" } }}]}}}amountis a string in rial. The shop tells you how to show it: divide bydivisorand name theunit. -
Draw the price.
const { divisor } = data.shop.moneyPresentation;const [product] = data.products.nodes;// Rial is whole, so the integer part is the amount.const rial = BigInt(product.priceRange.min.amount.split('.')[0]);const toman = rial / BigInt(divisor);new Intl.NumberFormat('fa-IR').format(toman) + ' تومان';// → "۱٬۲۵۰٬۰۰۰ تومان"Read the amount into an integer or decimal type, never a float, and never hard-code ten: the divisor is in the answer so that you do not have to.
Where to go next
Section titled “Where to go next”- Conventions. Dates, places, errors,
nullthat is not zero, and the payment states that are not failures. Ten minutes that save a week. - Storefront API. What the public key can and cannot do, the cart, and handing a buyer to the hosted checkout.
- Errors and limits. Every response reports what it cost. Read it before you write a page that asks for 250 products.