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:
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.
GET /info to check the API key and to learn your
storefronts, their languages and currencies, and which optional parts you
implement.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.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:
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.
https with a publicly trusted certificate (TLS 1.2 or newer), on a
public host name. Any port works.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.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>
401 on every endpoint.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.| 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.
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.
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.
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:
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.
Yasan keeps the catalog of each storefront apart. A visitor of one storefront is only shown that storefront's products.
A storefront serves one or more languages. GET /info lists them in languages.
(storefrontId, language, id). Fields that do not depend on the
language (codes, prices, availability) are simply repeated on each line.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).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).defaultLanguage is not a supported entry of languages, the first
supported one is used.cs to cs-CZ reads as removing one
language and adding another.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.delete followed by upserts of the
remaining languages in the changes feed (see
Incremental changes).prices list with one entry per currency. A single-currency shop
writes one-entry lists.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.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:
\n (\r\n is accepted). A JSON
object must not contain a raw line break, so do not pretty-print.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.storefrontId, language and id), it keeps what it has for
it. A line whose identity cannot be read protects nothing.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.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: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.end line. Either way nothing
is removed.Transport:
Content-Encoding: gzip is supported and recommended. It usually shrinks the
stream about ten times.proxy_buffering on. Serverless platforms
with a cap on response size or time (for example Lambda behind API Gateway)
cannot serve these endpoints.send_timeout and fastcgi_read_timeout, MySQL
net_write_timeout, PHP max_execution_time and php-fpm
request_terminate_timeout.end line, rename the file
into place, and serve it from GET /products. Yasan then always gets a complete
file, quickly.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.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.
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:
Some exports come at any hour:
GET /info;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.(storefrontId, language, id) appears twice, the last line wins.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.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.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.delete line does.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:
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.
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.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.since is the
newest timestamp found in that export, minus 24 hours, and Yasan polls
the changes feed right after the export.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.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.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).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.
from and to, and Yasan applies the window itself.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.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.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.delete
followed by upserts of the remaining language lines; see below.delete for something Yasan does not have is ignored. It counts towards
no safeguard.delete line without a readable deletedAt is still applied, and
reported. It cannot move since.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:
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.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:
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.upsert without a timestamp: it protects its product line.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:
delete lines;400 or 410 to the request;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 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.
url and position: a shelf links to your category page and shelves keep
the order of your menu."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.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:
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.
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. |
Export only what a visitor can see: no drafts, no archived or hidden products. Yasan does not filter them for you.
delete line. It removes that product
on that storefront, in every language. There is no other removal line. See
Incremental changes."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 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 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 }
]
name. There is no list of values. Never put several values into one
string: "kůže, textil" is one value to Yasan.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."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.name: lower case, without diacritics ("Materiál" becomes material).brand
field. An attribute named Brand stays searchable and is not a filter.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).
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.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.'12345-2' matches order 12345.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.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.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:
404.Without ordersByNumber Yasan always sends customerEmail. When
customerEmail is present, the 404 rule applies as always.
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.
The API key grants lookup of orders, so treat it like a password to them.
429 when
the limit is hit. Yasan sends only a few lookups at a time per connection.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.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.404. See
Securing your API.Content-Type: application/json, and application/x-ndjson
for the two product streams.x_), so that a later revision cannot use
the same name with another meaning.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.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.{ "amount", "currency" }: an integer in minor units and an
uppercase ISO 4217 code. All prices include VAT.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.description is accepted and converted to
text. A blank string is read as absent.{"error": {"code": "…", "message": "…"}}. The HTTP status is what Yasan acts
on; the body is for diagnostics. You should not put customer data into
message.GET and changes nothing on your side. Yasan never
writes to your system.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.)visible
hides a category.)id of 1042 is read as
"1042". Numbers above 9007199254740991 cannot be read reliably and the line is
skipped."129800" for an amount,
"7" for a stock quantity.true, false, 1, 0, "1", "0", "true" and
"false".czk is read as CZK).availability, a code's type, an order's status and
paymentStatus. So In_Stock is read as in_stock.+0200 is read as +02:00.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.type is read as other.prices or in salePrices, or the same variant
id twice in a product: the last entry wins, and the repeat is reported as
duplicate.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:
1298.5,
"1298.00", "1 298") could be crowns or haléře, so that price entry is
dropped and reported.from and to can be read. Otherwise it is dropped.visible hides a category unless it is clearly true.GET /info
declares, or the line is skipped. What Yasan already has for that product
line is kept.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.
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.)
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.
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.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.customerEmail as "all orders". See
Protecting order lookup.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;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;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;since;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:
GET /info does not describe a usable storefront;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.
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.GET /info over HTTPS with the bearer key; declare your storefronts,
their languages and currencies, and what you implement.GET /products as a JSONL stream with the end line: visible products
only, one line per storefront and language.GET /orders and GET /orders/{orderNumber} with the e-mail rule.GET /categories, and categoryIds on products.GET /products/changes, with updatedAt on every line of both
product endpoints, an updatedAt that really moves, and a table of deleted
products.401
without a key.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.
You may add any of these. None of them is needed.
categories capability, GET /categories, and
categoryIds and primaryCategoryId on products. categoryPath stays valid."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.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.pt-BR).429 and 503 are documented on every endpoint, with the error
codes unavailable and internal_error. Retry-After may also be an HTTP
date.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.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.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.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:
since is chosen differently. 0.1.0 said: the newest timestamp received,
minus a small safety window. Now:end line,
since is moved back the same way if it was later, and a poll follows
too;since back;since is always UTC in whole seconds.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".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.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.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.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./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.customerEmail, unless you declare ordersByNumber. See
Who is asking.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:
end line is missing
or its count is wrong, its lines are imported and nothing is removed.defaultCurrency.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.count counts, duplicates, lines
for an undeclared storefront or language, timestamps in the future.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:
billingAddress and customerNote existed in 0.1.0 and
are passed on to the operator; nothing to change.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.
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.
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.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).customerEmail as missing; give storefronts that can
issue the same number their own connections.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.Content-Type and Content-Encoding.https and without a Referer check; give your own
extra fields a prefix such as x_.These are the checks that can matter for data 0.1.0 already allowed.
updated_at on every product.curl
check under Testing your implementation
shows whether the end line arrives.filterable, categoryIds, primaryCategoryId, shortDescription on a
product line; shippingMethod, pickupPoint, statusUrl,
estimatedDeliveryFrom, estimatedDeliveryTo, paymentUrl,
paymentInstructions, internal and an item's productId on an order./whisper/v1. It must
answer without a redirect and with a publicly trusted certificate.defaultCurrency is the one shown.orderNumber and the customerEmail you return must be the
ones Yasan asked for, apart from letter case and spaces around them.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.Named here so you do not build workarounds, and so you need not ask.
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.Yasan-Signature header. Until then the
API key is the only authentication.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.
{- "specVersion": "0.2.0",
- "name": "Acme Outdoor s.r.o.",
- "storefronts": [
- {
- "id": "main",
- "title": {
- "cs": "Acme Outdoor"
}, - "languages": [
- "cs"
], - "defaultLanguage": "cs",
- "currencies": [
- "CZK"
], - "defaultCurrency": "CZK"
}
], - "capabilities": { }
}Products and categories, pulled by Yasan's background synchronization. See Catalog synchronization.
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.
| storefrontId required | string Example: storefrontId=acme-cz One of the |
| 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 |
{- "categories": [
- {
- "id": "142",
- "parentId": "12",
- "name": "Treková obuv",
- "position": 10
}, - {
- "id": "143",
- "parentId": "12",
- "name": "Běžecká obuv",
- "position": 20
}, - {
- "id": "20",
- "parentId": null,
- "name": "Oblečení",
- "position": 20
}, - {
- "id": "900",
- "parentId": null,
- "name": "Výprodej",
- "visible": false
}
]
}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.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.Content-Encoding: gzip is supported and recommended.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.The schema of this response describes one line of the stream.
{- "type": "upsert",
- "product": {
- "id": "1042",
- "storefrontId": "acme-cz",
- "language": "cs",
- "title": "Trekové boty Alpina",
- "shortDescription": "Celokožené trekové boty s membránou pro celoroční použití.",
- "description": "<p>Celokožené trekové boty s membránou Gore-Tex…</p>",
- "brand": "Alpina",
- "categoryPath": [
- "Obuv",
- "Treková obuv"
], - "categoryIds": [
- "142"
], - "primaryCategoryId": "142",
- "attributes": [
- {
- "name": "Materiál",
- "value": "Kůže"
}, - {
- "name": "Membrána",
- "value": "Gore-Tex"
}, - {
- "name": "Určení",
- "value": "Turistika"
}, - {
- "name": "Určení",
- "value": "Trekking"
}, - {
- "name": "Údržba",
- "value": "Impregnovat po každém čištění",
- "filterable": false
}
], - "variants": [
- {
- "id": "1042-41",
- "title": "vel. 41",
- "codes": [
- {
- "type": "sku",
- "value": "ALP-TREK-41"
}, - {
- "type": "ean",
- "value": "8595026712341"
}
], - "prices": [
- {
- "amount": 129800,
- "currency": "CZK"
}, - {
- "amount": 5290,
- "currency": "EUR"
}
], - "vatRate": 21,
- "availability": "in_stock",
- "availabilityText": "Skladem, odesíláme dnes",
- "stockQuantity": 7,
- "attributes": [
- {
- "name": "Velikost",
- "value": "41"
}
]
}, - {
- "id": "1042-42",
- "title": "vel. 42",
- "codes": [
- {
- "type": "sku",
- "value": "ALP-TREK-42"
}, - {
- "type": "ean",
- "value": "8595026712342"
}
], - "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": 4760,
- "currency": "EUR",
- "from": "2026-07-01T00:00:00+02:00",
- "to": "2026-07-31T23:59:59+02:00"
}
], - "vatRate": 21,
- "availability": "backorder",
- "availabilityText": "Na cestě, dodání do 2 týdnů",
- "attributes": [
- {
- "name": "Velikost",
- "value": "42"
}
]
}
], - "updatedAt": "2026-07-12T14:03:00Z"
}
}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}
updatedAt is after since, and a delete
line for every product deleted after since.GET /products would. A field you
leave out is cleared.delete line. It removes that product on that storefront,
in every language.delete line per storefront. A
delete for something Yasan does not have is ignored.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.{"type":"end","count":0}.delete lines. Beyond that the feed
is set aside: Yasan stops polling it and runs the full export every
night, until one is complete.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.
| since required | string <date-time> Example: since=2026-07-09T02:00:00Z Return every product line whose |
{- "type": "upsert",
- "product": {
- "id": "2001",
- "storefrontId": "acme-cz",
- "language": "cs",
- "title": "Impregnace na obuv 250 ml",
- "variants": [
- {
- "id": "2001",
- "prices": [
- {
- "amount": 19900,
- "currency": "CZK"
}
], - "availability": "out_of_stock"
}
], - "updatedAt": "2026-07-09T10:15:00Z"
}
}Live order lookup. See 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.
| customerEmail required | string Example: [email protected] The customer's e-mail address. Compare it ignoring letter case. Answer |
{- "orders": [
- {
- "orderNumber": "2026/01734",
- "storefrontId": "acme-cz",
- "language": "cs",
- "status": "dispatched",
- "statusText": "Odesláno – zásilka je na cestě",
- "createdAt": "2026-07-01T09:14:00Z",
- "updatedAt": "2026-07-03T08:02:00Z",
- "dispatchedAt": "2026-07-03T08:02:00Z",
- "paymentMethod": "Platba kartou online",
- "paymentStatus": "paid",
- "totalPrice": {
- "amount": 126720,
- "currency": "CZK"
}, - "shippingMethod": "Zásilkovna – výdejní místo",
- "pickupPoint": "Z-BOX Brno, Krátká 12, 602 00 Brno",
- "shipments": [
- {
- "carrier": "Zásilkovna",
- "trackingNumber": "Z1234567890",
}
], - "items": [
- {
- "id": "item-1",
- "name": "Trekové boty Alpina, vel. 42",
- "quantity": 1,
- "unitPrice": {
- "amount": 129800,
- "currency": "CZK"
}, - "productId": "1042",
- "variantId": "1042-42"
}
]
}, - {
- "orderNumber": "2026/00911",
- "storefrontId": "acme-cz",
- "language": "cs",
- "status": "delivered",
- "statusText": "Doručeno",
- "createdAt": "2026-04-12T18:30:00Z",
- "updatedAt": "2026-04-15T11:20:00Z",
- "deliveredAt": "2026-04-15T11:20:00Z",
- "paymentMethod": "Dobírka",
- "paymentStatus": "paid",
- "totalPrice": {
- "amount": 28800,
- "currency": "CZK"
}, - "items": [
- {
- "id": "item-1",
- "name": "Impregnace na obuv 250 ml",
- "quantity": 1,
- "unitPrice": {
- "amount": 18900,
- "currency": "CZK"
}, - "variantId": "2001"
}
]
}
]
}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.
| orderNumber required | string Example: 2026/01734 The customer-facing order number, percent-encoded. |
| customerEmail | string Example: [email protected] The customer's e-mail address. Compare it ignoring letter case. Always sent, unless you declared |
{- "orderNumber": "2026/01734",
- "storefrontId": "acme-cz",
- "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": {
- "amount": 126720,
- "currency": "CZK"
}, - "totalVat": {
- "amount": 21993,
- "currency": "CZK"
}, - "shippingPrice": {
- "amount": 9900,
- "currency": "CZK"
}, - "discounts": [
- {
- "description": "Sleva 10 % – LETO2026",
- "amount": {
- "amount": 12980,
- "currency": "CZK"
}
}
], - "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": [
- {
- "carrier": "Zásilkovna",
- "trackingNumber": "Z1234567890",
- "dispatchedAt": "2026-07-03T08:02:00Z",
- "items": [
- {
- "itemId": "item-1",
- "quantity": 1
}
]
}
], - "items": [
- {
- "id": "item-1",
- "name": "Trekové boty Alpina, vel. 42",
- "quantity": 1,
- "unitPrice": {
- "amount": 129800,
- "currency": "CZK"
}, - "vatRate": 21,
- "productId": "1042",
- "variantId": "1042-42"
}
], - "deliveryAddress": {
- "name": "Jana Nováková",
- "street": "Krátká 12",
- "city": "Brno",
- "zip": "602 00",
- "country": "CZ"
},
}