Yasan Connector API (0.4.0)

Download OpenAPI specification:Download

The Yasan Connector API is a small, read-only API that your store implements and hosts, and that Yasan calls. It is the generic way to connect a custom e-commerce system to Yasan: implement the endpoints below, and Yasan's AI search, chatbot and support agent can find your products and answer "where is my order" questions for your customers.

Two things to keep in mind before you start:

  1. Yasan is the client. You host the API, we call it. You never push data to Yasan.
  2. You implement only what you support. GET /info and GET /products are the minimum. Categories, incremental changes and order lookup are optional and declared in GET /info.

The widgets on your storefront can also read the visitor's cart and add products to it. That is a small JavaScript object on your pages rather than an endpoint of this API: see the Storefront JavaScript API.

Revision 0.4.0 is compatible with 0.1.0, 0.2.0 and 0.3.0. If you built any of them, no endpoint, field or parameter has to change. Yasan now applies limits and safety rules to the data, so check the short list in What changed since 0.1.0 against your data.

A realistic effort for one developer: about two weeks for the catalog and order lookup, about one more for the changes feed. Build them in this order: info, products, orders, categories, and the changes feed last. A small catalog works well without it.

How it works

  • When a merchant connects your store in the Yasan dashboard, Yasan calls GET /info to check the API key and to learn your storefronts, their languages and currencies, and which optional parts you implement.
  • Catalog synchronization runs in the background. Yasan downloads GET /products as one long stream of lines and indexes it. If you implement GET /products/changes, Yasan also picks up changes every few hours.
  • Order lookup is live. When a customer asks about an order, Yasan calls GET /orders or GET /orders/{orderNumber} and relays status, tracking and delivery information. When one of the merchant's operators takes over the conversation, Yasan gives the operator a summary of the same order next to it.

Two words are used throughout:

  • A product line is one product on one storefront in one language. A product sold on two storefronts, one of them in two languages, is three product lines.
  • A line of a stream is one line of text with one JSON object.

Base URL and authentication

The merchant enters two things in Yasan: a base URL and an API key.

Base URL

The base URL is yours to choose, for example https://www.example.cz/yasan-api. Yasan appends the paths below to it and does not look inside it.

If you built 0.1.0, your endpoints live under /whisper/v1, and they stay there. One thing changed for the merchant. In 0.1.0 the base URL was the root of your server and /whisper/v1 was added to it. Now the merchant enters the full base URL, including /whisper/v1: for example https://www.example.cz/whisper/v1.

  • It must be https with a publicly trusted certificate (TLS 1.2 or newer), on a public host name. Any port works.
  • No credentials, no query string and no fragment. A trailing slash is ignored.
  • Yasan does not follow redirects, so enter the final address, for example with www if your site redirects to it. Every endpoint must answer directly under the base URL. A 3xx response is treated as a failure, so the API key is never forwarded to another host.
  • To move the API to another address later, the merchant edits the connection and enters the new base URL together with a new key. Yasan never sends an existing key to a new address.

API key

The API key is a random secret. The Yasan connect dialog generates one for you to install on your server: 43 characters from A-Z a-z 0-9 - _. You may also paste a key your own system issued: 32 to 256 printable ASCII characters, without spaces. Yasan sends the key on every request:

Authorization: Bearer <key>
  • Reject a missing or wrong key with 401 on every endpoint.
  • We recommend comparing keys in constant time. You only need to store a hash of the key, because you never send it anywhere.
  • The key shown in the connect dialog cannot be displayed again. Store it when it is generated.
  • Rotation. The merchant saves a new key in Yasan. Yasan starts using it only after GET /info succeeds with it. We recommend accepting the old and the new key side by side for a day, so that no synchronization fails in between. A server that holds a single key works too: install the new key, then save it in Yasan right away.
  • You should remove the key from your server when the shop is disconnected from Yasan. If you suspect a key has leaked, replace it at once: Yasan cannot revoke a key on your server.

What Yasan sends

Header Value
Authorization Bearer <key>
User-Agent Starts with Yasan-Connector/. It identifies our requests in your logs. It does not authenticate them: anyone can send this header.
Yasan-Request-Id A unique id for the request. We recommend logging it. Yasan stores the id of a failed request in the synchronization report, so you can find the request in your own log.
Accept-Encoding gzip. Compressing responses is recommended.

Ignore every request header you do not know that starts with Yasan-. Never reject a request because of one. Yasan-Signature is reserved for optional request signing in a later revision.

Yasan sends only the query parameters described here. A later revision will send a new parameter only to a store that declares, with a capability flag, that it understands it. Still, the safe choice is to ignore a query parameter you do not know.

Firewalls and bot protection

If your site is behind a web application firewall or bot protection (Cloudflare and similar), our requests can be blocked before they reach your code. Yasan then sees an HTML page instead of JSON. Yasan does not call from fixed addresses in this revision. You should exempt the base URL path from challenges; the API key remains the authentication. If your firewall can only allow by address, contact us.

Capabilities

The capabilities object in GET /info says which optional parts you implement. Every flag is optional. A missing flag counts as false. A flag Yasan does not know is ignored.

Capability What you implement Without it
productChanges GET /products/changes Yasan runs a full export every night.
categories GET /categories, and categoryIds on products Yasan builds a category tree from categoryPath.
orders GET /orders and GET /orders/{orderNumber} No order answers.
ordersByNumber GET /orders/{orderNumber} also answers without customerEmail Yasan always sends customerEmail.
productDetail Nothing. The flag from 0.1.0 is accepted and ignored. No difference.

GET /info and GET /products are always required: every connection synchronizes a catalog. A connection with a catalog and no order lookup is valid.

Storefronts, languages and currencies

Storefronts

A storefront is one shop presence with its own URL. GET /info lists your storefronts. Every product line and every order names its storefront in storefrontId.

  • One storefront is a valid list. Most stores declare exactly one.

  • A merchant with several shops (for example a .cz and a .sk site) can do either of these, and both are fully supported:

    • declare all shops as storefronts of one connection, or
    • expose each shop through its own connection (its own base URL), each with one storefront.

    Choose what is easier for you to build.

  • Never both. A shop must not be exposed through two connections of the same Yasan account. Its catalog would be imported twice.

  • storefronts[].id must never change. Yasan recognises a storefront by its id. A new id is a new shop to Yasan, with an empty catalog and default settings. If you are choosing ids now, do not derive them from something that can be edited, such as the domain or the shop's name. An id you already use stays as it is.

  • A storefront added later is picked up at the next synchronization: Yasan notices it in GET /info and runs a full export right away; after three failed attempts, at night.

  • A storefront that disappears from GET /info is not deleted in Yasan.

    • Lines that still name it are skipped and reported. They change nothing and remove nothing: Yasan keeps what it has for them.
    • Its product lines go away when a complete full export really stops containing them. That is a removal like any other, so the same safeguard applies: if it is more than 50 product lines of one storefront and language, the export is held until the merchant confirms it. See Full export.
    • Its settings in Yasan stay.
  • Yasan keeps the catalog of each storefront apart. A visitor of one storefront is only shown that storefront's products.

Languages

A storefront serves one or more languages. GET /info lists them in languages.

  • Language is part of a product line's identity. Title, description, URL, attributes and availability text depend on the language, so a product is exported once per storefront and language. The identity of a product line is the triple (storefrontId, language, id). Fields that do not depend on the language (codes, prices, availability) are simply repeated on each line.
  • Language codes are lowercase ISO 639-1 codes such as cs, sk, en, de. A region may follow after a hyphen (pt-BR). Watch for country codes used by mistake: Czech is cs (not cz), Ukrainian is uk (not ua), Slovenian is sl (not si).
  • Yasan imports only these languages: bg cs de en es fr hr hu it nl pl ro sk sl uk vi. A code with a region counts by its language part (en-GB is imported as English).
    • Lines in another declared language are not imported. That is not an error and it holds nothing up. The rest of the connection keeps working.
    • A storefront without a supported language is left out. A store with no supported language at all cannot be connected yet.
    • If defaultLanguage is not a supported entry of languages, the first supported one is used.
  • Codes must stay stable. Changing cs to cs-CZ reads as removing one language and adding another.
  • A language added later is picked up at the next synchronization, like a new storefront: Yasan runs a full export right away. A language removed from GET /info is treated like a removed storefront: lines that still name it are skipped and Yasan keeps what it has for them, and its product lines go away when a complete full export really stops containing them, with the same safeguard.
  • A product may be missing in a secondary language. Leave that line out. If a line stops existing later while the product stays live, the next full export removes it. To remove it sooner, send a delete followed by upserts of the remaining languages in the changes feed (see Incremental changes).

Currencies

  • Currency is a property of a price, not of a product line. Each variant carries a prices list with one entry per currency. A single-currency shop writes one-entry lists.
  • Yasan shows and quotes the price in the storefront's defaultCurrency, in every language. Entries in the other declared currencies are accepted and not shown in this revision. So every variant needs a price in the default currency.
  • An order was placed in one currency. Every amount in it carries that currency.

Catalog synchronization

Stream format

Both product endpoints return JSONL (application/x-ndjson): one JSON object per line, no surrounding array, no commas between lines. You write it line by line and Yasan reads it line by line, so a catalog of several hundred thousand products needs no pagination and little memory on either side.

Each line is an event with a type:

{"type":"upsert","product":{ … }}
{"type":"delete","productId":"1877","storefrontId":"acme-cz","deletedAt":"2026-07-09T11:03:00Z"}
{"type":"end","count":2}
  • upsert: the full current state of one product line. Used by both endpoints. Objects are replaced, not merged: a field you leave out is cleared.
  • delete: the product no longer exists (or is no longer visible) on that storefront, in any language. Only in the changes feed. In the full export, absence is the signal.
  • end: the mandatory last line. count is the number of event lines you wrote before it.

