Beta
Documentation index
Integrations

The Noobit API

For developers: keys, channels, how to keep a copy up to date, notifications and sending data.

9 min read

The API is for the technical team connecting a website, an app or an ERP. It lives at https://api.noobit.ai/v1 and the reference for each route, with its fields and errors, is at https://api.noobit.ai/v1/openapi.json. This page explains how to use it well.

In every plan
The API comes with every plan, and an API channel counts as one of your plan's output destinations. It is already on in your account: you'll find it under «Configuración» (Settings) → «Integraciones» (Integrations).

The key

It is created in «Configuración» → «Integraciones» (Settings → Integrations). It is shown only once. It goes in every request:

Authorization: Bearer nb_live_…
  • Each key carries its own permissions, and it can be limited to specific channels.
  • Never in the browser or inside an app that gets distributed: whoever extracts it reads everything the key allows.
  • GET /v1/me tells you which account it belongs to, which permissions it has and its limits.

Reading: channels

A channel is an API-type output: which products go in, in which language and with which fields. It is configured in «Tiendas y canales» → «Canales de salida» (Stores and channels → Output channels). The API delivers each product of the channel in full: identity, category, prices, stock, attributes, photos, files, variations and the channel's fields.

GET /v1/channels
The channels the key can read.
GET /v1/channels/{channel}/snapshot
The whole channel, in a compressed file. For the initial load.
GET /v1/channels/{channel}/changes
What changed since your last request.
GET /v1/channels/{channel}/products/{ref}
One product, by its id, by sku:… or by ean:…
Photos are served from our CDN
Never from the supplier's website. And a photo that changes stays at its previous address for at least 7 days: your website doesn't show broken photos.

Your website shouldn't ask Noobit on every visit. Keep a copy of the channel and keep it up to date: that way your visitors don't depend on Noobit responding.

  1. Initial load: download the channel file and store the cursor it carries.
  2. Every few minutes, or when a notification arrives, ask for the changes since your cursor. A 304 means there is nothing new.
  3. Apply each entry by replacing the whole product, without merging. An entry marked as removed deletes the product.
  4. Store the new cursor after applying the page. Applying an entry twice gives the same result, so if something fails you just repeat it.
  5. If you get 410 RESYNC_REQUIRED, build a new copy while you keep serving the old one, and switch them when it is complete.
  6. If you get 401, 403, 404 or 410 CHANNEL_GONE, delete nothing: keep serving the latest data and alert a person.

We give you a reference script, in a single file and with no dependencies, that does exactly this. Ask us for it at [email protected].

What Noobit guarantees

  • No change is skipped. If a product changed five times since your last request, it arrives once, with its latest version.
  • Removals always arrive: whether the product leaves the channel, is archived, is delisted or is deleted.
  • A mass removal does not happen on its own: if many products were about to leave at once, the removals wait until a person on your account confirms them.
  • The fields the AI writes are never written at read time: they are written when someone asks for it in Noobit. One not yet written arrives empty and marked as pending.

Notifications

With a notification you don't need to poll every few minutes: Noobit calls your system when something changes. They are created in «Configuración» → «Integraciones» → «Avisos» (Settings → Integrations → Notifications): an https address and which notifications you want.

channel.changes.available
A channel has changes. One per channel: an import of 3,000 products is one notification, not 3,000.
task.completed
A task finished.
task.failed
A task failed completely.
ping
The test you send yourself from «Integraciones».
  • The notification carries no data: it says what changed and your system reads it with its key. That way a lost notification never throws you off.
  • Each notification is signed. Check the signature before anything else and reject the ones older than 5 minutes.
  • Respond with a 2xx in under 10 seconds and do the work afterwards.
  • A notification that fails is retried up to 8 times over about 24 hours.
  • Even with notifications, poll for changes every 15-60 minutes as a safety net.

Writing: stock, prices and products

Your system sends data to its connection (an «own system»). Each item is applied in full or not at all, and the response carries one result per item.

PATCH /v1/connections/{connection}/stock
Up to 250 items. Responds immediately.
PATCH /v1/connections/{connection}/prices
Up to 250 items. Current price and was price.
PATCH /v1/connections/{connection}/products
Up to 500 full products, with their variations. Runs as a task.
POST /v1/connections/{connection}/publications
Confirms what you have published and under which identifier of yours.
PATCH /v1/connections/{connection}/stock
Authorization: Bearer nb_live_…

{ "items": [
  { "ref": { "sku": "KOL-71-60" }, "stockQuantity": 12 },
  { "ref": { "ean": "8005610434394" }, "stockQuantity": 0 }
] }
  • The product is found by your identifier if it is already linked; if not, by the EAN, and then by the SKU.
  • What you don't send is not touched.
  • The stock of a product with variations goes in its variations.
  • Repeating a request is safe: the values are absolute. With the Idempotency-Key header, the first response is also returned.
  • What changes reaches only your channels, and your stores if you have chosen so.

Limits and errors

Every response carries its RateLimit headers. On a 429 or a 503, wait as long as Retry-After says and retry. All errors have the same shape, with a stable code and a message:

{ "error": { "code": "…", "message": "…" } }