API guide for stores and marketplaces
Check items from your own intake, point-of-sale or listing systems, keep the audit trail, and hear when stock is recalled later.
Everything here is also available in the store portal, at resalewarden.drbyte.org/portal, which is where an owner opens a store, chooses a plan, creates API keys and adds webhooks. Using the API means agreeing to the store terms; what an answer means, and what it does not, is set out in sources and coverage.
Basics
- Base address:
https://resalewarden.drbyte.org/api/v1. HTTPS only. - JSON in and out, with
snake_casekeys. Fields may be added to responses over time; ignore any you do not use. - Times are UTC, in ISO 8601. Months for plan limits are calendar months in UTC.
API keys and scopes
An owner creates keys on the portal's API keys page. The key is shown
once, in full, and only its first characters are kept for display; store it
in a secret store, never in code or a web page. Send it in the
x-api-key header:
curl https://resalewarden.drbyte.org/api/v1/check \
-H "x-api-key: $RESALEWARDEN_KEY" \
-H "content-type: application/json" \
-d '{"brand": "Acme", "model": "AB-100"}'
Each key has one or more scopes:
| Scope | Allows |
|---|---|
check | Checks, label photos and batch uploads. |
lookups:read | The audit log, its exports, batch status and results, and the stock list. |
inventory | Recording stock decisions. |
A key can be tied to one of the store's locations, and then files its
checks there. A key can never manage the account: people, plans, keys and
webhooks are managed in the portal. Revoke a key on the same page; a revoked,
unknown or malformed key gets the same 401.
Checking an item
POST /api/v1/check with a barcode, or a brand (and,
ideally, a model):
| Field | Type | Notes |
|---|---|---|
gtin | string | 8, 12, 13 or 14 digits with a valid check digit; spaces and dashes are allowed. |
brand, model | string | Up to 120 characters each, as printed on the label. |
description | string | Up to 300 characters, such as "convertible car seat". Never a customer's details. |
category | string | One of the category keys from GET /api/v1/meta. |
manufacture_date | string | YYYY, YYYY-MM or YYYY-MM-DD; not in the future. |
jurisdiction | string | CA, CA-ON, US, US-CA and so on. Defaults to the store's region. |
location_id | integer | One of the store's locations. Defaults to the key's location, if it has one. |
The answer is recorded in the audit log before it is returned:
{
"lookup_id": 812,
"checked_at": "2026-10-07T15:00:00.000Z",
"jurisdiction": "US",
"verdict": "CHECK",
"reason": "Model AB-100 was recalled by CPSC on 2025-03-14 under the brand Acme Baby. Confirm the brand on the label.",
"what_to_check": ["Model AB-100 was recalled by CPSC on 2025-03-14 under the brand Acme Baby. Confirm the brand on the label."],
"what_to_do": [],
"product": { "gtin": null, "brand": "Acme", "model": "AB-100", "category": "juvenile_products", "...": "..." },
"recalls": [ { "recall_id": "...", "agency": "CPSC", "recall_date": "2025-03-14", "hazard": "...",
"remedy": "...", "source_url": "https://...", "match": "model_similar_brand" } ],
"rules": [],
"sources": [ { "name": "CPSC recall ...", "url": "https://..." } ],
"data_as_of": "2026-10-07T11:45:00.000Z"
}
verdictisRECALLED,DO_NOT_SELL,CHECKorNO_RECALL_FOUND, strongest first; the coverage page defines each one.reasonis one sentence to show as it is.what_to_checklists what to compare on the label, andwhat_to_dothe steps a recall notice gives.data_as_ofis how current the searched recall data is; see the date on an answer.- Show
NO_RECALL_FOUNDas "No recall found as of" that date, never as a statement that an item is fine.
Each check counts against the plan's monthly allowance. When the
recall data cannot be reached, the API answers 503, records
nothing and counts nothing: try again later.
From a label photo
POST /api/v1/check/photo with {"image": "<base64
JPEG or PNG>"}, at most 5 MB, plus any of the fields above that you
already know (they win over what is read). The label is read on our server;
the reply is a check, plus extracted (the fields read),
ocr_confidence and photo_kept, which is true only
when the store keeps label photos. When no brand or barcode can be read, the
answer is 422 with what was read, and nothing is counted.
Batch CSV uploads
On plans that include batch uploads, POST /api/v1/check/batch
takes a CSV file (content-type: text/csv) of up to 5,000 rows
and 2 MB, with a header row of these columns, in any order (add
?location_id= to the upload to file its checks under one of
the store's locations):
gtin,brand,model,description,category,manufacture_date,jurisdiction,sku
Rows are validated on upload, and the reply is 202 with
{id, rows_total, invalid, status_url}. Each valid row becomes a
counted check, worked through in the background; when the month's
allowance runs out, the remaining rows are marked limit.
GET /api/v1/check/batch/{id} gives progress and totals, and
GET /api/v1/check/batch/{id}/results.csv the result of every
row. Finished batches are kept for 30 days; their checks stay in the audit log.
The audit log and exports
GET /api/v1/lookups: the store's checks, newest first, withfromandto(UTC days, at most a year apart; this month by default),location,verdict,pageandlimit(up to 200).GET /api/v1/lookups/{id}: one check in full, and/api/v1/lookups/{id}/photoits label photo, if kept.GET /api/v1/lookups/export.csv(up to 50,000 rows) andexport.pdf(up to 5,000 rows) take the same filters.
The audit log can always be read and exported, whatever the plan, and also after a plan ends. Records are never changed or deleted.
Stock decisions
Record what the store did with a checked item, so that it can be checked again later:
POST /api/v1/inventorywith{lookup_id, status, sku?, override_reason?}, wherestatusisin_stockorrejected. An item answeredRECALLEDorDO_NOT_SELLcannot be taken into stock, and one answeredCHECKneedsoverride_reason, saying what was checked. A check has one decision.PATCH /api/v1/inventory/{id}moves an item fromin_stocktosoldorremoved, or fromremovedback toin_stock, and can change itssku.GET /api/v1/inventorylists items, bystatusandlocation.
On plans that include re-checks, items in stock are checked again when
the recall data or a rule changes; a new RECALLED or
DO_NOT_SELL is recorded in the audit log and sent to your
webhooks.
Webhooks
On plans that include webhooks, an owner adds up to five on the portal's Webhooks page: an HTTPS address on the public internet, and the events to send. The signing secret is shown once, when the webhook is created. The page can send a test delivery and lists the last 50 deliveries with their status.
| Event | Sent when | data |
|---|---|---|
inventory.recalled |
An item in stock is checked again and its answer becomes
RECALLED or DO_NOT_SELL. |
item (id, sku,
location_id), previous_verdict,
verdict, reason, product,
recalls, rules, sources,
data_as_of, lookup_id (the new check) and
original_lookup_id. |
batch.completed |
A batch upload has finished. | batch_id, totals and
results (the path of its results CSV). |
webhook.test |
An owner sends a test delivery. | Empty. |
Each delivery is a POST of
{"event": ..., "created_at": ..., "data": {...}} with these
headers:
user-agent: ResaleWarden-Webhooks/1.0 (+https://resalewarden.drbyte.org/support#webhooks)x-webhook-event: the event name;x-webhook-id: the same on every attempt to deliver one event, so use it to ignore a repeat;x-webhook-timestamp: seconds since 1970, when this attempt was signed;x-webhook-signature:sha256=and the hex HMAC-SHA256 of the timestamp, a full stop and the raw body, keyed with the webhook's secret.
Answer with any 2xx status within 10 seconds, and do the work
afterwards. Any other answer, a timeout or a refused connection is tried
again after 1, 2, 4, 8, 16, 32 and 64 minutes: 8 attempts in all, over about
two hours, and then the delivery is recorded as failed. Redirects are not
followed.
Checking a signature
Compute the signature over the raw body, exactly as received, compare it in constant time, and reject a timestamp more than five minutes from your clock. In Node.js:
import { createHmac, timingSafeEqual } from 'node:crypto';
export function verify(secret, timestamp, signature, rawBody) {
if (Math.abs(Date.now() / 1000 - Number(timestamp)) > 300) return false;
const mac = createHmac('sha256', secret).update(`${timestamp}.${rawBody}`).digest('hex');
const expected = Buffer.from(`sha256=${mac}`);
const given = Buffer.from(signature ?? '');
return given.length === expected.length && timingSafeEqual(given, expected);
}
In Python:
import hashlib, hmac, time
def verify(secret: str, timestamp: str, signature: str, raw_body: bytes) -> bool:
if abs(time.time() - int(timestamp)) > 300:
return False
mac = hmac.new(secret.encode(), timestamp.encode() + b"." + raw_body, hashlib.sha256)
return hmac.compare_digest(signature, "sha256=" + mac.hexdigest())
Limits
- Monthly checks: each plan includes a number of checks a
month. Over it, a check gets
429withplan,limit(monthly_checks) andallowance, and is neither recorded nor counted. Re-checks of stock are not counted. - Request rate: requests from one address are limited
per second and per minute; over the limit the answer is
429. Wait and retry with a growing delay; a batch upload is the way to check many items at once. - Plan features: starting a batch upload on a plan
without batch uploads, and adding or testing a webhook on a plan without
webhooks, is refused with
403, naming thefeatureand theplan. On a plan without re-checks, stock is simply not checked again, and without webhooks no new deliveries are queued; a webhook's settings are kept for when the plan includes it again.
Errors
Every error is JSON with a sentence in error that can be
shown to a person; some add fields, such as problems (a list,
for invalid input), feature and plan (a feature
outside the plan), or plan, limit and
allowance (an allowance used up).
{
"error": "gtin is not a valid barcode (8, 12, 13 or 14 digits with a correct check digit)",
"problems": ["gtin is not a valid barcode (8, 12, 13 or 14 digits with a correct check digit)"]
}
| Status | Meaning |
|---|---|
400 | The request is not valid; problems says why. |
401 | No key, or a key that is unknown, revoked or malformed, or belongs to a closed account. |
403 | The key's scopes do not allow this, or the plan does not include it (feature, plan). |
404 | No such route, or nothing with that id in this store. |
409 | The request conflicts with what is recorded, such as a second stock decision for one check. |
413 | Too large: a photo over 5 MB, a batch file over 2 MB or 5,000 rows, any other request body over 256 KB, a CSV export over 50,000 rows (export a shorter period), or a PDF export over 5,000 rows (use CSV). |
422 | A label photo from which no brand or barcode could be read. |
429 | The month's checks are used up, or too many requests too quickly. |
503 | Recall data or a needed service is unavailable for a moment; nothing was recorded. |
Help
Write to support@resalewarden.drbyte.org with the request, the time, the response and, never the full key, the first characters of the key you used.