This page exists in one language only. Some pages here are English, some Swedish.
Public Intake API
Use this API to submit source data to Stockisto's ingestion pipeline. It is a separate credential class from the tenant read and write API, and every batch lands in a staging store before anything reaches live data.
Get the right key
A StockistoAdmin issues an intake key for one tenant. The key carries the isolated api:intake
scope and travels in the X-API-Key header. A tenant Developers key with api:read or api:write
cannot call this API, and an intake key cannot call the tenant read or write endpoints.
At issuance the StockistoAdmin binds the key to one source: scraper, delegated or crowd. The
envelope's source and every record-level provenance.source must match that binding. The key is
shown once; keep it in your server-side secret store. A key may carry an expiry date, and a revoked
or expired key answers 401 like an unknown one.
Submit a batch
Use the v1 envelope. Replace only the angle-bracket placeholders. The example uses scraper; use
the source bound to your own key.
submit request
curl -X POST https://api.test.stockisto.com/api/public/v1/intake/batches \
-H "X-API-Key: <YOUR_INTAKE_KEY>" \
-H "Content-Type: application/json" \
--data '{
"contractVersion": "1.0",
"source": "scraper",
"idempotencyKey": "<UNIQUE_BATCH_KEY>",
"records": [
{
"kind": "retailer-company",
"naturalKey": "<UNIQUE_RETAILER_KEY>",
"payload": { "name": "<RETAILER_NAME>" }
}
]
}'A new batch returns 202 Accepted with the batch id and a status link. A retry with the same
idempotencyKey from the same key returns 200 with the existing batch and stages nothing again.
Envelope fields
| Field | Rule |
|---|---|
contractVersion | Required, must be 1.0. |
source | Required, must equal the key's bound source. |
idempotencyKey | Required, up to 200 characters, unique per tenant. |
description | Optional, up to 500 characters. |
metadata | Optional JSON object stored on the batch, for example { "country": "SE" }. |
records | 1 to 50,000 entries. |
records[].kind | Required. supplier-company, retailer-company, installer-company and retailer-stock have appliers today; other kinds stay staged. |
records[].naturalKey | Required for those four kinds, up to 512 characters. A row of one of those kinds without a key is rejected per record; the batch still goes through. |
records[].payload | Required JSON object, up to 256 KB. |
records[].provenance | Optional: source (must match the key), fetchedAt (UTC; a future time is rejected), confidence (0 to 1), sourceRef (up to 1024 characters). |
A record that fails validation is rejected on its own and listed under the batch's
validationErrors. The rest of the batch continues. The whole batch is refused only when the
envelope is invalid or every record fails.
Read a batch back
GET /api/public/v1/intake/batches/<BATCH_ID>
GET /api/public/v1/intake/batches lists the batches this key submitted. A batch submitted by
another key is reported as unknown, even when it belongs to the same tenant.
Batch statuses: received, validated, staged, in_review, applied, partially_applied,
rejected.
The review gate
Batches from scraper, delegated and crowd sources stop at in_review until a Stockisto
operator approves them, unless the operator has granted your tenant and source an auto-apply trust
flag. A batch whose changes would remove an unusually large share of live rows is always held for
review. Read status, not the record count, to know whether a batch reached live data.
Optionally, the StockistoAdmin registers an https callback URL with your key. When a batch reaches
applied, partially_applied or rejected, a signed import.completed delivery is sent there.
Operations
| Operation | Purpose |
|---|---|
POST /api/public/v1/intake/batches | Submit one v1 envelope. |
GET /api/public/v1/intake/batches | List batches submitted by this key. |
GET /api/public/v1/intake/batches/<BATCH_ID> | Read one batch's status with the submitting key. |
Limits
| Limit | Value |
|---|---|
| Request body | 64 MB |
| Records per batch | 50,000 |
| Payload per record | 256 KB |
| Requests per key | 30 per minute |
| Batches per key per UTC day | 200 by default; set at issuance, up to 10,000 |
| Records per key per UTC day | 500,000 by default; set at issuance, up to 10,000,000 |
A rate-limit refusal returns 429 with Retry-After. A daily-quota refusal returns 429 with
error: "intake_quota_exceeded" and a quota object that carries the limits, today's usage and
resetAt. A retry of a batch you already submitted still answers 200, even when the quota is
exhausted.
Diagnose a response
| Status | Meaning | Next step |
|---|---|---|
| 200 | This key already submitted a batch with this idempotencyKey. The existing batch is returned. | Nothing; the retry added no volume. |
| 202 | The batch was accepted and staged. | Poll the status link. |
| 400 | The envelope is invalid. | Correct the reported fields and submit a new valid batch. |
| 401 | The key is missing, invalid, expired or revoked. | Ask the StockistoAdmin to issue or rotate the key. |
| 403 | The source does not match the key, or the credential is not an intake key. | Use the bound source and an api:intake key. |
| 404 | The batch id is unknown to this key. Another key's batch is deliberately indistinguishable from an unknown id. | Read the batch with the submitting key. |
| 409 | The idempotencyKey belongs to another credential. | Choose a new idempotency key. |
| 413 | The body is over 64 MB, or the batch has more than 50,000 records. | Split the batch and submit smaller parts. |
| 429 | The request rate or the daily volume limit is exhausted. | Honor Retry-After, or wait for resetAt. |