The rules of the format:

  • Encoding. UTF-8. Lines are separated by \n (\r\n is accepted). A JSON object must not contain a raw line break, so do not pretty-print.
  • Blank lines are ignored and not counted.
  • A line may be at most 1 MiB (1,048,576 bytes, uncompressed). A longer line is skipped. Test connection reports the longest line and the longest id it saw.
  • Unknown things are ignored. A line with a type Yasan does not know is ignored, and so is a field it does not know. A later revision can add both without breaking you, and you may add fields of your own.
  • A broken line never fails the stream. A line that is not valid JSON, or a product line Yasan cannot use, is skipped and reported (see Imperfect data). The rest of the stream is read as usual. When Yasan can still read which product line the skipped line was about (its storefrontId, language and id), it keeps what it has for it. A line whose identity cannot be read protects nothing.
  • The end line and its count. Count the lines as you write them; nothing has to be computed in advance. Count a line only after you have written it. Yasan counts every non-blank line it reads before end, including the lines it had to skip, and compares the two numbers. When they differ, the count_mismatch report shows both numbers. Yasan stops reading at the end line.
  • No end line, or a different count, means the stream is incomplete. Yasan then deletes nothing. This protects you from a connection that drops in the middle: without the end line, a catalog cut in half would look like a complete, smaller catalog, and the missing half would be deleted. What happens to the lines that did arrive depends on how the response ended:
    • The transfer broke: the connection was reset, no bytes came for 60 seconds, or the transfer passed 5 hours or its size limit. Yasan discards what arrived, changes nothing and tries again later. (A changes response over its size limit sets the feed aside instead.)
    • The response arrived whole, but its end line is missing or its count is wrong. The lines in it are imported and nothing is removed. Gzip data that is cut short inside a response that otherwise ended normally is read up to the break and counts as a missing end line.
  • If something fails on your side in the middle, you cannot change the HTTP status any more. Just stop without writing the end line. Either way nothing is removed.

Transport:

  • Content-Encoding: gzip is supported and recommended. It usually shrinks the stream about ten times.
  • Start writing early and keep writing. Yasan aborts a stream when no bytes arrive for 60 seconds, and after 5 hours in total. A large catalog that takes tens of minutes is fine as long as data keeps flowing. An aborted transfer changes nothing: what arrived is discarded.
  • Yasan reads the response as fast as you send it, and stores it before processing it. So Yasan's processing never slows your stream down, and it does not count towards the 5 hours.
  • A whole response has a size limit, measured compressed: 1.5 GiB for a full export (several million product lines, depending on your data) and 64 MiB for a changes response (roughly 200,000). A response you send without gzip is compressed by Yasan before it is measured. A full export over the limit fails and changes nothing. A changes response over the limit sets the feed aside; see Incremental changes. A catalog of several million product lines can also be split: expose each storefront through its own connection (see Storefronts).
  • Really stream. Iterate a database cursor and write one line at a time. Never load the whole catalog into memory and never build one big array. Watch for buffering you did not ask for: an ORM that loads all rows, PHP output buffering, a reverse proxy such as nginx with proxy_buffering on. Serverless platforms with a cap on response size or time (for example Lambda behind API Gateway) cannot serve these endpoints.
  • Check the timeouts on your side. A long response can be cut off by your own stack. Worth checking: nginx send_timeout and fastcgi_read_timeout, MySQL net_write_timeout, PHP max_execution_time and php-fpm request_terminate_timeout.
  • A pre-generated file is fine, and recommended for very large catalogs. Generate the export into a temporary file, write the end line, rename the file into place, and serve it from GET /products. Yasan then always gets a complete file, quickly.
    • Regenerate it at least once a day.
    • Serve it with Content-Type: application/x-ndjson and, if it is stored gzipped, with Content-Encoding: gzip. If you let nginx compress it instead, add application/x-ndjson to gzip_types: it is not there by default.
    • Keep the file out of public directories: the route that serves it must check the API key.
    • A file is always a little older than your shop. With a changes feed that is safe for a file up to a day old: Yasan polls the feed right after every full export, and a full export does not remove a product line the feed delivered in the 24 hours before it. See Incremental changes.

PHP. A live export from PHP and MySQL behind nginx needs all of this:

while (ob_get_level() > 0) { ob_end_flush(); }
set_time_limit(0);
header('Content-Type: application/x-ndjson');
header('X-Accel-Buffering: no');           // or "fastcgi_buffering off" in nginx

// An unbuffered query on its own connection: rows arrive one by one.
$pdo->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, false);

$count = 0;
foreach ($pdo->query($sql) as $row) {
    echo json_encode(['type' => 'upsert', 'product' => toProduct($row)], JSON_THROW_ON_ERROR), "\n";
    $count++;                               // only after the line is written
    if ($count % 500 === 0) { flush(); }    // after each batch
}
echo json_encode(['type' => 'end', 'count' => $count]), "\n";

Use JSON_THROW_ON_ERROR or JSON_INVALID_UTF8_SUBSTITUTE. Without one of them, a json_encode that fails (one broken character is enough) returns false and echo prints an empty line. Yasan does not count empty lines, your counter does, and the stream never completes.

Full export

GET /products is the complete visible catalog: every product line of every storefront and language, in one stream. Lines may come in any order; storefronts and languages may be mixed.

When Yasan downloads it. The regular schedule runs at night, between 00:00 and 05:00 Prague time:

  • once a day, if you do not implement the changes feed;
  • about once a week, as a reconciliation, if you do. (0.1.0 said "roughly monthly".) The endpoint is the recovery path for anything the changes feed missed, so it must keep working;
  • once more about two days after the store is connected;
  • every night for as long as your changes feed is failing or set aside (see Incremental changes).

Some exports come at any hour:

  • right after the store is connected;
  • when a storefront or a language is added in GET /info;
  • when the merchant presses Synchronize now, changes the base URL, or confirms a held export (see the safeguards below);
  • when a scheduled export is more than two days overdue and has not failed since.

After a failed export Yasan tries again with growing pauses, from a few minutes up to several hours. So a failing export can be requested several times in one night. The first attempts for a new connection, storefront or language, and the attempts after a confirmed hold, also come during the day.

Absence means deleted. When Yasan has read a complete export (the end line arrived and its count matched), it removes every product line that the export did not contain. This is how deletions are detected in a full export.

  • delete lines do not belong here. Yasan ignores them and reports them.
  • If the same (storefrontId, language, id) appears twice, the last line wins.
  • A line Yasan has to skip is not absence. When its identity (storefrontId, language, id) can be read, Yasan keeps what it has for that product line and reports the line. A mistake in one field does not delete a product. The same holds for a line Yasan cannot store.
  • A line that names a storefront or a language that GET /info does not declare is skipped and reported, and Yasan keeps what it has for that product line. So the catalog of a storefront or a language that dropped out of GET /info stays until the export stops containing its lines.
  • A line protects nothing when its identity cannot be read: it is not valid JSON, it is longer than 1 MiB, or its id, storefrontId or language is missing or unusable (an id longer than 255 characters is unusable). If the export has no other line for that product line, the product line is absent.
  • With a changes feed, one exception to absence. A product line the changes feed delivered in the 24 hours before the export started (or since the previous full export, if that is more recent) is not removed by this export. A pre-generated file may be up to a day old and cannot contain a product created after it was written. If such a line is really gone, the next full export removes it, or your delete line does.
  • If you declare productChanges, send updatedAt on every line here too. The first since comes from the first complete full export.

Safeguards keep a bug from wiping a catalog:

  • An export that fails, is interrupted, or has no matching end line deletes nothing.

  • A complete export without a single usable product line deletes nothing.

  • A complete export is held in two cases:

    • the product lines it would remove are more than 30% and more than 50, of the whole catalog, or of one storefront and language;
    • more than 10% of all its lines had no readable identity: Yasan could not tell which product line they were about.

    In a held export, new and changed lines are applied and nothing is removed. The dashboard shows the hold with its numbers for each storefront and language.

  • A hold ends in one of two ways. A later export that stays under the thresholds is applied normally, so a fixed bug needs no confirmation. Or the merchant confirms the hold in the dashboard. Yasan then runs the export again and removes what is missing.

  • A confirmation covers what the merchant saw, for 24 hours. The export that follows may remove a little more than the hold showed: up to a quarter more, counted for each storefront and language. If it would remove more than that from one of them, it is held again with the new numbers.

  • Only lines without a readable identity count towards the 10%: a line that is not valid JSON or not a JSON object, a line longer than 1 MiB, a line that names no type and no product, a line whose id, storefrontId or language is missing or unusable. These are the lines that cannot protect a product. A line that is skipped although its identity could be read (no title, a bad url, an undeclared storefront or language) is reported and never counts. Neither do lines in a language Yasan does not import, delete lines, and lines with a type Yasan does not know. The 10% is taken of all non-blank lines before end.

Incremental changes

If you declare the productChanges capability, Yasan keeps the catalog fresh between full exports by polling GET /products/changes?since=<timestamp> every few hours. The response has the same format as the full export, plus delete lines.

If you declare productChanges, send updatedAt on every line of both endpoints. The first since comes from the first complete full export; without timestamps there the changes feed is never called.

The contract is loose on purpose, so that it is easy to build. You need no event log. The simplest correct implementation is two queries:

-- 1. Product lines that changed.
SELECT … FROM product WHERE updated_at > :since;

-- 2. A small table of deleted products.
SELECT product_id, storefront_id, deleted_at FROM deleted_product WHERE deleted_at > :since;

For each row of the first query, write an upsert line. For each row of the second query, write a delete line.

A product that is no longer visible on a storefront is sent as a delete line, like a deleted one. The first query selects visible products only, and a product that was hidden or unpublished gets a row in the table of deleted products. It is removed in all languages of that storefront.

How Yasan chooses since:

  • since always comes from your own timestamps. Yasan remembers the newest updatedAt or deletedAt it has received from you and derives since from that. The only use of Yasan's own clock in a synchronization is that a timestamp from the future is counted as the present (see below). That can only move since back, so a clock difference between the two systems cannot lose a change. This is why deletedAt is required on a delete line, and why updatedAt matters on every product line.
  • Between polls, the next since is the newest timestamp received, minus the time the previous response took, minus 15 minutes. A row that was still being written while the previous response ran is caught this way. since never moves back between polls: a response with only older timestamps, or with none, leaves it where it was.
  • After every complete full export, held or not, the next since is the newest timestamp found in that export, minus 24 hours, and Yasan polls the changes feed right after the export.
  • After a full export that arrived whole but without a matching end line, its lines have been imported, so Yasan polls the feed right after it as well. since is moved back to the newest timestamp of that export minus 24 hours, unless it was already earlier.
  • This makes a pre-generated or cached export safe. Such an export is older than your shop, so it puts some product lines back to an older state. Whatever changed after the file was generated is sent again by the poll that follows, because that poll asks from a full day before the newest timestamp in the file.
  • So overlap is normal. You will be asked for events you have already sent, and after a full export for a day or more of them. Send them again. Applying a line twice changes nothing. Do not try to remove the overlap.
  • Yasan always sends since in UTC and in whole seconds, in exactly this form: 2026-07-09T02:00:00Z. Parse it as a point in time; do not compare it as text.
  • A timestamp ahead of Yasan's clock is read as "now" when Yasan computes since: the moment the changes request was sent, or for a full export the moment the export started. The line itself is applied as usual. So one wrong date in the year 2099 cannot stop the feed, and a store whose clock runs ahead is asked for a little more, never for less. A timestamp more than one day ahead is also reported (future_timestamp).
  • Product lines without updatedAt are applied, but they cannot move since. If your last complete export carried no usable timestamp, Yasan does not poll the changes feed and runs the full export every night instead.

