Skip to content
Select theme
Light
Dark
Auto
Select language
English
فارسی

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.

  1. 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.

  2. Send a request.

    Every shop answers at its own address. Use the shop’s {handle}.kaladan.store host, or its own domain if it has one:

    POST {shop}.kaladan.store/api/2026-10/graphql
    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 } } } } }"}'

    @inContext(locale: "fa-IR") picks the language translatable content comes back in. Without it you get the shop’s default.

  3. Read the answer.

    {
    "data": {
    "shop": {
    "name": "گلنار",
    "moneyPresentation": { "unit": "TOMAN", "divisor": 10 }
    },
    "products": {
    "nodes": [
    {
    "title": "کوزه‌ی سفالی لالجین",
    "handle": "lalejin-jar",
    "priceRange": { "min": { "amount": "12500000" } }
    }
    ]
    }
    }
    }

    amount is a string in rial. The shop tells you how to show it: divide by divisor and name the unit.

  4. 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.

  • Conventions. Dates, places, errors, null that 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.