Storefront catalogue

Public products and categories, search, localities for delivery, a gift card’s balance — no key needed.

The storefront half answers with what a visitor to the site sees, and needs no key: there is nothing in it a browser would not get by opening the page. Nothing can be written to it — only GET is routed for its resources. It suits a mobile app, an external site, a customer’s AI assistant.

Mind the X-Storefront and Accept-Language headers (see Basics): they decide the language of names, the currency and the prices.

Products

GET /api/v2/shop/products
GET /api/v2/shop/products/{id | sku | slug}

The list holds only the products the storefront lists. A hidden product does not appear here, though it opens and sells by a direct link (and it can be put in a cart — see Cart).

Filters and sorts:

ParameterWhat it does
qtext search — the same full-text search as the site’s; write it the way a person would: laptop 16gb -gaming, "iphone 15"
categorya category’s slug or id; products linked to it directly (not to its subcategories)
order[price]by price, asc / desc
order[created_at]by newness
order[sales_count]by sales (popular)
page, itemsPerPagethe page, up to 200 rows

Example:

curl -s -g 'https://shop.example/api/v2/shop/products?q=phone&order[price]=asc&itemsPerPage=1' \
     -H 'Accept-Language: en'
{
  "data": [
    {
      "id": 1,
      "url": "https://shop.example/api/v2/shop/products/1",
      "sku": "ST-1001",
      "slug": "phone-alpha-256",
      "name": "Phone Alpha 256GB",
      "short_description": "",
      "description": "A thin and fast phone.",
      "image": "https://shop.example/storage/…/card.webp",
      "currency": "USD",
      "price": "999.00",
      "old_price": null,
      "in_stock": true,
      "characteristics": [
        { "code": "COLOR",   "name": "Color",   "value": "Black",  "value_code": "BLACK" },
        { "code": "STORAGE", "name": "Storage", "value": "256 GB", "value_code": "256-GB" }
      ],
      "features": [
        { "type": "section", "label": "Display", "key": null, "value": null },
        { "type": "feature", "key": "Diagonal", "value": "6.7\"", "label": null }
      ]
    }
  ],
  "meta": { "page": 1, "itemsPerPage": 1, "total": 184, "pages": 184 }
}

Fields:

FieldWhat it is
id, sku, slugthe product’s keys; any of them addresses /shop/products/{key} and puts the product in a cart
urlthis product’s address in the API (not the site’s page)
name, descriptionin the request’s language; description is HTML as the shop writes it
short_descriptionthe line under the name exactly as the page prints it: written by hand or composed by the shop from characteristics; empty when there is neither
imagethe primary photo, already sized for a card; null when there is none
currencywhat the amounts below are in
pricethe price, a decimal string in currency with the places the shop keeps — already through the display filter (a tax added to prices is inside)
old_pricethe struck-through price, when there is one
in_stockorderable right now: a preorder is, a discontinued product is not, whatever the stock number says
characteristicsthe shop’s characteristics — what filters, variations and the brand are made of: code (stable across renames and languages), name, value, value_code (the code of a value picked from the list; null for a value typed for this product alone)
featuresthe product’s own rows — nothing filters by them; a flat list in the shop’s order: headings type: "section" with label, and rows type: "feature" with key and value

Categories

GET /api/v2/shop/categories
GET /api/v2/shop/categories?parent_id=1
GET /api/v2/shop/categories/{id | slug}

Active categories only — as the storefront’s menu draws them. parent_id — the children of one category; an empty value (?parent_id=) — the top level. Sort with order[sort] (the shop’s own order).

{ "data": [
    { "id": 1, "url": "https://shop.example/api/v2/shop/categories/smartphones",
      "slug": "smartphones", "name": "Smartphones", "parent_id": null }
  ],
  "meta": { "page": 1, "itemsPerPage": 30, "total": 42, "pages": 2 } }

To build the tree, fetch every category (itemsPerPage=200, page by page) and put it together by parent_id. A category’s products are /shop/products?category={slug}.

Localities (for delivery)

The shop prices delivery by a locality in its own registry, not by a town’s name. Its id (place_id) comes from the suggestion endpoint — the same one the “Town” field of the site’s cart uses:

GET /places/suggest?q=Kyiv
GET /places/suggest?q=Ivanivka&country=UA&page=2
{
  "more": true,
  "items": [
    { "id": 14008, "name": "Kyiv", "context": "Kyiv", "country": "UA", "label": "Kyiv" },
    { "id": 15874, "name": "Kyinka", "context": "Chernihiv Raion · Chernihiv Oblast",
      "country": "UA", "label": "Kyinka (Chernihiv Raion)" }
  ]
}
  • At least 2 characters; fewer — an empty list.
  • Only the localities the shop serves are offered.
  • context is the district and the region: it tells namesakes apart. When there are several, show the person label and context and let them choose rather than taking the first.
  • more: true — there is a next page (page=2).
  • The address has no /api/v2 prefix: it is an ordinary storefront address, and its language comes from the path prefix (/ru/places/suggest, /uk/places/suggest).

Send the id you get to the checkout as place_id.

A gift card’s balance

GET /api/v2/shop/giftcards/{code}
{ "data": { "last4": "7KQ2", "state": "active", "balance": "500.00",
            "currency": "UAH", "expires_at": "2027-06-30T23:59:59+03:00" } }

The code may be written in any form (with dashes, spaces, any case). 404 — there is no card with this code. Wrong codes count together with the site’s box: after 10 wrong tries from one address in 15 minutes — 429, even for a right code. A card is applied to a cart in the checkout: PATCH …/checkout with {"code": "…"}.