updatedAt must move whenever anything in the exported line changes. This is the most common mistake. The line contains data from many tables: price, stock, availability, category, attributes, images, translations. An updated_at column that only moves when the product row itself is edited misses a price change in the price table and a stock change in the warehouse table. Touch the product's timestamp from every place that writes something the line contains.

  • Changes without a write count too. A publication date that passes, or a price list that becomes valid at midnight, changes the line although no row was written. Touch the affected products when the date passes. Sale prices are the exception: send from and to, and Yasan applies the window itself.
  • Long transactions. A write transaction longer than 15 minutes that stamps updated_at at statement time can lose changes until the weekly full export: when it commits, its rows are already older than since. Set updated_at at commit, or subtract your own allowance from since in the query. Sending more is safe.
  • Summer time. Local time without an offset repeats one hour every autumn. Store timestamps in UTC, or convert them with the right offset.
  • Sending too much is safe, up to the size of one response. A line that did not really change costs a little time and nothing else. When in doubt, include it. The bound is the response as a whole: 64 MiB compressed, roughly 200,000 product lines. Beyond it the feed is set aside (see below).
  • A job that touches every product (a nightly import that rewrites updated_at everywhere) makes the next poll return the whole catalog. For a small catalog that works, and it is slower than no feed. For a catalog over the size limit the feed is set aside every time, and the shop is in effect synchronized by nightly full exports. Move updated_at only when the line really changed.
  • Lines need no particular order. If the same product line appears twice in one response, the last one wins. Across responses the later one wins. One case has a rule of its own: a delete next to an upsert of the same product. See below.

Removing things:

  • {"type":"delete", …} removes a product from one storefront in all its languages. Send it when the product no longer exists there, or is no longer visible there. A product removed everywhere needs one delete line per storefront. There is no other removal line.
  • One language of a product that stays live has no removal line of its own. The next full export removes it. To remove it sooner, send a delete followed by upserts of the remaining language lines; see below.
  • A delete for something Yasan does not have is ignored. It counts towards no safeguard.
  • A delete line without a readable deletedAt is still applied, and reported. It cannot move since.
  • Keep deletions for at least 30 days. Older rows of the table of deleted products may be removed.
  • Yasan applies the removals of one response together, at its end. If they would remove a large part of what Yasan has (more than 20% and more than 200 product lines, of the whole catalog, or of one storefront and language), none is applied and the feed is set aside; see below.
  • A response that arrives whole but without a matching end line removes nothing. Its upsert lines are applied, and Yasan asks again later with the same since. A response whose transfer breaks changes nothing at all.

A delete and an upsert for the same product in one response. A delete removes every language line of that product on that storefront. An upsert of the same product in the same response can keep its own language line. The rule is applied to each language line on its own:

  • An upsert written after the delete always stays. No timestamp is compared. This is the 0.1.0 sequence, "a delete followed by upserts of the remaining language lines", and it works as 0.1.0 described.
  • An upsert written before the delete stays as well, unless its updatedAt is earlier than the delete's deletedAt. When either timestamp is missing or unreadable, it stays.

So a delete removes a language line in two cases only: the response has no upsert for that line, or its upsert comes before the delete and is older than it. The details:

  • Of several lines for the same product line, the last one is used.
  • Of several delete lines for the same product, the last one is the one an upsert has to come after, and the newest readable deletedAt is the one compared.
  • A line Yasan had to skip, but whose identity it could read, counts as an upsert without a timestamp: it protects its product line.
  • A timestamp up to one day ahead of Yasan's clock is read as "now" here as well. A deletedAt or an updatedAt further ahead is treated as unreadable here, so the upsert stays.

How to drop one language. Product 1042 has a Czech and an English line on acme-cz, and the English one is dropped:

{"type":"delete","productId":"1042","storefrontId":"acme-cz","deletedAt":"2026-07-09T11:03:00Z"}
{"type":"upsert","product":{"id":"1042","storefrontId":"acme-cz","language":"cs", … ,"updatedAt":"2026-07-02T08:30:00Z"}}
{"type":"end","count":2}

Result: the Czech line is kept and the English line is removed. The Czech line was last changed a week before the deletion. That does not matter, because its upsert comes after the delete.

A feed that writes its upsert lines first and its delete lines after them, as the two queries above do, falls under the second rule: a line whose updatedAt is earlier than deletedAt is removed with the rest. For a deleted product that is the right result. To drop one language in such a feed, write the delete before the upserts of the remaining languages.

When the feed is set aside. In these cases Yasan stops polling the changes feed and runs the full export every night instead:

  • the removals of one response would remove a large part of the catalog (the 20% rule above);
  • one response carries more than 100,000 delete lines;
  • a response is too large: over 64 MiB compressed (roughly 200,000 product lines), or more than Yasan can process in about an hour;
  • you answer 400 or 410 to the request;
  • you stop declaring productChanges in GET /info.

In the first three cases no removal of that response is applied. Nothing is lost: the nightly full export carries the whole catalog, with its own safeguards. Polling starts again after the next complete full export, with a since taken from that export, as long as you still declare productChanges. One exception: when the response that was too large is the poll that follows an incomplete full export, Yasan goes back to the since it had before that export and keeps polling.

A feed that simply keeps failing (a timeout, a 5xx) is not set aside. Yasan keeps trying it with growing pauses, and after about half a day without a successful poll the full export runs every night until the feed works again.

Several storefronts or languages. The simplest correct feed writes, for every product that changed, one upsert line for each storefront and language where the product is offered. A product taken off one storefront gets a delete line for that storefront. A product deleted everywhere gets one delete line per storefront. You need not remember what you sent before: a delete for something Yasan does not have is ignored and counts towards no safeguard.

Whatever the feed misses is corrected by the weekly full export: a product whose updatedAt did not move, a deletion without a delete line. Until then a deleted product stays findable with a dead link, so the delete lines are worth the small table. (Such a deletion takes one export longer when the feed delivered that line in the day before the export; see Full export.)

Categories

Categories let AI search group results into shelves ("Trekking shoes", "Running shoes") and narrow a search to one department.

With the categories capability, Yasan reads your category tree from GET /categories, once for every declared storefront and imported language, before every full export and every changes poll. Products refer to categories by id in categoryIds.

  • Send url and position: a shelf links to your category page and shelves keep the order of your menu.
  • Top-level categories should be real departments. The assistant narrows a search to top-level categories first.
  • Mark campaign and collection categories (Sale, New, Brands) and internal ones with "visible": false, or they become shelves.
  • "visible": false hides the category and everything below it from shelves and filters. So do not mark a technical root category this way: leave it out of the list, and its children become top-level.
  • Products listed in a hidden category stay searchable. To hide a product, leave it out of the export.
  • A category id on a product that is not in the tree is ignored on its own; the product is kept.
  • With the capability, categoryPath is not used. You may keep sending it.

Without the capability, Yasan builds a tree from the categoryPath values of your products, the same way it does for product feeds. That works, with limits:

  • A category is recognised by its names. Renaming one makes a new category.
  • There are no links to category pages, no menu order and no way to hide a campaign category.
  • A product is in one category only.

How fresh is the data?

Prices and availability shown in search results and product cards, and what the assistant says about them, come from the last synchronization: normally at most a few hours old with a correct changes feed, up to a day without it. Yasan does not look up single products live in this revision.

Products and variants

A product carries the shared content: title, description, URL, image, brand, categories, attributes. A variant is what a customer actually buys and carries codes, prices and availability. Every product has at least one variant. A product without real variants has exactly one, and may reuse the product id as its id. A sold-out product whose variants are all deactivated still needs one variant, with availability: out_of_stock.

SKUs are not modelled as their own objects. Each variant carries a list of typed codes (SKU, EAN, GTIN, MPN). They are search keys: customers quote them from invoices and packaging. The same code may appear on several variants (multipacks, bundles). The identity of a variant is its id, never a code.

What a product line needs:

Level Required What happens without the rest
Product id, storefrontId, language, title, url, at least one variant Without one of these the line is skipped. updatedAt is not required, but if you declare productChanges, send it on every line of both endpoints: without it the changes feed is never called.
Variant id Without a price in the storefront's default currency the variant can be found, but it is shown without a price. A price of 0 is read as no price. Without availability it counts as unknown and ranks with backorder.

Visibility

Export only what a visitor can see: no drafts, no archived or hidden products. Yasan does not filter them for you.

  • The full export contains only visible, published product lines. A product line that is missing from a complete export is removed.
  • In the changes feed, a product that no longer exists or is no longer visible on a storefront is sent as a delete line. It removes that product on that storefront, in every language. There is no other removal line. See Incremental changes.

Prices

"prices": [
  { "amount": 129800, "currency": "CZK" },
  { "amount": 5290, "currency": "EUR" }
],
"salePrices": [
  { "amount": 116800, "currency": "CZK",
    "from": "2026-07-01T00:00:00+02:00", "to": "2026-07-31T23:59:59+02:00" }
]
  • amount is an integer in the currency's minor units: haléře, cents. 129800 with CZK is 1 298,00 Kč. The number of decimal places follows ISO 4217: two for CZK and EUR, none for JPY.

  • prices holds the regular price, one entry per currency. salePrices holds the discounted price, at most one entry per currency. Send it while there is a discount, or ahead of one with from. If your system stores a current price and a price before discount:

    if priceBefore > currentPrice:  prices = priceBefore,  salePrices = currentPrice
    otherwise:                      prices = currentPrice  (no salePrices)
    
  • If the same currency appears twice in prices or in salePrices, the last entry wins.

  • All prices are final consumer prices including VAT, as shown on the product page to a visitor who is not signed in. vatRate is a percentage (21 means 21 %). It lets the assistant answer "what is the price without VAT"; it does not change how prices are expressed.

  • While a sale price applies, Yasan shows the regular price struck through next to it. Send as the regular price a price you may lawfully show as the price before the discount.

  • from and to are optional. Yasan applies the window itself, so a sale that starts on Friday needs no extra synchronization on Friday.

  • A sale price is used only when it is safe to use: it must be greater than zero and lower than the regular price in the same currency, and from and to must be readable if present. Otherwise the sale price is dropped and the regular price applies. A malformed date never puts a product on sale early.

  • A price of 0 is read as no price. The variant is shown without a price.

