Errors and retries
The 52ViKING APIs are asynchronous where it matters and rate limited throughout. Both facts shape how you should handle failures.
Status codes
Rate limits
Limits are published as approximate and subject to change. Treat these as
order-of-magnitude, and always handle 429 rather than assuming you are under
the ceiling.
The Master Data guidance is explicit and worth repeating: use the 2 MB body
allowance rather than sending many small updates. A single POST carrying a
thousand articles is cheaper for both sides than a thousand POSTs, and it is far
less likely to hit 429.
Asynchronous writes
Two APIs accept work and complete it later. Neither tells you the outcome in the response to your write.
Master Data
Every POST returns 202 Accepted with a reference in the Location header.
Schema validation is synchronous, so a malformed body fails immediately with
400. The distribution to stores is not.
Chain-scoped and store-scoped POSTs behave differently. Specify only the chain and the enterprise controller distributes identical data to every store. Specify chain and store and the data is store-specific, handled by that store directly. If you are unsure which you want, ask your FiftyTwo consultant. The choice is difficult to reverse once data is out.
Register Sale
POST /v1/sale returns a correlation ID immediately, and the sale starts in
Pending. Poll GET /v1/sale/{correlationId} until it reports Processed or
Failed.
A retry policy that works here
Retry a 401 exactly once, after refreshing
More than once and you are probably looking at a permissions problem, not an expiry problem.
Duplicate object_id values within a single Master Data POST body are
handled according to rules described in the
Master Data overview. Deduplicate before you send
rather than relying on that behaviour.