Working well with the API How-to Open in shop →
How to build a synchronisation that is still correct on its tenth run.
Path: Home › Footer: Developer / API
This page is not here to lay down rules, but because the four points below are the mistakes on which a synchronisation fails in practice.
Fetch only what changed
The most expensive and most common mistake is pulling the whole catalogue every night. Use updated_at_min instead and remember the time of your last successful run:
GET /api/v1/products?updated_at_min=2026-08-29T02:00:00%2B02:00&limit=250
Set the mark only after the synchronisation completed, not before. If the run breaks in the middle, the next one starts at the same place instead of leaving a gap.
Read the rate limit rather than running into it
Every response names the state in X-Ptz-Rate-Limit. A client that reads it and pauses briefly when things get tight is faster than one that runs into 429 and then waits for Retry-After.
On a 429: wait the seconds given in Retry-After. Asking again immediately makes it worse for everybody, including you.
Retry, but correctly
Retry on 429, 500, 502, 503 and 504, with growing intervals. Do not retry on 400, 401, 403, 404, 409, 413, 415 and 422: these answers do not become correct through repetition, they need a change.
For write calls: reuse the same Idempotency-Key. That is exactly what it is for. A new key on a retry creates a second object.
Be prepared for additions
New fields may arrive at any time without the major version changing. A client that treats an unknown field as an error turns that into an outage. Read the fields you need and ignore the rest.
What you should not do
Put the access key in the address. It ends up in every log.
Branch on detail. The text changes with the language and may be made more precise. The code does not.
Poll for a run to finish without a pause. A run through the interface for a single product is already finished when the response arrives. For bulk variants the response names a run_id; checking every few seconds is enough.
Send prices as decimals. They are rejected, and that is the friendlier of two options.
This page did not answer your question? The Help Center has more articles, or open a support ticket directly.