PHP and floats. Do not write (int) ($price * 100). Floating point makes 19.99 * 100 equal to 1998.9999999999998, and the cast cuts it to 1998. Write (int) round($price * 100). And never send the price in crowns: 1298.0 is read as 1298 haléřů, which is 12,98 Kč.

Availability

availability is one of in_stock, out_of_stock, preorder, backorder. Put the exact wording a customer sees into availabilityText. If you have your own availability types, map each to the nearest value and pass its label through in availabilityText.

Your state availability
Skladem in_stock
Skladem u dodavatele, na objednávku, dodání do 5 dnů backorder
Předobjednávka, připravujeme preorder
Vyprodáno, prodej ukončen out_of_stock

In-stock products rank ahead of the others when they are otherwise equally relevant. stockQuantity is the number of units a customer can buy, as of the last synchronization. It never overrides availability.

Attributes and filters

Attributes are name and value pairs, in the language of the product line:

"attributes": [
  { "name": "Materiál", "value": "Kůže" },
  { "name": "Určení", "value": "Turistika" },
  { "name": "Určení", "value": "Trekking" },
  { "name": "Údržba", "value": "Impregnovat po každém čištění", "filterable": false }
]
  • Every attribute is searchable and available to the assistant. Put the most important ones first: the assistant sees about the first twelve.
  • Several values: repeat the attribute. Write one entry per value, with the same name. There is no list of values. Never put several values into one string: "kůže, textil" is one value to Yasan.
  • Where attributes go. What all variants share goes into the product's attributes. What tells variants apart (size, colour) goes into each variant's attributes. This is what 0.1.0 advised, and it has not changed.
  • Filters. Yasan builds filter candidates from the product's attributes and from the attribute values of all its variants together. So size and colour that you send only on variants become filters with no change on your side. Yasan also uses filters to ask clarifying questions ("Which material?"), and it treats the parameters of a product feed the same way. Good filters have a handful of values that are spelled the same on every product. You need to do nothing to get filters.
  • Yasan decides which attributes are offered as filters. Rarely used ones may be left out. "filterable": false is the way to keep one out for certain.
  • "filterable": false opts an attribute out, on a product or on a variant. Use it for free text, care instructions and anything else that must never become a filter, and send it wherever you send that attribute. true and a missing flag mean the same.
  • A filter is recognised by the attribute's name. Yasan derives it from name: lower case, without diacritics ("Materiál" becomes material).
    • Attributes whose names produce the same result share one filter.
    • The result differs between languages, and it changes when you rename the attribute. A changed name is a new filter.
  • The brand is not an attribute. Send the brand in the product's brand field. An attribute named Brand stays searchable and is not a filter.
  • Limits for filters, each counted per product with its variants: 64 filterable attributes, 50 values of one attribute, and a value of at most 100 characters. Beyond a limit nothing is lost: the attribute is still searchable, it is just not a filter on that product.
  • We recommend returning attributes, codes and variants in the same order every time. Yasan compares each product line with its previous version, and a different order counts as a change.

What makes a product rank well

Among equally relevant products, Yasan prefers the ones that are in stock and that have an image, a brand, a category and codes. Customers also search by the codes printed on invoices and packaging, so send every code you have (SKU, EAN, MPN).

Orders

Order lookup is live: Yasan calls you while a customer or an operator is waiting. Yasan waits at most 10 seconds.

Request Return Needs
GET /orders?customerEmail=… That customer's most recent orders, newest first, at most 20. An unknown address is an empty list, not 404. orders
GET /orders/{orderNumber}?customerEmail=… The order with that number, only if it belongs to that address. Otherwise 404. orders
GET /orders/{orderNumber} The order with that number. 404 if there is none. orders and ordersByNumber
  • 404 unless the e-mail matches. A wrong e-mail and an unknown order number must look exactly the same, so that nobody can find out which order numbers exist.
  • Match the e-mail against the contact address stored on the order, ignoring letter case, and return that same address in customerEmail. Treat an empty customerEmail as missing and answer 400.
  • orderNumber is the number your customers see and quote in e-mails. It must be unique across all storefronts of the connection. If two of your storefronts can issue the same order number, give each storefront its own connection. Or match the number and the address together, and do not declare ordersByNumber.
  • Match the whole order number. Never match by prefix or substring. We recommend ignoring letter case and spaces around it. In MySQL, compare order numbers as strings: against a numeric column, '12345-2' matches order 12345.
  • Both values arrive percent-encoded. An order number with a slash (2024/0123) arrives as 2024%2F0123, and an address with a plus sign ([email protected]) as jana%2Bshop%40example.com. Decode once. Test both cases: Apache refuses %2F in a path unless AllowEncodedSlashes is set, and a + decoded twice becomes a space. On nginx, route on the raw path ($request_uri) and decode the order number afterwards: $uri is already decoded, and the slash would split the path.
  • What Yasan checks in the answer. An order whose orderNumber differs from the one Yasan asked for is discarded; the two are compared after trimming, ignoring letter case. E-mail addresses are compared ignoring letter case. status and paymentStatus are trimmed and lower-cased before they are read.

Who is asking

In automated answers (the chat, automated e-mail replies) Yasan sends only an address it has verified: in the chat the customer entered a one-time code sent to that address, by e-mail the message came from an authenticated sender.

When one of the merchant's operators handles the conversation, Yasan may also look up an address that is not verified. The assistant takes the address from the conversation. Usually it is the one the customer wrote from, but it need not be: it can be any address that appears in the conversation, for example one the customer names as the address the order was placed with. The result goes to that operator only, next to the conversation, and a reply still needs the operator's approval. (0.1.0 said that Yasan calls only with verified addresses. For automated answers that still holds. For operators it changed.)

In both cases Yasan does not use an order whose customerEmail is missing or different from the address it asked for.

Lookup by order number alone is a separate capability, ordersByNumber. When you declare it, customerEmail may be missing on GET /orders/{orderNumber}. Yasan leaves it out in two situations only:

  • while an operator is handling the conversation, for example when a customer writes from another address than the one on the order. The operator sees the order and decides what to tell the customer;
  • once in every Test connection, with a random order number, which must answer 404.

Without ordersByNumber Yasan always sends customerEmail. When customerEmail is present, the 404 rule applies as always.

What to return

Only orderNumber is required. Yasan never drops an order because another field is missing or wrong. Send what your customers ask about and what the merchant's operators need to see. Each field makes certain answers possible:

Fields What they are used for
orderNumber Identifies the order. Required.
customerEmail Says whose order it is. Without it the order is never used in an automated answer.
status, statusText "Where is my order?" The assistant quotes statusText. status drives Yasan's own logic; if none of its values fits, leave it out.
createdAt, paidAt, dispatchedAt, deliveredAt "When did I order?", "When was it sent?"
estimatedDeliveryFrom, estimatedDeliveryTo "When will it arrive?"
shippingMethod, pickupPoint "How are you sending it?", "Where do I pick it up?" These are known before the order is dispatched, when there is no shipment yet.
shipments The carrier and the tracking link.
statusUrl A page where the customer can follow the order.
items "What did I order?", and which product a question is about. productId and variantId link the line to the catalog.
totalPrice, totalVat, shippingPrice, discounts Amounts, discount codes, invoice questions.
paymentMethod, paymentStatus, paymentUrl, paymentInstructions "Did my payment arrive?", "How do I pay?" The assistant never makes payment details up; it can only pass on what is here.
deliveryAddress "Where are you sending it?", requests to change the address.
billingAddress Invoice corrections and company details (IČO, DIČ). Passed on to the operator.
customerNote What the customer wrote with the order ("call before delivery"). Passed on to the operator; the assistant takes it into account.
invoiceUrl A link to the invoice the assistant can pass on.
internal Only for the merchant's operators: a link to the order in your back office and the internal note.

The operator's view. When one of the merchant's operators handles a conversation, Yasan gives the operator a summary of the order next to it. The assistant writes that summary from the order you return, and is instructed to include the delivery method and pickup point, both addresses, the customer's note, the payment state and the link to the order in your back office. So send billingAddress and customerNote when you have them, even if customers rarely ask about them.

What may reach the customer. Everything outside internal may be quoted to the customer, so every URL outside internal should be one the customer can open. We recommend writing free-text fields in the language the customer ordered in.

The internal block is for the merchant's operators: the assistant uses it when it prepares a draft for them. One exception: the merchant can switch on in Yasan that the assistant may use internal.note when answering customers. Do not put secrets there.

How Yasan uses order data. An order you return is processed by the AI model that writes the answer, may be quoted in that answer, is shown to the merchant's operators, and stays in the conversation history of the merchant's Yasan account. Yasan does not build a copy of your order database.

Protecting order lookup

The API key grants lookup of orders, so treat it like a password to them.

  • We recommend rate-limiting the order endpoints per key and answering 429 when the limit is hit. Yasan sends only a few lookups at a time per connection.
  • The e-mail address and the order number are part of the URL. You should keep the query strings of these endpoints out of your access logs, or keep those logs short.
  • Links such as invoiceUrl, paymentUrl and statusUrl are passed on in conversations and kept in their history. They should not be guessable: use a long random token, an expiring link, or a page that requires signing in.
  • Answer 400 to GET /orders without customerEmail. Never treat it as "all orders". Answer 400 to GET /orders/{orderNumber} without customerEmail too, unless you declared ordersByNumber.
  • If your system hosts several merchants, each key belongs to exactly one of them. Another merchant's order is 404. See Securing your API.

Conventions

  • JSON, UTF-8. Content-Type: application/json, and application/x-ndjson for the two product streams.
  • Unknown fields are ignored. You may send extra fields. We recommend giving your own fields a prefix (for example x_), so that a later revision cannot use the same name with another meaning.
  • Identifiers (id, storefrontId, orderNumber, category ids) are strings that you own. The id of a storefront, a product or a variant and an order number may have at most 255 characters, a category id at most 200. Yasan never interprets them; they only have to be stable. A product id must not change when the product is renamed, must not be reused for another product, and is the same for one product in every language. Send them as JSON strings: "1042", not 1042. Any characters are allowed, except that the character U+0000 is removed.
  • Timestamps are ISO 8601 with a T and an explicit offset: 2026-07-09T12:00:00Z or 2026-07-09T14:00:00+02:00. In PHP that is DATE_ATOM. A database format such as 2026-07-09 14:00:00 has no offset and is not accepted. Store timestamps in UTC, or convert local time with the right offset: the offset changes twice a year with summer time.
  • Money is { "amount", "currency" }: an integer in minor units and an uppercase ISO 4217 code. All prices include VAT.
  • URLs are absolute. Only http:// and https:// URLs are used; any other URL is dropped. An image that is not https is not shown. Yasan's widgets load images directly from your server and send no Referer header, so images should load without one.
  • Text is plain text. Simple HTML in description is accepted and converted to text. A blank string is read as absent.
  • Errors use one shape on every non-2xx response: {"error": {"code": "…", "message": "…"}}. The HTTP status is what Yasan acts on; the body is for diagnostics. You should not put customer data into message.
  • Every endpoint is a GET and changes nothing on your side. Yasan never writes to your system.

Imperfect data

Many different systems implement this API, so Yasan is deliberately tolerant. A mistake in one field does not fail a synchronization. There are four outcomes:

Problem What Yasan does
An optional field has the wrong type or an invalid value Drops that field, keeps the product line or the order. A bad entry in a list (one attribute, one price, one code, one variant) is dropped on its own.
A line of a stream is unusable: not valid JSON, longer than 1 MiB, a product line without id, storefrontId, language, title, a valid url or a valid variant, a line for a storefront or a language that GET /info does not declare, a line Yasan cannot store, or a delete line without productId or storefrontId Skips that line, reports it and reads on. A skipped line never removes a product by itself. When its identity (storefrontId, language, id) can be read, Yasan keeps what it has for that product line, in the full export and in the changes feed alike.
A response arrives whole, but its end line is missing or its count is wrong The lines in it are imported and nothing is removed. Yasan tries again later.
A response cannot be used at all: wrong key, a status other than 200, a timeout, a transfer that breaks or passes its size limit Nothing changes. Yasan discards what arrived and tries again later. (A changes response over its size limit sets the feed aside instead.)

Only two things remove a product line: real absence from a complete full export, and a delete line. A line whose identity cannot be read cannot protect anything: it is not valid JSON, it is longer than 1 MiB, or its id, storefrontId or language is missing or unusable (an id longer than 255 characters is unusable). If the export has no other line for that product line, the product line is absent. The 10% hold in the full export is there for the case that this happens to many lines at once, and only such lines count towards it.

In the changes feed, a skipped line whose identity can be read also protects its product line from a delete in the same response: it counts as an upsert without a timestamp.

Some slips are corrected instead:

  • null in an optional field is read as absent. (Two nulls have a meaning: parentId: null is a top-level category, and visible: null hides a category.)
  • A blank string is read as absent. (One exception: an empty visible hides a category.)
  • A number where a string is expected is converted: an id of 1042 is read as "1042". Numbers above 9007199254740991 cannot be read reliably and the line is skipped.
  • An integer sent as a numeric string is accepted: "129800" for an amount, "7" for a stock quantity.
  • Booleans accept true, false, 1, 0, "1", "0", "true" and "false".
  • Text is trimmed. The character U+0000 is removed, from ids too. A currency code is upper-cased (czk is read as CZK).
  • Fields with a fixed set of values are trimmed and lower-cased before they are read: availability, a code's type, an order's status and paymentStatus. So In_Stock is read as in_stock.
  • A timestamp offset without a colon is accepted: +0200 is read as +02:00.
  • Structure is never repaired. An object or a single value where a list belongs is a fault like any other wrong type: an optional field is dropped, and a product line whose variants is not a list is skipped. In PHP, json_encode turns an array with gaps in its keys, or one keyed by ids, into a JSON object ({"0": …, "2": …}). Call array_values() before encoding.
  • A code with an unknown or missing type is read as other.
  • The same currency twice in prices or in salePrices, or the same variant id twice in a product: the last entry wins, and the repeat is reported as duplicate.
  • A value over its limit: text is cut and a list is capped, both reported as over_limit. A number outside its range is dropped and reported as bad_format. A code value longer than 100 characters is dropped.
  • GET /info with something missing. Only storefronts, and in each storefront id, url, languages and currencies, are needed to read the answer. Send the other fields too. When one is missing, Yasan falls back and reports it: a missing shop name becomes the host name of the base URL; a missing storefront title becomes the shop name, or the host name of the storefront's url when that is missing too; a missing defaultLanguage becomes the first language of the list that Yasan imports; a missing defaultCurrency becomes the first currency of the list; missing capabilities mean none, so the connection is catalog only.

Some things are read strictly, because guessing would do harm:

  • Amounts are never guessed. An amount that is not a whole number (1298.5, "1298.00", "1 298") could be crowns or haléře, so that price entry is dropped and reported.
  • A sale price is used only if it is lower than the regular price in the same currency and its from and to can be read. Otherwise it is dropped.
  • visible hides a category unless it is clearly true.
  • Storefront and language of a product line must be ones that GET /info declares, or the line is skipped. What Yasan already has for that product line is kept.
  • URLs are used only when they start with http:// or https://.

Orders follow the same idea with one difference, because a dropped order would look like "no such order". An order is kept when only orderNumber can be read; an unknown status or an unreadable createdAt drops just that field. Two checks are strict: an order whose orderNumber differs from the one Yasan asked for is discarded, and an order whose customerEmail is missing or different from the address Yasan asked for is not used. If the response cannot be read at all, the assistant says the order could not be looked up, not that it does not exist.

Issue codes

Every dropped field and skipped line is counted and recorded with a code and the place it occurred, for example bad_format at variants[].prices[].amount. The merchant sees the report when testing the connection and, after each synchronization, on the connection's page in the dashboard.

Code Meaning
missing A required value is absent.
wrong_type The value has the wrong JSON type and could not be converted.
bad_format The value does not have the required form (a URL, an integer amount, a timestamp), or a number is outside its range.
not_allowed The value is not one of the allowed values.
too_long / too_short The value is over or under its length limit and could not be used (an id, a URL, a code).
unsafe_number A number too large to be read reliably.
converted A harmless slip was corrected (counted, not listed per product).
no_price The variant has no usable price in the storefront's default currency, or the price is 0.
sale_price_dropped A sale price was not lower than the regular price, or its window could not be read.
unknown_category A product names a category id that is not in the tree.
unknown_storefront A line names a storefront that GET /info does not declare. Skipped; what Yasan has for it is kept.
unknown_language A line names a language that its storefront does not declare. Skipped; what Yasan has for it is kept.
unsupported_language A declared language Yasan does not import. Its lines are not imported.
duplicate Something appears twice where it may appear once: a product line in one response, a variant id in one product, a currency in one price list. The last one was used.
over_limit More than a limit allows: a list was capped or a text was cut. The rest was ignored.
invalid_json A line of a stream is not valid JSON.
line_too_long A line of a stream is longer than 1 MiB.
unknown_event A line has a type Yasan does not know, or a delete line appeared in the full export. Ignored.
missing_end The stream ended without the end line.
count_mismatch The count of the end line differs from the number of lines read. The report shows both numbers.
future_timestamp An updatedAt or deletedAt more than one day ahead of Yasan's clock. Like every timestamp from the future, it is read as "now" when since is computed. When a delete is compared with an upsert, it is treated as unreadable.
too_many_issues The item had so many problems that it was skipped.
unreadable The item could not be read at all.
storage_rejected The item contains data Yasan could not store. The line is skipped, and what Yasan has for that product line is kept.

Tolerance is a courtesy, not the contract: the schemas below are what a correct implementation returns. (They leave out null; a validator generated from them rejects nulls that Yasan accepts. Omitting the key is the clean way.)

Limits and numbers

Every limit says what happens beyond it. Sizes are measured after decompression, except the size of a whole product stream, which is measured compressed.

What Limit Beyond it
One line of a product stream 1 MiB The line is skipped. This limit comes first: a product with many variants and attributes can reach it before the per-product limits below.
A product stream, in time 5 hours in total, 60 seconds without bytes The transfer is aborted. What arrived is discarded, nothing changes, and Yasan tries again later.
A full export, as a whole 1.5 GiB compressed: several million product lines, depending on your data The export fails. What arrived is discarded and nothing changes. A catalog near this size can be split into one connection per storefront.
A changes response, as a whole 64 MiB compressed: roughly 200,000 product lines, depending on your data The response is discarded and the changes feed is set aside: full exports run every night until one is complete, then polling starts again. A response Yasan cannot process in about an hour sets the feed aside in the same way; the lines read by then stay applied.
delete lines in one changes response 100,000 No removal of that response is applied, and the changes feed is set aside in the same way.
Response body of GET /info 1 MB The request fails.
Response body of GET /categories 16 MB uncompressed The tree is not updated; the previous one is kept.
Response body of the order endpoints 8 MB uncompressed The lookup fails. The assistant says the order could not be looked up.
Storefronts in one connection 50 The rest are ignored.
Languages of one storefront 20 The rest are ignored.
id of a storefront, product or variant 255 characters The storefront, product line or variant is skipped. A product line skipped for its id protects nothing in a full export.
id of a category 200 characters The category is skipped. On a product, such an id counts as a category that is not in the tree.
orderNumber 255 characters The order is not used.
title of a product or a variant, brand, availabilityText, attribute name or value, category name 500 characters Cut.
An order's statusText, paymentMethod, shippingMethod and pickupPoint, each part of an address 500 characters Cut.
Shop name, storefront title 100 characters Cut.
An order's customerNote, paymentInstructions and internal.note 2,000 characters Cut.
shortDescription 5,000 characters Cut.
description 40,000 characters Cut.
Keywords per product 50 The rest are ignored.
One keyword 100 characters Cut.
Labels per product, after trimming and removing empty, repeated and too long ones 5 The rest are ignored.
One label 40 characters The label is dropped.
URL 2,048 characters The field is dropped. A product line whose url is dropped is skipped, because url is required.
Category position 0 to 1,000,000 The field is dropped.
Variants per product 250 The rest are ignored.
Attributes per variant, its own and the product's together 100 The rest are ignored.
Codes per variant 50 The rest are ignored.
value of a code 100 characters That code is dropped.
categoryIds per product 50 The rest are ignored.
Levels in categoryPath 20 The deeper levels are ignored.
Filterable attributes per product, its variants included 64 The rest are not used as filters on that product. They stay searchable.
Values of one filterable attribute per product, its variants included 50 The rest are not used as filters on that product. They stay searchable.
Value of a filterable attribute 100 characters Not used as a filter. It stays searchable.
Categories of one storefront and language 50,000 The tree is not updated; the previous one is kept.
Orders in one list 20 The rest are ignored.
Items in one order 200 The rest are ignored.
What Yasan does Current value
GET /info On connect, on every change of the connection, before every synchronization, and at least once a day. Timeout 10 seconds.
Product streams Read as fast as you send them. Aborted after 60 seconds without bytes, or after 5 hours in total.
GET /categories Timeout 60 seconds for the whole response.
Changes poll Every 4 hours, and right after every full export. Not while the feed is set aside.
Full export, regular At night, 00:00 to 05:00 Prague time: nightly without the changes feed, weekly with it, and nightly while the feed is failing or set aside. Once more about two days after connecting.
Full export, at any hour Right after connecting; when a storefront or a language is added; after Synchronize now, a change of the base URL or a confirmed hold; when a scheduled export is more than two days overdue and has not failed since.
since between polls The newest updatedAt or deletedAt received, minus the time the previous response took, minus 15 minutes. It never moves back between polls.
since after a full export The newest timestamp found in that export, minus 24 hours.
A timestamp ahead of Yasan's clock Read as "now" when since is computed. When a delete is compared with an upsert, one up to a day ahead is read as "now" and one further ahead is treated as unreadable, so the upsert stays. Reported when it is more than one day ahead.
Order lookup Timeout 10 seconds, a few at a time per connection, not retried.
Catalog requests One at a time per connection.
A failed catalog request Retried up to 3 times with growing pauses. A stream is always read again from its start. Then the synchronization ends as failed.
A failed synchronization Tried again with growing pauses, from a few minutes up to several hours. A full export is retried mostly inside the night window.
Retry-After Honoured as sent. When it asks for more than 5 minutes, the synchronization ends and no synchronization of the connection starts before that time: the wait applies to every request, not only to the one that received it. On GET /categories a long wait only skips the category update: the stored tree is kept and the catalog goes on.
Requests without a key One to GET /info at every Test connection and at every save of the connection. At every Test connection also one to GET /orders, when orders is declared.
Test connection At most 2 MB read per response. 20 seconds for the first product line. With ordersByNumber, one request for a random order number without customerEmail.

Answer 429 or 503 (optionally with Retry-After, in seconds or as an HTTP date) whenever you need to slow Yasan down. Any 5xx is treated like 503. These values may change; the rules above them will not without a new revision.

Securing your API

  • Serve the API over HTTPS only.
  • You should authenticate these routes by the bearer key only, and ignore cookies and sessions.
  • If your system hosts several merchants, each key belongs to exactly one of them, and every endpoint is restricted to that merchant: its storefronts, its catalog and its orders.
  • We recommend sending no CORS headers: no browser ever calls this API.
  • We recommend Cache-Control: no-store, so that a cache in front of your site never serves a response to a request without the key. This matters most for a pre-generated export file.
  • If you ban addresses after failed logins, keep the threshold above a few requests without a key per hour. Every Test connection sends one such request to GET /info and, when you declare orders, one to GET /orders. Every save of the connection sends one more to GET /info. So a merchant who tests and then saves causes up to three. Yasan never sends a wrong key on purpose. Slowing down repeated requests with a wrong key is fine.
  • Never treat an order request without customerEmail as "all orders". See Protecting order lookup.
  • You should keep customer data out of error messages and, as far as you can, out of access logs.

Testing your implementation

In the Yasan dashboard, Test connection calls your API the way a synchronization would and shows a report. It checks:

  • GET /info with the key, and once without a key. The request without a key must answer 401;
  • if you declare orders, one request without a key to GET /orders, which must answer 401 too. The test sends no other request without a key, and never a wrong key;
  • the category tree of each storefront's default language, if declared;
  • the beginning of GET /products. The test reads only the beginning of the stream and then disconnects, so your server should cope with a client that disconnects early. If the whole export fits into the test, the end line and its count are checked too. The report shows the longest line and the longest id the test saw;
  • one request to the changes feed, with a recent since;
  • that GET /orders with a random e-mail address returns an empty list and that a random order number returns 404, and, if you enter a real order number and its e-mail, that order. If you declare ordersByNumber, the random order number is also requested once without customerEmail and must return 404 as well.

Saving the connection runs the first check again: GET /info with the key and once without a key. So every save sends one request without a key too.

The test reads at most 2 MB per response and has a time budget of its own. For the products step the budget is 20 seconds for the first product line. If no product line arrives within that time, the step is reported as "not checked". That does not block saving: the first synchronization then decides. Any other step the test has no time for is reported as not checked too, not as failed. The report lists every issue with its code, the place it occurred and a sample product id.

Saving is blocked only by these:

  • the key is refused, or GET /info does not describe a usable storefront;
  • an endpoint answers without a key;
  • the products step failed: the endpoint answered with an error, or what it sent contained no usable product line. Running out of time is not a failure.

Everything else in the report is a warning.

You can check the stream yourself before that:

curl -sS --compressed -H "Authorization: Bearer $KEY" \
  https://www.example.cz/yasan-api/products | tail -n 1

must print the end line, and its count must equal the number of lines before it.

Yasan can only reach public https addresses, not localhost. To test a development build, expose it through a public tunnel or a staging host and create a separate connection for it.

Versioning

  • 0.4.0 is compatible with 0.3.0, 0.2.0 and 0.1.0. 0.3.0 only adds the optional keywords on a product, and 0.4.0 the optional labels. A server that implements 0.1.0 correctly is a correct 0.4.0 server: every response still validates, and no endpoint, field or parameter has to change. What Yasan does with the data has changed in places; see What changed since 0.1.0.
  • specVersion in GET /info says which revision you implemented. It is a diagnostic aid. Yasan never switches behaviour on it; optional parts are switched by capabilities.
  • A new revision only adds things: optional fields, optional endpoints behind a new capability flag, optional request parameters that Yasan sends only to a store that declares it understands them. It may also relax a requirement. Your implementation keeps working without changes.
  • This API is still a draft. If a breaking change ever becomes unavoidable, a connected shop is never cut off silently: we contact the merchant before it takes effect.

Implementation checklist

  1. Serve GET /info over HTTPS with the bearer key; declare your storefronts, their languages and currencies, and what you implement.
  2. Serve GET /products as a JSONL stream with the end line: visible products only, one line per storefront and language.
  3. Optional: GET /orders and GET /orders/{orderNumber} with the e-mail rule.
  4. Optional: GET /categories, and categoryIds on products.
  5. Optional: GET /products/changes, with updatedAt on every line of both product endpoints, an updatedAt that really moves, and a table of deleted products.
  6. Return the JSON error shape with the right status everywhere, including 401 without a key.
  7. In the Yasan dashboard: enter the base URL, install the key, press Test connection and read the report.

What changed since 0.1.0

Nothing to rebuild

Every response that was valid in 0.1.0 still validates, and no endpoint, field or parameter you built has to change. A server that implements 0.1.0 correctly is a correct 0.2.0 server.

Yasan now applies limits and safety rules to the data, so check the short list against your data. Some of what Yasan does has changed as well; that is listed under Changed in what Yasan does.

New and optional

You may add any of these. None of them is needed.

  • Categories. The categories capability, GET /categories, and categoryIds and primaryCategoryId on products. categoryPath stays valid.
  • Attributes can carry "filterable": false. A property with several values is sent by repeating the attribute.
  • shortDescription on a product.
  • keywords on a product, added in 0.3.0.
  • labels on a product, added in 0.4.0.
  • Orders: the ordersByNumber capability; the fields shippingMethod, pickupPoint, statusUrl, estimatedDeliveryFrom, estimatedDeliveryTo, paymentUrl, paymentInstructions and internal; productId on an order item; the statuses awaiting_payment and ready_for_pickup. A 0.1.0 server never sends these two statuses and need not start.
  • Language codes may carry a region (pt-BR).
  • Statuses 429 and 503 are documented on every endpoint, with the error codes unavailable and internal_error. Retry-After may also be an HTTP date.

Relaxed

  • Fewer fields are required. A product line needs id, storefrontId, language, title, url and one variant. A variant needs id. An order needs orderNumber. An order item needs name, a discount description, a code value; a shipment needs nothing.
  • updatedAt is no longer required on every product line. A store that declares productChanges still sends it, on every line of both endpoints.
  • Every capability flag is optional and counts as false when missing.
  • GET /info is read with fallbacks. Only storefronts is required, and a storefront needs id, url, languages and currencies. A 0.1.0 server sends the other fields and should keep sending them. If one is missing, Yasan falls back and reports it; see Imperfect data.
  • A variant no longer needs a price in every declared currency. The storefront's default currency is the one that matters.
  • An order's customerEmail is no longer checked against an e-mail pattern, so an address with national characters is not rejected. The customerEmail query parameter is no longer declared with an e-mail format either.

Changed in what Yasan does

None of this asks you to change your server. It changes which requests arrive, or what happens to the data you send. Where 0.1.0 said something else, that is noted.

Requests you will see:

  • The full export runs weekly when you have a changes feed. 0.1.0 said "roughly monthly", so the endpoint is called about four times as often.
  • More full exports than the schedule. 0.1.0 named the first export, the nightly one and the monthly one. Yasan also runs:
    • a second export about two days after the store is connected;
    • an export every night while your changes feed is failing or set aside;
    • an export at any hour when a storefront or a language is added, when the merchant presses Synchronize now, changes the base URL or confirms a held export, and when a scheduled export is more than two days overdue and has not failed since.
  • A failed synchronization is tried again with growing pauses, from a few minutes up to several hours. A failing full export can therefore be requested several times in one night, and for a new connection, storefront or language also during the day. 0.1.0 said "exponential backoff".
  • since is chosen differently. 0.1.0 said: the newest timestamp received, minus a small safety window. Now:
    • between polls it is the newest timestamp received, minus the time the previous response took, minus 15 minutes, and it never moves back;
    • after every complete full export it is the newest timestamp found in that export, minus 24 hours, with a poll right after the export. So expect a day or more of overlap after each full export;
    • after a full export that arrived whole but without a matching end line, since is moved back the same way if it was later, and a poll follows too;
    • a timestamp ahead of Yasan's clock is read as "now". 0.1.0 said Yasan never compares your timestamps with its own clock; this is the one comparison, and it can only move since back;
    • since is always UTC in whole seconds.
  • The changes feed can be set aside. Yasan stops polling it and runs the full export every night, until one is complete, in these cases: you answer 400 or 410 to the request; one response is over 64 MiB compressed, carries more than 100,000 delete lines, or is more than Yasan can process in about an hour; its removals would trip the safeguard against mass deletion; you stop declaring productChanges. 0.1.0 documented the 400 and did not say what follows it.
  • GET /info is read before every synchronization, and at least once a day, with a timeout of 10 seconds. 0.1.0 said "periodically".
  • Headers. Every request carries User-Agent: Yasan-Connector/…, Yasan-Request-Id and Accept-Encoding: gzip. Besides Authorization, 0.1.0 mentioned only a header reserved for request signing, which is now Yasan-Signature.
  • Retries inside one synchronization. A failed catalog request is retried up to 3 times. Retry-After is honoured as sent. A wait of more than 5 minutes ends the synchronization, and no other starts before that time. Any 5xx is treated like 503. Order lookups are not retried.
  • Requests without a key. Every Test connection sends one to GET /info and, when you declare orders, one to GET /orders. Every save of the connection sends one to GET /info. Yasan never sends a wrong key on purpose.
  • Test connection reads only the beginning of GET /products and then disconnects. It also sends one request to the changes feed with a since of about an hour ago, taken from Yasan's clock, and applies nothing from it; and it asks GET /orders for a random address and GET /orders/{orderNumber} for a random number with that address. The random address belongs to nobody. It and an address the merchant enters for the test are the only unverified ones outside operator lookups.
  • The base URL. The merchant now enters the full base URL, including /whisper/v1. In 0.1.0 the merchant entered the root and the prefix was added. The base URL must be https with a publicly trusted certificate on a public host name; any port works. Yasan does not follow redirects, so the merchant enters the final address. 0.1.0 also said that from 1.0 on the major version would match the path prefix. This revision prescribes no prefix and announces no later version.
  • Order lookups for an operator may use an address that is not verified. The assistant takes it from the conversation, and it need not be the address the customer wrote from. The result goes to the operator only, and a reply needs the operator's approval. 0.1.0 said that Yasan calls only with verified addresses; that still holds for automated answers. Every request still carries customerEmail, unless you declare ordersByNumber. See Who is asking.
  • Yasan stopped calling GET /products/{id}. It answers from the synchronized catalog and does not look up single products live. If you built the endpoint, you may leave it in place or remove it; nothing calls it. The productDetail capability is still accepted and has no effect.

What happens to your catalog data:

  • Limits. 0.1.0 had none. They include the size of a whole response: 1.5 GiB compressed for a full export, 64 MiB compressed for a changes response. See Limits and numbers.
  • A transfer that breaks changes nothing. 0.1.0 said that upserts from an incomplete stream may already have been applied. Yasan now stores a response before it processes it. If the transfer breaks (a reset connection, 60 seconds without bytes, the 5-hour cap, the size limit), nothing of it is imported. If the response arrives whole and only its end line is missing or its count is wrong, its lines are imported and nothing is removed.
  • Only the supported languages are imported. Lines in another declared language are not imported, and a store with no supported language cannot be connected yet.
  • A price of 0 is read as no price.
  • Prices in non-default currencies are accepted but not shown. Yasan shows the price in the storefront's defaultCurrency.
  • A sale price is used only when it is lower than the regular price. While it applies, the regular price is shown struck through next to it.
  • Filters are built automatically, from the attributes of a product and of its variants. Size and colour on variants become filters with no change.
  • Imperfect data is repaired or skipped and reported, not refused. A skipped line whose identity can be read never removes a product: Yasan keeps what it has for it. See Imperfect data.
  • Safeguards against mass deletion. A complete full export is held when it would remove more than 30% and more than 50 product lines, and a changes response when it would remove more than 20% and more than 200, in both cases of the whole catalog or of one storefront and language. A full export in which more than 10% of the lines have no readable identity is held too. A held export removes nothing until the merchant confirms it or a later export stays under the thresholds. Held changes set the feed aside.
  • A full export does not remove what the changes feed has just delivered. A product line the feed delivered in the 24 hours before the export is kept even when the export does not contain it. A deletion that only the full export can detect may therefore take one export longer.
  • A delete next to an upsert of the same product in one response. The 0.1.0 sequence, a delete followed by upserts of the remaining language lines, works as 0.1.0 described: an upsert written after the delete always stays. New is the other order, which 0.1.0 left open with "events need no particular order": an upsert written before the delete stays too, unless its updatedAt is earlier than the deletedAt.
  • The rules of the stream are fixed where 0.1.0 left them open: encoding, blank lines, unknown lines and fields, what count counts, duplicates, lines for an undeclared storefront or language, timestamps in the future.
  • Storefronts: how ids, added and removed storefronts and several connections are handled. A storefront or a language that drops out of GET /info keeps its catalog until a complete export stops containing its lines. Yasan also reads the storefront's url to learn about the shop.

What happens to your order data:

  • Operators see order data too, next to the conversation, and it stays in the conversation history. billingAddress and customerNote existed in 0.1.0 and are passed on to the operator; nothing to change.
  • An order is used only when it matches the request: its orderNumber is the one Yasan asked for, and its customerEmail is the address Yasan asked for.

The API is now named after Yasan. Nothing in the contract depends on the name.

New recommendations

This is advice that 0.1.0 did not give. Yasan does not enforce any of it, and a 0.1.0 server is not required to follow it.

  • Keys: compare them in constant time, store only a hash, accept the old and the new key side by side during a rotation, remove the key when the shop is disconnected.
  • Several merchants in one system: bind each key to exactly one merchant.
  • HTTP: send Cache-Control: no-store and no CORS headers; authenticate by the bearer key only; log Yasan-Request-Id; ignore unknown Yasan- headers and unknown query parameters.
  • Order endpoints: rate-limit them and answer 429; keep their query strings out of access logs; keep customer data out of error messages; make invoiceUrl, paymentUrl and statusUrl hard to guess (0.1.0 allowed a public link).
  • Order numbers: compare them as strings and whole; route on the raw path on nginx; treat an empty customerEmail as missing; give storefronts that can issue the same number their own connections.
  • Changes feed: set updated_at at commit, store timestamps in UTC, keep deletions for at least 30 days, and move updated_at only when the line really changed.
  • A pre-generated export: regenerate it at least once a day and serve it with the right Content-Type and Content-Encoding.
  • Streaming from PHP: the unbuffered query, the time limits, the JSON flags, and a server that copes with a client that disconnects early.
  • Catalog data: return attributes, codes and variants in the same order every time; serve images over https and without a Referer check; give your own extra fields a prefix such as x_.
  • Variant titles read best when they say only what tells the variant apart.

Worth five minutes if you built 0.1.0

These are the checks that can matter for data 0.1.0 already allowed.

  • Your longest id and your longest line. An id may have 255 characters and a line 1 MiB. Test connection reports the longest of each it saw.
  • The size of your export and of your changes responses. A full export may have 1.5 GiB compressed, several million product lines. A larger one fails and changes nothing. A changes response may have 64 MiB compressed, roughly 200,000 product lines. A larger one sets the feed aside, and nightly full exports take over. Check the second number if a nightly job touches updated_at on every product.
  • An export that breaks before its end. If the transfer is cut (a timeout on your side, a proxy limit), nothing of it is imported any more. The curl check under Testing your implementation shows whether the end line arrives.
  • Extra fields of your own with one of these names now have a meaning: filterable, categoryIds, primaryCategoryId, shortDescription on a product line; shippingMethod, pickupPoint, statusUrl, estimatedDeliveryFrom, estimatedDeliveryTo, paymentUrl, paymentInstructions, internal and an item's productId on an order.
  • Languages outside the supported list. Their lines are not imported. See Languages.
  • A price of 0. It is read as no price: the variant is shown without a price.
  • Bans after failed logins. Every Test connection sends one or two requests without a key, and every save of the connection one more. Keep your threshold above a few of them per hour.
  • The base URL. The merchant enters it including /whisper/v1. It must answer without a redirect and with a publicly trusted certificate.
  • More than 250 variants on a product, and the other limits: 100 attributes and 50 codes per variant, 2,048 characters per URL, 200 items per order, 8 MB per order response.
  • Sale prices. A sale price that is not lower than the regular price is dropped.
  • Several currencies. The price in defaultCurrency is the one shown.
  • Orders. The orderNumber and the customerEmail you return must be the ones Yasan asked for, apart from letter case and spaces around them.
  • An old since. After a full export since is a day or more back. A feed built as updated_at > :since handles that. A feed that answers 400 to a since it finds too old is set aside, and nightly full exports take over.
  • Long imports. A write transaction longer than 15 minutes can lose changes until the weekly full export.

Not in this revision

Named here so you do not build workarounds, and so you need not ask.

  • Filters on the full export. Optional storefrontId and language parameters on GET /products, so that one storefront or language can be fetched on its own. Today the export is always the whole catalog.
  • Sync hint. A Yasan-hosted endpoint you can call after a change, so that Yasan polls the changes feed within minutes instead of hours.
  • Write actions. Cancel an order, change a delivery address, add a note.
  • Customer profile lookup, for loyalty and account questions.
  • Request signing with the reserved Yasan-Signature header. Until then the API key is the only authentication.
  • A default currency per language. Today a storefront has one default currency for all its languages.

Handshake

Connection check and capability discovery.

Get connection info

Describes the store: its name, its storefronts with their languages and currencies, and what this implementation supports.

Yasan calls it when the merchant tests or saves the connection, before every synchronization, and at least once a day. A change in the answer (a new storefront, a new language, a new capability) therefore takes effect within a day, or immediately when the merchant saves the connection again. Each test and each save also sends this request once without a key; that one must answer 401.

Keep it cheap: no catalog scans. Yasan waits at most 10 seconds.

The answer must contain at least one usable storefront: an id, a url, a language Yasan imports (see Languages) and a currency. Otherwise the connection is refused. Such an answer from a store that is already connected is treated as a failure and changes nothing.

Send every field described below. The schema marks as required only what Yasan cannot do without. For the rest it falls back and reports it: a missing name becomes the host name of the base URL, a missing storefront title becomes the shop name or the host name of the storefront's url, a missing defaultLanguage the first of its languages that Yasan imports, a missing defaultCurrency the first of its currencies, and missing capabilities mean a connection with a catalog only.

The body may be at most 1 MB.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
Example
{
  • "specVersion": "0.2.0",
  • "name": "Acme Outdoor s.r.o.",
  • "storefronts": [
    ],
  • "capabilities": { }
}

Products

Products and categories, pulled by Yasan's background synchronization. See Catalog synchronization.

List categories

Returns the whole category tree of one storefront in one language as a flat list; each category names its parent. Only called when the categories capability is declared. See Categories.

Yasan calls it once for every declared storefront and imported language, before every full export and every changes poll, and replaces its copy with the answer. There is no changes feed for categories. An empty list is treated as a failure and keeps the previous tree. If the request fails, the previous tree is kept as well and the product synchronization goes on.

Return every category a product can be listed in. Mark the ones that should not become a shelf or a filter with "visible": false. That hides the category and everything below it.

Answer 400 for a storefront or a language you did not declare. The body may be at most 16 MB uncompressed, and the list at most 50,000 categories; beyond either the previous tree is kept.

Authorizations:
bearerAuth
query Parameters
storefrontId
required
string
Example: storefrontId=acme-cz

One of the storefronts[].id values from GET /info.

language
required
string (LanguageCode) ^[a-z]{2}(-[A-Za-z0-9]{2,8})?$
Examples: language=cs language=en language=pt-BR

One of that storefront's languages, exactly as declared. Names and URLs in the answer are in this language.

Responses

Response samples

Content type
application/json
{}

Export full catalog

Streams the entire visible catalog as JSONL: one upsert line per product line (one per storefront and language), then the mandatory end line. No query parameters. See Stream format and Full export.

A complete response looks like this (three product lines, then end):

{"type":"upsert","product":{"id":"1042","storefrontId":"acme-cz","language":"cs","title":"Trekové boty Alpina","url":"https://www.example.cz/boty-alpina","brand":"Alpina","categoryPath":["Obuv","Treková obuv"],"variants":[{"id":"1042-41","title":"vel. 41","prices":[{"amount":129800,"currency":"CZK"}],"availability":"in_stock"},{"id":"1042-42","title":"vel. 42","prices":[{"amount":129800,"currency":"CZK"}],"availability":"backorder"}],"updatedAt":"2026-07-12T14:03:00Z"}}
{"type":"upsert","product":{"id":"1042","storefrontId":"acme-cz","language":"en","title":"Alpina trekking boots","url":"https://www.example.cz/en/alpina-trekking-boots","brand":"Alpina","categoryPath":["Footwear","Trekking shoes"],"variants":[{"id":"1042-41","title":"size 41","prices":[{"amount":129800,"currency":"CZK"}],"availability":"in_stock"},{"id":"1042-42","title":"size 42","prices":[{"amount":129800,"currency":"CZK"}],"availability":"backorder"}],"updatedAt":"2026-07-12T14:03:00Z"}}
{"type":"upsert","product":{"id":"2001","storefrontId":"acme-cz","language":"cs","title":"Impregnace na obuv 250 ml","url":"https://www.example.cz/impregnace-250","variants":[{"id":"2001","prices":[{"amount":18900,"currency":"CZK"}],"availability":"in_stock"}],"updatedAt":"2026-06-30T08:00:00Z"}}
{"type":"end","count":3}
  • delete lines are not allowed here. The full export is the complete state, so a product line that is absent is removed, once the stream is complete. A line Yasan has to skip is not absence: when its storefrontId, language and id can be read, Yasan keeps what it has for it.
  • Lines may come in any order; storefronts and languages may be mixed.
  • If you declare productChanges, send updatedAt on every line. The first since comes from the first complete full export; without timestamps here the changes feed is never called.
  • Start writing as early as you can and write one line at a time from a database cursor. Yasan aborts after 60 seconds without bytes, and the whole transfer must finish within 5 hours. Yasan reads as fast as you send; its own processing does not count towards the 5 hours.
  • Content-Encoding: gzip is supported and recommended.
  • If the end line is missing or its count does not match, Yasan treats the stream as incomplete and deletes nothing. If the response arrived whole, the lines in it are imported. If the transfer broke, Yasan discards what arrived, changes nothing and tries again later.
  • Serving a pre-generated file is fine. Regenerate it at least once a day.
  • A line may be at most 1 MiB, and an id at most 255 characters. The whole response may be at most 1.5 GiB compressed, several million product lines. Beyond that the export fails and nothing changes.
  • Besides the nightly or weekly schedule, Yasan can ask for the export at any hour, and again after a failure. See Full export.

The schema of this response describes one line of the stream.

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/x-ndjson
Example
{
  • "type": "upsert",
  • "product": {
    }
}

Export product changes

Streams what changed after since, in the same JSONL format as the full export, plus delete lines, then the mandatory end line. Only called when the productChanges capability is declared; Yasan polls it every few hours. See Incremental changes.

If you declare productChanges, send updatedAt on every line of both product endpoints.

A complete response looks like this: a changed product line, a deleted product, then end:

{"type":"upsert","product":{"id":"2001","storefrontId":"acme-cz","language":"cs","title":"Impregnace na obuv 250 ml","url":"https://www.example.cz/impregnace-250","variants":[{"id":"2001","prices":[{"amount":19900,"currency":"CZK"}],"availability":"out_of_stock"}],"updatedAt":"2026-07-09T10:15:00Z"}}
{"type":"delete","productId":"1877","storefrontId":"acme-cz","deletedAt":"2026-07-09T11:03:00Z"}
{"type":"end","count":2}
  • Return every product line whose updatedAt is after since, and a delete line for every product deleted after since.
  • Send each product line whole, exactly as GET /products would. A field you leave out is cleared.
  • A product that no longer exists or is no longer visible on a storefront is sent as a delete line. It removes that product on that storefront, in every language.
  • A product removed everywhere needs one delete line per storefront. A delete for something Yasan does not have is ignored.
  • Overlap is normal. Between polls Yasan asks from 15 minutes, plus the time the previous response took, before the newest change it has seen. After a full export it asks from 24 hours before the newest timestamp in that export. Sending a line twice is harmless.
  • Lines need no particular order, with one case that has a rule of its own. A delete removes every language line of that product on that storefront, except a line for which the same response also carries an upsert that comes after the delete, or whose updatedAt is not earlier than the delete's deletedAt.
  • Keep deletions for at least 30 days.
  • Nothing changed? Answer with the single line {"type":"end","count":0}.
  • The whole response may be at most 64 MiB compressed, roughly 200,000 product lines, with at most 100,000 delete lines. Beyond that the feed is set aside: Yasan stops polling it and runs the full export every night, until one is complete.
  • A 400 (or 410) to this request sets the feed aside in the same way. 429 and 5xx do not: Yasan tries again later.

The schema of this response describes one line of the stream.

Authorizations:
bearerAuth
query Parameters
since
required
string <date-time>
Example: since=2026-07-09T02:00:00Z

Return every product line whose updatedAt is after this instant, and every deletion whose deletedAt is after it. The value comes from your own timestamps. Between polls it is the newest updatedAt or deletedAt Yasan has received, minus the time the previous response took, minus 15 minutes; it never moves back between polls. After every full export it is the newest timestamp found in that export, minus 24 hours. A timestamp ahead of Yasan's clock is read as "now". Yasan always sends UTC in whole seconds, in this form; the colons may arrive percent-encoded.

Responses

Response samples

Content type
application/x-ndjson
Example
{
  • "type": "upsert",
  • "product": {
    }
}

Orders

Live order lookup. See Orders.

List orders

Returns the customer's orders as full Order objects, newest first, at most 20, across all storefronts of the connection. There is no pagination. An unknown e-mail address returns an empty list, not 404. Only called when the orders capability is declared. See Orders.

Match the address against the contact address stored on each order, ignoring letter case. Yasan sends it in lower case. In automated answers the address is one Yasan has verified. When an operator handles the conversation it may be an address the assistant took from the conversation, which need not be verified and need not be the one the customer wrote from; see Who is asking.

If your system hosts several merchants, return only the orders of the merchant this key belongs to.

Yasan waits at most 10 seconds, while a customer or an operator is waiting for the answer. The body may be at most 8 MB uncompressed.

Authorizations:
bearerAuth
query Parameters
customerEmail
required
string

The customer's e-mail address. Compare it ignoring letter case. Answer 400 when it is missing or empty; never return all orders. No format is declared: an address with national characters is sent as it is.

Responses

Response samples

Content type
application/json
Example
{
  • "orders": [
    ]
}

Get order

Returns one order. Only called when the orders capability is declared. See Orders.

Answer 404 unless customerEmail matches the order's contact address (ignoring letter case). A wrong address and an unknown order number must look exactly the same, so that nobody can find out which order numbers exist. The pair of order number and e-mail address is the authorization. In automated answers the address is one Yasan has verified. When an operator handles the conversation it may be an address the assistant took from the conversation, which need not be verified and need not be the one the customer wrote from (see Who is asking).

customerEmail is missing only if you declared the ordersByNumber capability, and then in two situations: while one of the merchant's operators is handling the conversation, and once in every Test connection, with a random order number that must answer 404. Return the order by its number alone. If you did not declare the capability, Yasan always sends customerEmail; answer 400 to a request without it, or with an empty one.

orderNumber is the number customers see and quote. It is percent-encoded in the path: 2026/01734 arrives as 2026%2F01734. Match the whole number, never a prefix, and compare it as a string. On nginx, route on the raw path and decode the order number afterwards. Yasan discards an order whose orderNumber differs from the one it asked for (compared after trimming, ignoring letter case).

If two storefronts can issue the same order number, give each its own connection, or match the number and the address together and do not declare ordersByNumber. If your system hosts several merchants, another merchant's order is 404.

Yasan waits at most 10 seconds. The body may be at most 8 MB uncompressed.

Authorizations:
bearerAuth
path Parameters
orderNumber
required
string
Example: 2026/01734

The customer-facing order number, percent-encoded.

query Parameters
customerEmail
string

The customer's e-mail address. Compare it ignoring letter case. Always sent, unless you declared ordersByNumber: then it is left out while an operator is handling the conversation, and once in every Test connection. Treat an empty value as missing. No format is declared: an address with national characters is sent as it is.

Responses

Response samples

Content type
application/json
Example
{
  • "orderNumber": "2026/01734",
  • "storefrontId": "acme-cz",
  • "customerEmail": "[email protected]",
  • "language": "cs",
  • "status": "dispatched",
  • "statusText": "Odesláno – zásilka je na cestě",
  • "createdAt": "2026-07-01T09:14:00Z",
  • "updatedAt": "2026-07-03T08:02:00Z",
  • "paidAt": "2026-07-01T09:15:12Z",
  • "dispatchedAt": "2026-07-03T08:02:00Z",
  • "paymentMethod": "Platba kartou online",
  • "paymentStatus": "paid",
  • "totalPrice": {
    },
  • "totalVat": {
    },
  • "shippingPrice": {
    },
  • "discounts": [
    ],
  • "shippingMethod": "Zásilkovna – výdejní místo",
  • "pickupPoint": "Z-BOX Brno, Krátká 12, 602 00 Brno",
  • "estimatedDeliveryFrom": "2026-07-04",
  • "estimatedDeliveryTo": "2026-07-07",
  • "shipments": [],
  • "items": [
    ],
  • "deliveryAddress": {
    },
}