{"openapi":"3.1.0","info":{"title":"Panlytics API","version":"1","description":"Read the figures of the shops an API key reaches, upload reports, manage suppliers and ask the assistant. A key acts as the person who made it, fenced: it can never manage people, roles, billing or keys, and it can never approve what the assistant proposes."},"jsonSchemaDialect":"https://json-schema.org/draft/2020-12/schema","servers":[{"url":"https://panlytics.net/api"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","description":"An API key made in Settings, Developer. It lives at most five hours."}}},"paths":{"/v1/me":{"get":{"operationId":"me","summary":"Who this key acts as, which company and shops it reaches, what it may do, and when it ends.","description":"The first call to make. It answers with the person who made the key, the company, the shops and categories the key reaches, the abilities it holds after the fence, and the moment it ends.","tags":["me"],"parameters":[],"responses":{"200":{"description":"Who this key acts as, which company and shops it reaches, what it may do, and when it ends.","content":{"application/json":{"schema":{"type":"object","properties":{"user":{"type":"object","properties":{"id":{"type":"number","description":"The maker's id."},"username":{"type":"string","description":"The maker's username."},"name":{"description":"The maker's full name, or null.","type":["string","null"]},"email":{"type":"string","description":"The maker's email address."}},"required":["id","username","name","email"],"additionalProperties":false,"description":"The person who made the key. The key acts as them, inside the fence."},"organization":{"type":"object","properties":{"id":{"type":"number","description":"The company's id."},"name":{"description":"The company's name.","type":"string"}},"required":["id"],"additionalProperties":false,"description":"The company the key works in."},"role":{"description":"\"CEO\", or the name of the maker's role in that company.","type":["string","null"]},"reach":{"type":"object","properties":{"allShops":{"type":"boolean","description":"True when the role covers every shop, including shops opened later."},"shops":{"type":"array","items":{"type":"object","properties":{"id":{"type":"number","description":"The shop's id."},"name":{"type":"string","description":"The shop's name."}},"required":["id","name"],"additionalProperties":false},"description":"Every shop the key reaches."},"categoryScoped":{"type":"boolean","description":"True when the role covers chosen categories of one shop rather than whole shops."},"categories":{"anyOf":[{"type":"array","items":{"type":"number"}},{"type":"null"}],"description":"The category ids a category-scoped role covers. Null otherwise."}},"required":["allShops","shops","categoryScoped","categories"],"additionalProperties":false,"description":"Which shops and categories the key reaches."},"abilities":{"type":"array","items":{"type":"string"},"description":"What the key may do after the fence, by id: figures, sheet, export, exceptions, agents, suppliers, brain, shops."},"fenced":{"type":"boolean","description":"Always true for a key: people, roles, the audit log and the developer settings stay out of its reach."},"key":{"type":"object","properties":{"id":{"type":"number","description":"The key's own id, as the Developer pages and the audit log show it."},"endsAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the key stops working, in UTC. Shortening the company's period moves it sooner."}},"required":["id","endsAt"],"additionalProperties":false,"description":"The key itself."}},"required":["user","organization","role","reach","abilities","fenced","key"],"additionalProperties":false},"example":{"user":{"id":7,"username":"anna","name":"Anna Virtanen","email":"anna@example.com"},"organization":{"id":3,"name":"Example Oy"},"role":"Manager","reach":{"allShops":false,"shops":[{"id":12,"name":"Harbour"}],"categoryScoped":false,"categories":null},"abilities":["figures","sheet","export","agents"],"fenced":true,"key":{"id":21,"endsAt":"2026-10-25T15:00:00.000Z"}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/organisation":{"get":{"operationId":"organisation.get","summary":"The company, the shops this key reaches, and its people where the key's maker may see them.","description":"People are listed by name and role name only, and only when the person who made the key may see people in the app. A key never reads an email address or a phone number here. Needs the figures ability.","tags":["organisation"],"parameters":[],"responses":{"200":{"description":"The company, the shops this key reaches, and its people where the key's maker may see them.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The company's id."},"name":{"type":"string","description":"The company's name."},"country":{"description":"The country the company is in, or null.","type":["string","null"]},"currency":{"type":"string","description":"The company's currency, as a three-letter code."},"shops":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The shop's id."},"name":{"type":"string","description":"What the shop is called, as people in the company say it."},"branch":{"type":"string","description":"The branch name, or empty."},"city":{"type":"string","description":"The city the shop is in."},"country":{"type":"string","description":"The country the shop is in, or empty."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the shop was made, in UTC."}},"required":["id","name","branch","city","country","createdAt"],"additionalProperties":false},"description":"The shops this key reaches."},"people":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The person's name."},"role":{"type":"string","description":"The name of their role."}},"required":["name","role"],"additionalProperties":false}},{"type":"null"}],"description":"Names and role names only, and only when the person who made the key may see people in the app. Never an email address or a phone number. Null otherwise."}},"required":["id","name","country","currency","shops","people"],"additionalProperties":false},"example":{"id":3,"name":"Example Oy","country":"Finland","currency":"EUR","shops":[{"id":12,"name":"Harbour","branch":"","city":"Helsinki","country":"Finland","createdAt":"2026-10-01T08:00:00.000Z"}],"people":[{"name":"Anna Virtanen","role":"Manager"}]}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/shops":{"get":{"operationId":"shops.list","summary":"The shops this key reaches, one page at a time.","description":"Every open shop of the company that the key's maker may see, oldest first. Needs the figures ability.","tags":["shops"],"parameters":[{"name":"cursor","in":"query","required":false,"description":"The `nextCursor` of the page before. Leave it out for the first page. Treat it as an opaque string.","schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"description":"How many rows on one page: 1 to 200, 50 when left out.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"The shops this key reaches, one page at a time.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The shop's id."},"name":{"type":"string","description":"What the shop is called, as people in the company say it."},"branch":{"type":"string","description":"The branch name, or empty."},"city":{"type":"string","description":"The city the shop is in."},"country":{"type":"string","description":"The country the shop is in, or empty."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the shop was made, in UTC."}},"required":["id","name","branch","city","country","createdAt"],"additionalProperties":false},"description":"The rows of this page."},"nextCursor":{"description":"Send it as `cursor` for the next page. Null on the last page.","type":["string","null"]},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many rows the whole list has."}},"required":["data","nextCursor","total"],"additionalProperties":false},"example":{"data":[{"id":12,"name":"Harbour","branch":"","city":"Helsinki","country":"Finland","createdAt":"2026-10-01T08:00:00.000Z"}],"nextCursor":null,"total":1}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}},"post":{"operationId":"shops.create","summary":"Open a new shop in the company.","description":"Needs the shops ability over every shop of the company, the rule the app keeps: a person limited to some shops cannot open one outside them. Send an Idempotency-Key header so a retry never opens the shop twice. Needs the shops ability.","tags":["shops"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Any string up to 255 characters, new for each new request. The same key with the same body within 24 hours answers with the first answer again and creates nothing; the same key with another body is refused with 409.","schema":{"type":"string","maxLength":255}}],"responses":{"201":{"description":"Open a new shop in the company.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The shop's id."},"name":{"type":"string","description":"What the shop is called, as people in the company say it."},"branch":{"type":"string","description":"The branch name, or empty."},"city":{"type":"string","description":"The city the shop is in."},"country":{"type":"string","description":"The country the shop is in, or empty."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the shop was made, in UTC."}},"required":["id","name","branch","city","country","createdAt"],"additionalProperties":false},"example":{"id":12,"name":"Harbour","branch":"","city":"Helsinki","country":"Finland","createdAt":"2026-10-01T08:00:00.000Z"}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you. `refused.demo`: This is a public demo, and that part is switched off.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh","refused.demo"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`api.idempotency_conflict`: That Idempotency-Key was already used for a different request. `api.idempotency_busy`: The first request with that Idempotency-Key is still running.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.idempotency_conflict","api.idempotency_busy"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"description":"What the shop is called, as people in the company say it."},"city":{"type":"string","minLength":1,"maxLength":120,"description":"The city the shop is in."},"branch":{"description":"The branch name, when the company has several shops of one name.","type":"string","maxLength":120},"country":{"description":"The country the shop is in.","type":"string","maxLength":120}},"required":["name","city"],"additionalProperties":false},"example":{"name":"Harbour","city":"Helsinki"}}}}}},"/v1/shops/{id}":{"get":{"operationId":"shops.get","summary":"One shop, with everything its own page shows: its names, its kind, its notes and where it stands.","description":"Answers 404 when the company has no open shop with that id, and 403 when it has one the key does not reach. An archived shop is listed by GET /v1/shops/archived. Needs the figures ability.","tags":["shops"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}}],"responses":{"200":{"description":"One shop, with everything its own page shows: its names, its kind, its notes and where it stands.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The shop's id."},"name":{"type":"string","description":"What the shop is called, as people in the company say it."},"branch":{"type":"string","description":"The branch name, or empty."},"city":{"type":"string","description":"The city the shop is in."},"country":{"type":"string","description":"The country the shop is in, or empty."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the shop was made, in UTC."},"givenName":{"type":"string","description":"The name the shop was opened under. Equal to `name` until somebody renames it."},"kind":{"type":"string","enum":["manual","shopify","netvisor"],"description":"What feeds the shop: manual (reports somebody uploads), shopify or netvisor."},"openToPublic":{"type":"boolean","description":"True for a shop people walk into, false for a warehouse or a stockroom."},"notes":{"type":"string","description":"Who shops here, in the company's own words, or empty."},"about":{"type":"string","description":"Anything else worth knowing about this shop, or empty."},"profile":{"description":"The short summary of the area around the shop, when it has been researched. Null otherwise.","type":["string","null"]},"place":{"anyOf":[{"type":"object","properties":{"label":{"type":"string","description":"The address as the map gave it."},"lat":{"type":"number","description":"Latitude."},"lon":{"type":"number","description":"Longitude."}},"required":["label","lat","lon"],"additionalProperties":false},{"type":"null"}],"description":"Where the shop stands on the map, when it has a pin. Null otherwise."},"archivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"A time in ISO 8601, in UTC."},{"type":"null"}],"description":"When the shop was archived, in UTC. Null for an open shop."}},"required":["id","name","branch","city","country","createdAt","givenName","kind","openToPublic","notes","about","profile","place","archivedAt"],"additionalProperties":false},"example":{"id":12,"name":"Harbour","givenName":"Harbour","branch":"","city":"Helsinki","country":"Finland","createdAt":"2026-10-01T08:00:00.000Z","kind":"manual","openToPublic":true,"notes":"Students from the campus nearby, and families at the weekend.","about":"A mid-sized grocery next to the ferry terminal.","profile":null,"place":{"label":"Satamakatu 1, Helsinki","lat":60.1675,"lon":24.9566},"archivedAt":null}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}},"patch":{"operationId":"shops.update","summary":"Rename a shop.","description":"Needs the shops ability over the shop, as the app's rename does. The name the shop was opened under is kept and answered as `givenName`, so a rename never loses the old name. Needs the shops ability.","tags":["shops"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}}],"responses":{"200":{"description":"Rename a shop.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The shop's id."},"name":{"type":"string","description":"What the shop is called, as people in the company say it."},"branch":{"type":"string","description":"The branch name, or empty."},"city":{"type":"string","description":"The city the shop is in."},"country":{"type":"string","description":"The country the shop is in, or empty."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the shop was made, in UTC."},"givenName":{"type":"string","description":"The name the shop was opened under. Equal to `name` until somebody renames it."},"kind":{"type":"string","enum":["manual","shopify","netvisor"],"description":"What feeds the shop: manual (reports somebody uploads), shopify or netvisor."},"openToPublic":{"type":"boolean","description":"True for a shop people walk into, false for a warehouse or a stockroom."},"notes":{"type":"string","description":"Who shops here, in the company's own words, or empty."},"about":{"type":"string","description":"Anything else worth knowing about this shop, or empty."},"profile":{"description":"The short summary of the area around the shop, when it has been researched. Null otherwise.","type":["string","null"]},"place":{"anyOf":[{"type":"object","properties":{"label":{"type":"string","description":"The address as the map gave it."},"lat":{"type":"number","description":"Latitude."},"lon":{"type":"number","description":"Longitude."}},"required":["label","lat","lon"],"additionalProperties":false},{"type":"null"}],"description":"Where the shop stands on the map, when it has a pin. Null otherwise."},"archivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"A time in ISO 8601, in UTC."},{"type":"null"}],"description":"When the shop was archived, in UTC. Null for an open shop."}},"required":["id","name","branch","city","country","createdAt","givenName","kind","openToPublic","notes","about","profile","place","archivedAt"],"additionalProperties":false},"example":{"id":12,"name":"Harbour Market","givenName":"Harbour","branch":"","city":"Helsinki","country":"Finland","createdAt":"2026-10-01T08:00:00.000Z","kind":"manual","openToPublic":true,"notes":"Students from the campus nearby, and families at the weekend.","about":"A mid-sized grocery next to the ferry terminal.","profile":null,"place":{"label":"Satamakatu 1, Helsinki","lat":60.1675,"lon":24.9566},"archivedAt":null}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you. `refused.demo`: This is a public demo, and that part is switched off.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh","refused.demo"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"description":"The name the company calls the shop now. The name it was opened under is kept as `givenName`."}},"required":["name"],"additionalProperties":false},"example":{"name":"Harbour Market"}}}}}},"/v1/shops/{id}/categories":{"get":{"operationId":"shops.categories","summary":"The categories of one shop, each with its newest report.","description":"A key whose maker is limited to chosen categories sees only those. Needs the figures ability.","tags":["shops"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}},{"name":"cursor","in":"query","required":false,"description":"The `nextCursor` of the page before. Leave it out for the first page. Treat it as an opaque string.","schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"description":"How many rows on one page: 1 to 200, 50 when left out.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"The categories of one shop, each with its newest report.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The category's id."},"shopId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The shop the category belongs to."},"name":{"type":"string","description":"The category's name, as people in the company say it."},"reportId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The newest report of this category. Its figures are the ones every endpoint answers with."},"products":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many products the newest report holds."},"uploadedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the newest report was uploaded, in UTC."},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the newest report or its settings last changed. Send it back as `updatedAt` on PATCH."}},"required":["id","shopId","name","reportId","products","uploadedAt","updatedAt"],"additionalProperties":false},"description":"The rows of this page."},"nextCursor":{"description":"Send it as `cursor` for the next page. Null on the last page.","type":["string","null"]},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many rows the whole list has."}},"required":["data","nextCursor","total"],"additionalProperties":false},"example":{"data":[{"id":40,"shopId":12,"name":"Beverages","reportId":311,"products":412,"uploadedAt":"2026-10-20T07:12:00.000Z","updatedAt":"2026-10-20T07:12:00.000Z"}],"nextCursor":null,"total":1}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/categories/{id}":{"get":{"operationId":"categories.get","summary":"One category, with the settings its figures are worked out with.","description":"The settings are the newest report's. Keep `updatedAt` to change them with PATCH. Needs the figures ability.","tags":["categories"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}}],"responses":{"200":{"description":"One category, with the settings its figures are worked out with.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The category's id."},"shopId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The shop the category belongs to."},"name":{"type":"string","description":"The category's name, as people in the company say it."},"reportId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The newest report of this category. Its figures are the ones every endpoint answers with."},"products":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many products the newest report holds."},"uploadedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the newest report was uploaded, in UTC."},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the newest report or its settings last changed. Send it back as `updatedAt` on PATCH."},"settings":{"type":"object","properties":{"periodDays":{"type":"number","description":"How many days the newest report covers."},"delTimeDs":{"type":"number","description":"Days until the next delivery, as the report's file says it."},"targetSto":{"type":"number","description":"How many times a year the stock should sell through, used to class products by sales."},"targetRoce":{"type":"number","description":"The return wanted on the money tied up in stock, used to class products by margin."},"co2PerWastePc":{"type":"number","description":"The CO2e of one wasted item, in kg."},"carbonTaxPerKgCo2":{"type":"number","description":"What one kg of CO2e costs, in euros."},"labourCostPerHour":{"type":"number","description":"What an hour of staff time costs, in euros."},"wasteHandlingMinPerPc":{"type":"number","description":"Minutes of staff time to handle one wasted item."},"orderEveryDs":{"type":"number","description":"Days between orders. 0 keeps what the report's file says."},"leadTimeDs":{"type":"number","description":"The days a delivery takes, for every product of the category. 0 keeps what the report's file says."},"shelfLifeDs":{"type":"number","description":"How many days a product keeps, for every product of the category. 0 keeps what the report's file says."},"demandNoisePhi":{"type":"number","description":"How much daily sales jump around: their variance divided by their mean. 1 is an even pace; groceries run near 3.3, which is used when this is 0."},"shelvingEurPerPc":{"type":"number","description":"What it costs to put one piece on the shelf, in euros. A wasted piece costs it twice."}},"required":["periodDays","delTimeDs","targetSto","targetRoce","co2PerWastePc","carbonTaxPerKgCo2","labourCostPerHour","wasteHandlingMinPerPc","orderEveryDs","leadTimeDs","shelfLifeDs","demandNoisePhi","shelvingEurPerPc"],"additionalProperties":false,"description":"The settings the category's figures are worked out with."}},"required":["id","shopId","name","reportId","products","uploadedAt","updatedAt","settings"],"additionalProperties":false},"example":{"id":40,"shopId":12,"name":"Beverages","reportId":311,"products":412,"uploadedAt":"2026-10-20T07:12:00.000Z","updatedAt":"2026-10-20T07:12:00.000Z","settings":{"periodDays":30,"delTimeDs":2,"targetSto":12,"targetRoce":0.3,"co2PerWastePc":0.5,"carbonTaxPerKgCo2":0,"labourCostPerHour":25,"wasteHandlingMinPerPc":1,"orderEveryDs":7,"leadTimeDs":2,"shelfLifeDs":0,"demandNoisePhi":1,"shelvingEurPerPc":0}}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`report.none`: There is no report open for this shop.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["report.none"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}},"patch":{"operationId":"categories.update","summary":"Rename a category, change the settings its figures use, or both.","description":"A new name needs the shops ability; settings need the sheet ability. Send the `updatedAt` you read, or the same time in an If-Unmodified-Since header, and the change is refused with 409 when somebody changed the category after it. After a change the figures are worked out again at once, as they are in the app. Needs the sheet ability, and shops where the description says so.","tags":["categories"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}},{"name":"If-Unmodified-Since","in":"header","required":false,"description":"The category's `updatedAt` as you read it. The change is refused with 409 when the category changed after it.","schema":{"type":"string"}}],"responses":{"200":{"description":"Rename a category, change the settings its figures use, or both.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The category's id."},"shopId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The shop the category belongs to."},"name":{"type":"string","description":"The category's name, as people in the company say it."},"reportId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The newest report of this category. Its figures are the ones every endpoint answers with."},"products":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many products the newest report holds."},"uploadedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the newest report was uploaded, in UTC."},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the newest report or its settings last changed. Send it back as `updatedAt` on PATCH."},"settings":{"type":"object","properties":{"periodDays":{"type":"number","description":"How many days the newest report covers."},"delTimeDs":{"type":"number","description":"Days until the next delivery, as the report's file says it."},"targetSto":{"type":"number","description":"How many times a year the stock should sell through, used to class products by sales."},"targetRoce":{"type":"number","description":"The return wanted on the money tied up in stock, used to class products by margin."},"co2PerWastePc":{"type":"number","description":"The CO2e of one wasted item, in kg."},"carbonTaxPerKgCo2":{"type":"number","description":"What one kg of CO2e costs, in euros."},"labourCostPerHour":{"type":"number","description":"What an hour of staff time costs, in euros."},"wasteHandlingMinPerPc":{"type":"number","description":"Minutes of staff time to handle one wasted item."},"orderEveryDs":{"type":"number","description":"Days between orders. 0 keeps what the report's file says."},"leadTimeDs":{"type":"number","description":"The days a delivery takes, for every product of the category. 0 keeps what the report's file says."},"shelfLifeDs":{"type":"number","description":"How many days a product keeps, for every product of the category. 0 keeps what the report's file says."},"demandNoisePhi":{"type":"number","description":"How much daily sales jump around: their variance divided by their mean. 1 is an even pace; groceries run near 3.3, which is used when this is 0."},"shelvingEurPerPc":{"type":"number","description":"What it costs to put one piece on the shelf, in euros. A wasted piece costs it twice."}},"required":["periodDays","delTimeDs","targetSto","targetRoce","co2PerWastePc","carbonTaxPerKgCo2","labourCostPerHour","wasteHandlingMinPerPc","orderEveryDs","leadTimeDs","shelfLifeDs","demandNoisePhi","shelvingEurPerPc"],"additionalProperties":false,"description":"The settings the category's figures are worked out with."}},"required":["id","shopId","name","reportId","products","uploadedAt","updatedAt","settings"],"additionalProperties":false},"example":{"id":40,"shopId":12,"name":"Beverages","reportId":311,"products":412,"uploadedAt":"2026-10-20T07:12:00.000Z","updatedAt":"2026-10-25T09:30:00.000Z","settings":{"periodDays":30,"delTimeDs":2,"targetSto":12,"targetRoce":0.3,"co2PerWastePc":0.5,"carbonTaxPerKgCo2":0,"labourCostPerHour":25,"wasteHandlingMinPerPc":1,"orderEveryDs":7,"leadTimeDs":3,"shelfLifeDs":0,"demandNoisePhi":1,"shelvingEurPerPc":0}}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you. `refused.demo`: This is a public demo, and that part is switched off.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh","refused.demo"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`report.none`: There is no report open for this shop. `api.stale`: This was changed after the time you sent.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["report.none","api.stale"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"description":"A new name, as people in the company say it.","type":"string","minLength":1,"maxLength":120},"settings":{"description":"Only the settings to change. Every value is a number of zero or more; periodDays is at least 1.","type":"object","properties":{"periodDays":{"description":"How many days the newest report covers.","type":"number","minimum":0},"delTimeDs":{"description":"Days until the next delivery, as the report's file says it.","type":"number","minimum":0},"targetSto":{"description":"How many times a year the stock should sell through, used to class products by sales.","type":"number","minimum":0},"targetRoce":{"description":"The return wanted on the money tied up in stock, used to class products by margin.","type":"number","minimum":0},"co2PerWastePc":{"description":"The CO2e of one wasted item, in kg.","type":"number","minimum":0},"carbonTaxPerKgCo2":{"description":"What one kg of CO2e costs, in euros.","type":"number","minimum":0},"labourCostPerHour":{"description":"What an hour of staff time costs, in euros.","type":"number","minimum":0},"wasteHandlingMinPerPc":{"description":"Minutes of staff time to handle one wasted item.","type":"number","minimum":0},"orderEveryDs":{"description":"Days between orders. 0 keeps what the report's file says.","type":"number","minimum":0},"leadTimeDs":{"description":"The days a delivery takes, for every product of the category. 0 keeps what the report's file says.","type":"number","minimum":0},"shelfLifeDs":{"description":"How many days a product keeps, for every product of the category. 0 keeps what the report's file says.","type":"number","minimum":0},"demandNoisePhi":{"description":"How much daily sales jump around: their variance divided by their mean. 1 is an even pace; groceries run near 3.3, which is used when this is 0.","type":"number","minimum":0},"shelvingEurPerPc":{"description":"What it costs to put one piece on the shelf, in euros. A wasted piece costs it twice.","type":"number","minimum":0}},"additionalProperties":false},"updatedAt":{"description":"The `updatedAt` you read. The change is refused with 409 when the category changed after it. The If-Unmodified-Since header does the same.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"additionalProperties":false},"example":{"settings":{"orderEveryDs":7,"leadTimeDs":3},"updatedAt":"2026-10-20T07:12:00.000Z"}}}}},"delete":{"operationId":"categories.delete","summary":"Delete a category and every report ever uploaded under it, for good.","description":"A hard delete, as in the app: the category, all of its reports and their original files are gone and cannot be brought back. Its suppliers stop delivering it. Needs the shops ability over the category's shop. Ask the person before you call this, and say what will be lost. Destructive: it cannot be undone, so an agent asks the person before it calls this. Needs the shops ability.","tags":["categories"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}}],"responses":{"200":{"description":"Delete a category and every report ever uploaded under it, for good.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean","const":true,"description":"Always true."},"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The category's id."},"reports":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many reports were deleted with it, original files included."},"shopEmpty":{"type":"boolean","description":"True when the shop has no report left at all."}},"required":["deleted","id","reports","shopEmpty"],"additionalProperties":false},"example":{"deleted":true,"id":40,"reports":6,"shopEmpty":false}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you. `refused.demo`: This is a public demo, and that part is switched off.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh","refused.demo"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}},"x-panlytics-destructive":true}},"/v1/shops/{id}/reports":{"post":{"operationId":"reports.upload","summary":"Upload a report: the first of a new category, or the next report of one.","description":"Multipart form data with a `file` (.csv or .xlsx, at most 8 MB) and either `category`, the name of a new category, with `periodDays`, or `categoryId` for the next report of a category. The file goes through exactly the checks and the pipeline the app's own upload does, and the upload is written to the audit log. Demo accounts cannot upload. Send an Idempotency-Key header so a retry never files the report twice. Needs the sheet ability.","tags":["shops"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Any string up to 255 characters, new for each new request. The same key with the same body within 24 hours answers with the first answer again and creates nothing; the same key with another body is refused with 409.","schema":{"type":"string","maxLength":255}}],"responses":{"201":{"description":"Upload a report: the first of a new category, or the next report of one.","content":{"application/json":{"schema":{"type":"object","properties":{"reportId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The new report's id."},"categoryId":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The category the report was filed under."},"shopId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The shop the report belongs to."},"newCategory":{"type":"boolean","description":"True when this report started a new category."},"rows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many product rows were read from the file."},"deduplicated":{"type":"boolean","description":"True when this exact file was uploaded before. It was worked out again and stored once."}},"required":["reportId","categoryId","shopId","newCategory","rows","deduplicated"],"additionalProperties":false},"example":{"reportId":311,"categoryId":40,"shopId":12,"newCategory":true,"rows":412,"deduplicated":false}}}},"400":{"description":"`api.invalid`: The field is missing or not valid. `upload.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid","upload.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you. `refused.demo`: This is a public demo, and that part is switched off.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh","refused.demo"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`report.none`: There is no report open for this shop. `api.idempotency_conflict`: That Idempotency-Key was already used for a different request. `api.idempotency_busy`: The first request with that Idempotency-Key is still running.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["report.none","api.idempotency_conflict","api.idempotency_busy"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"413":{"description":"`upload.too_large`: That file is too big to upload.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["upload.too_large"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"422":{"description":"`form.field`:  `upload.unreadable`: That file could not be read.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["form.field","upload.unreadable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","description":"The file, as .csv or .xlsx."},"category":{"description":"The name of a NEW category this report starts.","type":"string","minLength":1,"maxLength":120},"categoryId":{"description":"The category this report is the next report of.","type":"integer","exclusiveMinimum":0,"maximum":2147483647},"periodDays":{"description":"How many days the report covers. Needed for a new category; a next report keeps its category's period when left out.","type":"integer","minimum":1,"maximum":3650}}}}}}}},"/v1/categories/{id}/reorder-points":{"get":{"operationId":"categories.reorderPoints","summary":"Per product: the reorder point, what to order when it is reached, and the days of stock left.","description":"The products whose reorder point should change, worked out from the category's newest report and sorted by the sales they lose first. `q` searches it and `sort` orders it, as the app's Actions page does. `?format=csv` answers the whole list with the columns of the app's download; that needs the export ability and is written to the audit log. Needs the figures ability, and export where the description says so.","tags":["categories"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}},{"name":"cursor","in":"query","required":false,"description":"The `nextCursor` of the page before. Leave it out for the first page. Treat it as an opaque string.","schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"description":"How many rows on one page: 1 to 200, 50 when left out.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"format","in":"query","required":false,"description":"`csv` answers the whole list as one CSV file, with the columns the app's own download has. Paging, `q` and `sort` are ignored then.","schema":{"default":"json","type":"string","enum":["json","csv"]}},{"name":"q","in":"query","required":false,"description":"Only the products whose name (in any case) or id contains this. Leave it out for all of them.","schema":{"type":"string","maxLength":120}},{"name":"sort","in":"query","required":false,"description":"The order, as the app's list headings sort it: default is the list's own order; the others sort by sales, margin, the reorder point now, the new reorder point or the quantity, Desc for largest first and Asc for smallest first.","schema":{"default":"default","type":"string","enum":["default","salesDesc","salesAsc","marginDesc","marginAsc","ropNowDesc","ropNowAsc","ropNewDesc","ropNewAsc","qtyDesc","qtyAsc"]}}],"responses":{"200":{"description":"Per product: the reorder point, what to order when it is reached, and the days of stock left.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"ean":{"type":"string","description":"The product's id in the shop's own system, usually its barcode (EAN)."},"name":{"type":"string","description":"The product's name."},"class":{"type":"string","description":"The sales class, A to D."},"reorderPointNow":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The reorder point the report gave: the level that triggers a new order today."},"newReorderPoint":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The reorder point Panlytics works out."},"change":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The new reorder point minus the one the report gave."},"orderPcs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How much to order when the level is reached, in whole pieces."},"packSize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many pieces come in one pack."},"stockPcs":{"type":"number","description":"What the shop holds now, across its locations."},"daysOfStockLeft":{"description":"Days of stock left at the pace the report measured. Null when the product sold nothing.","type":["number","null"]},"salesEur":{"type":"number","description":"Sales over the report's period, in euros."},"marginEur":{"type":"number","description":"Profit on each sale, summed over the report."},"reason":{"type":"string","description":"Why the level changes, in one sentence."},"keptByHand":{"type":"boolean","description":"True when a person fixed this level as an exception."}},"required":["ean","name","class","reorderPointNow","newReorderPoint","change","orderPcs","packSize","stockPcs","daysOfStockLeft","salesEur","marginEur","reason","keptByHand"],"additionalProperties":false},"description":"The rows of this page."},"nextCursor":{"description":"Send it as `cursor` for the next page. Null on the last page.","type":["string","null"]},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many rows the whole list has."}},"required":["data","nextCursor","total"],"additionalProperties":false},"example":{"data":[{"ean":"6410000000017","name":"Sparkling water 0.5 l","class":"A","reorderPointNow":12,"newReorderPoint":18,"change":6,"orderPcs":24,"packSize":24,"stockPcs":9,"daysOfStockLeft":1.5,"salesEur":1840.5,"marginEur":610.2,"reason":"Ran out on 3 days and lost sales.","keptByHand":false}],"nextCursor":null,"total":1}},"text/csv":{"schema":{"type":"string"}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you. `refused.demo`: This is a public demo, and that part is switched off.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh","refused.demo"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`report.none`: There is no report open for this shop.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["report.none"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/categories/{id}/order-list":{"get":{"operationId":"categories.orderList","summary":"What to order now: every product at or under its reorder point.","description":"The same list as Order now in the app, best sellers first. `q` searches it and `sort` orders it, as the app's Actions page does. `?format=csv` answers the whole list with the columns of the app's download; that needs the export ability and is written to the audit log. Needs the figures ability, and export where the description says so.","tags":["categories"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}},{"name":"cursor","in":"query","required":false,"description":"The `nextCursor` of the page before. Leave it out for the first page. Treat it as an opaque string.","schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"description":"How many rows on one page: 1 to 200, 50 when left out.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"format","in":"query","required":false,"description":"`csv` answers the whole list as one CSV file, with the columns the app's own download has. Paging, `q` and `sort` are ignored then.","schema":{"default":"json","type":"string","enum":["json","csv"]}},{"name":"q","in":"query","required":false,"description":"Only the products whose name (in any case) or id contains this. Leave it out for all of them.","schema":{"type":"string","maxLength":120}},{"name":"sort","in":"query","required":false,"description":"The order, as the app's list headings sort it: default is the list's own order; the others sort by sales, margin, the reorder point now, the new reorder point or the quantity, Desc for largest first and Asc for smallest first.","schema":{"default":"default","type":"string","enum":["default","salesDesc","salesAsc","marginDesc","marginAsc","ropNowDesc","ropNowAsc","ropNewDesc","ropNewAsc","qtyDesc","qtyAsc"]}}],"responses":{"200":{"description":"What to order now: every product at or under its reorder point.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"ean":{"type":"string","description":"The product's id in the shop's own system, usually its barcode (EAN)."},"name":{"type":"string","description":"The product's name."},"class":{"type":"string","description":"The sales class, A to D."},"orderPcs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How much to order, in whole pieces."},"packSize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many pieces come in one pack."},"orderValueEur":{"type":"number","description":"What the order costs, in euros."},"stockPcs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"What the shop holds now, in pieces."},"reorderPoint":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The level the stock is at or under."},"salesEur":{"type":"number","description":"Sales over the report's period, in euros."},"marginEur":{"type":"number","description":"Profit on the sales over the report's period, in euros."}},"required":["ean","name","class","orderPcs","packSize","orderValueEur","stockPcs","reorderPoint","salesEur","marginEur"],"additionalProperties":false},"description":"The rows of this page."},"nextCursor":{"description":"Send it as `cursor` for the next page. Null on the last page.","type":["string","null"]},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many rows the whole list has."}},"required":["data","nextCursor","total"],"additionalProperties":false},"example":{"data":[{"ean":"6410000000017","name":"Sparkling water 0.5 l","class":"A","orderPcs":48,"packSize":24,"orderValueEur":19.2,"stockPcs":6,"reorderPoint":18,"salesEur":1840.5,"marginEur":610.2}],"nextCursor":null,"total":1}},"text/csv":{"schema":{"type":"string"}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you. `refused.demo`: This is a public demo, and that part is switched off.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh","refused.demo"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`report.none`: There is no report open for this shop.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["report.none"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/categories/{id}/stop-stocking":{"get":{"operationId":"categories.stopStocking","summary":"The products worth no longer stocking, most money tied up first.","description":"A product a person marked Never stop stocking is not on the list. `q` searches it and `sort` orders it, as the app's Actions page does. `?format=csv` answers the whole list with the columns of the app's download; that needs the export ability and is written to the audit log. Needs the figures ability, and export where the description says so.","tags":["categories"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}},{"name":"cursor","in":"query","required":false,"description":"The `nextCursor` of the page before. Leave it out for the first page. Treat it as an opaque string.","schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"description":"How many rows on one page: 1 to 200, 50 when left out.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"format","in":"query","required":false,"description":"`csv` answers the whole list as one CSV file, with the columns the app's own download has. Paging, `q` and `sort` are ignored then.","schema":{"default":"json","type":"string","enum":["json","csv"]}},{"name":"q","in":"query","required":false,"description":"Only the products whose name (in any case) or id contains this. Leave it out for all of them.","schema":{"type":"string","maxLength":120}},{"name":"sort","in":"query","required":false,"description":"The order, as the app's list headings sort it: default is the list's own order; the others sort by sales, margin, the reorder point now, the new reorder point or the quantity, Desc for largest first and Asc for smallest first.","schema":{"default":"default","type":"string","enum":["default","salesDesc","salesAsc","marginDesc","marginAsc","ropNowDesc","ropNowAsc","ropNewDesc","ropNewAsc","qtyDesc","qtyAsc"]}}],"responses":{"200":{"description":"The products worth no longer stocking, most money tied up first.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"ean":{"type":"string","description":"The product's id in the shop's own system, usually its barcode (EAN)."},"name":{"type":"string","description":"The product's name."},"salesEur":{"type":"number","description":"Sales over the report's period, in euros."},"marginEur":{"type":"number","description":"Profit on the sales over the report's period, in euros."},"wasteEur":{"type":"number","description":"What was thrown away over the report's period, in euros."},"stockEur":{"type":"number","description":"The money tied up in its stock now."}},"required":["ean","name","salesEur","marginEur","wasteEur","stockEur"],"additionalProperties":false},"description":"The rows of this page."},"nextCursor":{"description":"Send it as `cursor` for the next page. Null on the last page.","type":["string","null"]},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many rows the whole list has."}},"required":["data","nextCursor","total"],"additionalProperties":false},"example":{"data":[{"ean":"6410000000093","name":"Tonic water 1 l","salesEur":12.4,"marginEur":3.1,"wasteEur":8.9,"stockEur":41.6}],"nextCursor":null,"total":1}},"text/csv":{"schema":{"type":"string"}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you. `refused.demo`: This is a public demo, and that part is switched off.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh","refused.demo"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`report.none`: There is no report open for this shop.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["report.none"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/categories/{id}/recompute":{"post":{"operationId":"categories.recompute","summary":"Work a category's summary figures out again and answer with them.","description":"You rarely need this. Every figure the API answers with is worked out when you read it, from the newest report, its settings, the suppliers and the exceptions as they are at that moment. This call refreshes the stored summary the app's shop page shows and forgets this report's cached model, then answers with the fresh summary. Needs the figures ability.","tags":["categories"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}}],"responses":{"200":{"description":"Work a category's summary figures out again and answer with them.","content":{"application/json":{"schema":{"type":"object","properties":{"categoryId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The category the figures are for."},"reportId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The report the figures were worked out from."},"salesEur":{"type":"number","description":"Sales over the report's period, in euros."},"missedSalesEur":{"type":"number","description":"Sales you missed: what people came for while the shelf was empty."},"wasteEur":{"type":"number","description":"What was thrown away over the report's period, in euros."},"computedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When these figures were worked out, in UTC."}},"required":["categoryId","reportId","salesEur","missedSalesEur","wasteEur","computedAt"],"additionalProperties":false},"example":{"categoryId":40,"reportId":311,"salesEur":48210.5,"missedSalesEur":1310.2,"wasteEur":420.75,"computedAt":"2026-10-25T09:31:00.000Z"}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`report.none`: There is no report open for this shop.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["report.none"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/shops/{id}/suppliers":{"get":{"operationId":"suppliers.list","summary":"Who delivers to one shop, and the days a delivery takes from each.","description":"A key whose maker is limited to chosen categories sees no suppliers, as in the app. Needs the figures ability.","tags":["shops"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}},{"name":"cursor","in":"query","required":false,"description":"The `nextCursor` of the page before. Leave it out for the first page. Treat it as an opaque string.","schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"description":"How many rows on one page: 1 to 200, 50 when left out.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"Who delivers to one shop, and the days a delivery takes from each.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The supplier's id."},"shopId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The shop the supplier delivers to."},"name":{"type":"string","description":"The supplier's name."},"leadTimeDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The days a delivery takes from this supplier."},"categoryIds":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"The categories this supplier delivers."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the supplier was added, in UTC."},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the supplier last changed, in UTC."}},"required":["id","shopId","name","leadTimeDays","categoryIds","createdAt","updatedAt"],"additionalProperties":false},"description":"The rows of this page."},"nextCursor":{"description":"Send it as `cursor` for the next page. Null on the last page.","type":["string","null"]},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many rows the whole list has."}},"required":["data","nextCursor","total"],"additionalProperties":false},"example":{"data":[{"id":5,"shopId":12,"name":"Example Wholesale","leadTimeDays":2,"categoryIds":[40],"createdAt":"2026-10-01T08:00:00.000Z","updatedAt":"2026-10-01T08:00:00.000Z"}],"nextCursor":null,"total":1}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}},"post":{"operationId":"suppliers.create","summary":"Add a supplier to one shop.","description":"The days a delivery takes from this supplier replace the category's own setting once the supplier is given that category. A name may be used once per shop. Send an Idempotency-Key header so a retry never adds the supplier twice. Needs the suppliers ability.","tags":["shops"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Any string up to 255 characters, new for each new request. The same key with the same body within 24 hours answers with the first answer again and creates nothing; the same key with another body is refused with 409.","schema":{"type":"string","maxLength":255}}],"responses":{"201":{"description":"Add a supplier to one shop.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The supplier's id."},"shopId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The shop the supplier delivers to."},"name":{"type":"string","description":"The supplier's name."},"leadTimeDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The days a delivery takes from this supplier."},"categoryIds":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"The categories this supplier delivers."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the supplier was added, in UTC."},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the supplier last changed, in UTC."}},"required":["id","shopId","name","leadTimeDays","categoryIds","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":5,"shopId":12,"name":"Example Wholesale","leadTimeDays":2,"categoryIds":[],"createdAt":"2026-10-25T09:00:00.000Z","updatedAt":"2026-10-25T09:00:00.000Z"}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you. `refused.demo`: This is a public demo, and that part is switched off.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh","refused.demo"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`conflict.said`:  `api.idempotency_conflict`: That Idempotency-Key was already used for a different request. `api.idempotency_busy`: The first request with that Idempotency-Key is still running.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["conflict.said","api.idempotency_conflict","api.idempotency_busy"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"description":"The supplier's name, unique in the shop."},"leadTimeDays":{"type":"integer","minimum":0,"maximum":365,"description":"The days a delivery takes, 0 to 365."}},"required":["name","leadTimeDays"],"additionalProperties":false},"example":{"name":"Example Wholesale","leadTimeDays":2}}}}}},"/v1/suppliers/{id}":{"patch":{"operationId":"suppliers.update","summary":"Rename a supplier or change the days a delivery takes from it.","description":"Send only what changes. The figures of the categories it delivers change at once. Needs the suppliers ability.","tags":["suppliers"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}}],"responses":{"200":{"description":"Rename a supplier or change the days a delivery takes from it.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The supplier's id."},"shopId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The shop the supplier delivers to."},"name":{"type":"string","description":"The supplier's name."},"leadTimeDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The days a delivery takes from this supplier."},"categoryIds":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"The categories this supplier delivers."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the supplier was added, in UTC."},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the supplier last changed, in UTC."}},"required":["id","shopId","name","leadTimeDays","categoryIds","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":5,"shopId":12,"name":"Example Wholesale","leadTimeDays":3,"categoryIds":[40],"createdAt":"2026-10-01T08:00:00.000Z","updatedAt":"2026-10-25T09:00:00.000Z"}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you. `refused.demo`: This is a public demo, and that part is switched off.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh","refused.demo"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`conflict.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["conflict.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120,"description":"The supplier's name, unique in the shop."},"leadTimeDays":{"type":"integer","minimum":0,"maximum":365,"description":"The days a delivery takes, 0 to 365."}},"additionalProperties":false},"example":{"leadTimeDays":3}}}}},"delete":{"operationId":"suppliers.delete","summary":"Remove a supplier from its shop.","description":"The categories it delivered go back to their own settings for the days a delivery takes. The supplier is deleted for good, as it is in the app: ask the person before you call this. Destructive: it cannot be undone, so an agent asks the person before it calls this. Needs the suppliers ability.","tags":["suppliers"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}}],"responses":{"200":{"description":"Remove a supplier from its shop.","content":{"application/json":{"schema":{"type":"object","properties":{"deleted":{"type":"boolean","const":true,"description":"Always true."},"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The id of what was removed."}},"required":["deleted","id"],"additionalProperties":false},"example":{"deleted":true,"id":5}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you. `refused.demo`: This is a public demo, and that part is switched off.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh","refused.demo"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}},"x-panlytics-destructive":true}},"/v1/suppliers/{id}/categories":{"put":{"operationId":"suppliers.categories","summary":"Set which categories of its shop a supplier delivers.","description":"The list replaces the one before. Every id must be a category of the supplier's own shop. Needs the suppliers ability.","tags":["suppliers"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}}],"responses":{"200":{"description":"Set which categories of its shop a supplier delivers.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The supplier's id."},"shopId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The shop the supplier delivers to."},"name":{"type":"string","description":"The supplier's name."},"leadTimeDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The days a delivery takes from this supplier."},"categoryIds":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"The categories this supplier delivers."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the supplier was added, in UTC."},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the supplier last changed, in UTC."}},"required":["id","shopId","name","leadTimeDays","categoryIds","createdAt","updatedAt"],"additionalProperties":false},"example":{"id":5,"shopId":12,"name":"Example Wholesale","leadTimeDays":2,"categoryIds":[40,41],"createdAt":"2026-10-01T08:00:00.000Z","updatedAt":"2026-10-25T09:00:00.000Z"}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you. `refused.demo`: This is a public demo, and that part is switched off.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh","refused.demo"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"categoryIds":{"maxItems":2000,"type":"array","items":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647},"description":"Every category this supplier delivers. The list replaces the one before."}},"required":["categoryIds"],"additionalProperties":false},"example":{"categoryIds":[40,41]}}}}}},"/v1/chat":{"post":{"operationId":"chat.start","summary":"Ask Panlytics a question about a shop. The answer comes back as a run.","description":"Starts the same assistant the app has, counted against the shop's daily AI budget and the limit of 30 runs an hour per person. Read the run with GET /v1/runs/{id}, or follow it with GET /v1/runs/{id}/stream. Anything the assistant proposes to do waits for a person to approve it in the app: a key can never approve it. Send an Idempotency-Key header so a retry never starts a second run. Needs the agents ability.","tags":["chat"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Any string up to 255 characters, new for each new request. The same key with the same body within 24 hours answers with the first answer again and creates nothing; the same key with another body is refused with 409.","schema":{"type":"string","maxLength":255}}],"responses":{"201":{"description":"Ask Panlytics a question about a shop. The answer comes back as a run.","content":{"application/json":{"schema":{"type":"object","properties":{"runId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The run's id. Read it with GET /v1/runs/{id}."},"threadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The conversation the run belongs to. Send it as `threadId` to ask a follow-up."},"status":{"type":"string","const":"queued","description":"Always queued: the run has been handed to the engine."}},"required":["runId","threadId","status"],"additionalProperties":false},"example":{"runId":"6f1c2b9e-2d4f-4f7e-9a51-0c3b8e7d1a20","threadId":"0b9e4a3c-71d2-4c55-8f0e-3a6d2b1c9e47","status":"queued"}}}},"400":{"description":"`api.invalid`: The field is missing or not valid. `bad_request.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid","bad_request.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you. `refused.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh","refused.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`report.none`: There is no report open for this shop. `store.none`: No shop is open in this session. `conflict.said`:  `api.idempotency_conflict`: That Idempotency-Key was already used for a different request. `api.idempotency_busy`: The first request with that Idempotency-Key is still running.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["report.none","store.none","conflict.said","api.idempotency_conflict","api.idempotency_busy"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute. `api.ai_budget`: This shop has used today's assistant budget. `net.rate_limited`: That was asked for too many times.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited","api.ai_budget","net.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet. `agent.unreachable`: The assistant is not answering right now.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable","agent.unreachable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"shopId":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647,"description":"The shop the question is about. Its daily AI budget pays for the run."},"prompt":{"type":"string","minLength":1,"maxLength":4000,"description":"The question, in plain words."},"categoryId":{"description":"A category of that shop, to ask about its newest report.","type":"integer","exclusiveMinimum":0,"maximum":2147483647},"threadId":{"description":"A conversation to continue: any conversation in the company that the key's maker may open.","type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},"required":["shopId","prompt"],"additionalProperties":false},"example":{"shopId":12,"prompt":"Which drinks ran out most often last month?"}}}}}},"/v1/runs/{id}":{"get":{"operationId":"runs.get","summary":"One run: its state, its answer, and the proposals that wait for a person.","description":"A run this key's maker started, in the app or with any key. Poll it every few seconds until the status is done, failed or cancelled. Needs the agents ability.","tags":["runs"],"parameters":[{"name":"id","in":"path","required":true,"description":"The run's id, as POST /v1/chat answered it.","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}],"responses":{"200":{"description":"One run: its state, its answer, and the proposals that wait for a person.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The run's id."},"threadId":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$","description":"The conversation the run belongs to."},"status":{"type":"string","enum":["queued","running","awaiting_approval","done","failed","cancelled"],"description":"Where the run stands. done, failed and cancelled are final."},"answer":{"description":"The assistant's answer. Null until it has one.","type":["string","null"]},"error":{"anyOf":[{"type":"object","properties":{"code":{"type":"string","description":"A stable code from the Errors page."},"error":{"type":"string","description":"The code's sentence."}},"required":["code","error"],"additionalProperties":false},{"type":"null"}],"description":"Why the run did not finish, as a code and its sentence."},"steps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many steps the run has taken."},"costEur":{"type":"number","description":"What the run has spent of the shop's AI budget, in euros."},"startedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the run started, in UTC."},"endedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"A time in ISO 8601, in UTC."},{"type":"null"}],"description":"When the run ended, in UTC. Null while it runs."},"waitingForPerson":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The proposal's id."},"tool":{"type":"string","description":"What the assistant proposes to do."},"reason":{"description":"Why, in the assistant's words, or null.","type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When it was proposed, in UTC."}},"required":["id","tool","reason","createdAt"],"additionalProperties":false},"description":"Proposals that wait for a person to approve them in the app. A key can never approve them."}},"required":["id","threadId","status","answer","error","steps","costEur","startedAt","endedAt","waitingForPerson"],"additionalProperties":false},"example":{"id":"6f1c2b9e-2d4f-4f7e-9a51-0c3b8e7d1a20","threadId":"0b9e4a3c-71d2-4c55-8f0e-3a6d2b1c9e47","status":"done","answer":"Sparkling water ran out on 3 days.","error":null,"steps":2,"costEur":0.004,"startedAt":"2026-10-25T09:00:00.000Z","endedAt":"2026-10-25T09:00:09.000Z","waitingForPerson":[]}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/runs/{id}/stream":{"get":{"operationId":"runs.stream","summary":"Follow one run live, as server-sent events.","description":"The same events the app's own conversation reads: `state` first, then `delta` for text as it is written, `event` for each step, and `ended` last. Each event is one JSON object on a `data:` line. Reconnect with `?from=` set to the last offset you saw and nothing is missed. The stream closes when the run ends or the key ends; a key that is revoked stops its runs too, within one 15 second ping. One key keeps at most 3 streams open at once: a fourth answers 429 with Retry-After. Needs the agents ability.","tags":["runs"],"parameters":[{"name":"id","in":"path","required":true,"description":"The run's id, as POST /v1/chat answered it.","schema":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}},{"name":"from","in":"query","required":false,"description":"The offset to start from.","schema":{"type":"integer","minimum":0,"maximum":9007199254740991}}],"responses":{"200":{"description":"Follow one run live, as server-sent events.","content":{"text/event-stream":{"schema":{"type":"string"},"example":"data: {\"t\":\"state\",\"status\":\"running\",\"code\":null}\n\n"}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute. `net.rate_limited`: That was asked for too many times.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited","net.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/agent-sign-in-links":{"post":{"operationId":"agentSignInLinks.create","summary":"A one-time link that signs you in to the app as the person who made the key, in a browser profile nobody else is signed in to.","description":"Works only when the CEO has switched on letting an AI sign in to the app. The link works once, within 60 seconds, and only when pasted into the address bar: a link followed from another site is refused. The session it opens is marked as an AI's, never reaches the company's security, billing, data, people, roles, audit log or AI budgets, never approves anything, and ends when the key ends. Six links an hour per person.","tags":["agent-sign-in-links"],"parameters":[],"responses":{"201":{"description":"A one-time link that signs you in to the app as the person who made the key, in a browser profile nobody else is signed in to.","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string","description":"The link. Open it once, within 60 seconds, by pasting it into the address bar of a browser profile nobody else is signed in to."},"expiresAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the link stops working, in UTC: 60 seconds after it was made."}},"required":["url","expiresAt"],"additionalProperties":false},"example":{"url":"https://panlytics.net/agent-sign-in#t=Q2xhdWRlLWV4YW1wbGUtdG9rZW4tbm90LXJlYWwtMDAw","expiresAt":"2026-10-25T09:01:00.000Z"}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you. `agent.sign_in_off`: Letting an AI sign in to the app is switched off for this company.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh","agent.sign_in_off"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute. `agent.links_limit`: This key's maker has asked for six sign-in links in the last hour.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited","agent.links_limit"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/shops/archived":{"get":{"operationId":"shops.archived","summary":"The archived shops this key reaches, newest archive first.","description":"An archived shop leaves every list, the figures and the agents, and keeps its reports and history. Restore one with POST /v1/shops/{id}/restore. Needs the figures ability.","tags":["shops"],"parameters":[{"name":"cursor","in":"query","required":false,"description":"The `nextCursor` of the page before. Leave it out for the first page. Treat it as an opaque string.","schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"description":"How many rows on one page: 1 to 200, 50 when left out.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"The archived shops this key reaches, newest archive first.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The shop's id."},"name":{"type":"string","description":"What the shop is called."},"branch":{"type":"string","description":"The branch name, or empty."},"city":{"type":"string","description":"The city the shop is in."},"country":{"type":"string","description":"The country the shop is in, or empty."},"kind":{"type":"string","enum":["manual","shopify","netvisor"],"description":"What feeds the shop: manual (reports somebody uploads), shopify or netvisor."},"archivedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the shop was archived, in UTC."},"lastReport":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"A time in ISO 8601, in UTC."},{"type":"null"}],"description":"When a report was last read for it, in UTC, or null."}},"required":["id","name","branch","city","country","kind","archivedAt","lastReport"],"additionalProperties":false},"description":"The rows of this page."},"nextCursor":{"description":"Send it as `cursor` for the next page. Null on the last page.","type":["string","null"]},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many rows the whole list has."}},"required":["data","nextCursor","total"],"additionalProperties":false},"example":{"data":[{"id":14,"name":"Old Harbour","branch":"","city":"Kotka","country":"Finland","kind":"manual","archivedAt":"2026-10-20T08:00:00.000Z","lastReport":"2026-09-30T07:00:00.000Z"}],"nextCursor":null,"total":1}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/shops/{id}/archive":{"post":{"operationId":"shops.archive","summary":"Archive a shop: it leaves every list and keeps its reports and history.","description":"Needs the shops ability over the shop. The company's last open shop cannot be archived, and an archived shop answers 409. Bring it back with POST /v1/shops/{id}/restore. Needs the shops ability.","tags":["shops"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}}],"responses":{"200":{"description":"Archive a shop: it leaves every list and keeps its reports and history.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The shop's id."},"archived":{"type":"boolean","description":"True when the shop is now archived, false when it is open again."}},"required":["id","archived"],"additionalProperties":false},"example":{"id":12,"archived":true}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you. `refused.demo`: This is a public demo, and that part is switched off.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh","refused.demo"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`conflict.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["conflict.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/shops/{id}/restore":{"post":{"operationId":"shops.restore","summary":"Open an archived shop again.","description":"Needs the shops ability over the shop. A shop that is not archived answers 409. Needs the shops ability.","tags":["shops"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}}],"responses":{"200":{"description":"Open an archived shop again.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The shop's id."},"archived":{"type":"boolean","description":"True when the shop is now archived, false when it is open again."}},"required":["id","archived"],"additionalProperties":false},"example":{"id":12,"archived":false}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you. `refused.demo`: This is a public demo, and that part is switched off.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh","refused.demo"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`conflict.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["conflict.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/categories/{id}/summary":{"get":{"operationId":"categories.summary","summary":"The top of a category's Report page: its headline figures, where the money is, and how long each list of things to do is.","description":"Worked out from the category's newest report when you read it, as the app's Report page is. The three counts under `toDo` are the lengths of the reorder points, order now and stop stocking lists. Needs the figures ability.","tags":["categories"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}}],"responses":{"200":{"description":"The top of a category's Report page: its headline figures, where the money is, and how long each list of things to do is.","content":{"application/json":{"schema":{"type":"object","properties":{"categoryId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The category."},"reportId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The report the figures were worked out from: the category's newest."},"periodDays":{"type":"number","description":"How many days the report covers."},"headline":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"A stable name for the figure."},"label":{"type":"string","description":"What the Report page calls it."},"value":{"type":"number","description":"The figure now."},"unit":{"type":"string","description":"The unit: eur, pcs, kg, hours, days, ratio or count."},"expected":{"description":"What the figure becomes at Panlytics' reorder points, or null.","type":["number","null"]},"delta":{"description":"`expected` minus `value`, or null.","type":["number","null"]},"higherIsBetter":{"type":"boolean","description":"True when a higher figure is the better one."}},"required":["key","label","value","unit","expected","delta","higherIsBetter"],"additionalProperties":false},"description":"The headline figures, as the top of the Report page shows them."},"gains":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"A stable name for the gain."},"label":{"type":"string","description":"What the Report page calls it."},"valueEur":{"type":"number","description":"The profit, in euros, over the report's period."},"caption":{"type":"string","description":"One sentence about it, as the Report page says it."}},"required":["key","label","valueEur","caption"],"additionalProperties":false},"description":"Where the money is, line by line."},"lossMakers":{"type":"object","properties":{"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many products sold at a loss."},"drainEur":{"type":"number","description":"What they lost, in euros, over the period."}},"required":["count","drainEur"],"additionalProperties":false,"description":"Products sold below what they cost."},"waste":{"type":"object","properties":{"totalEur":{"type":"number","description":"Thrown away over the period, in euros."},"totalPcs":{"type":"number","description":"Thrown away over the period, in pieces."},"annualEur":{"type":"number","description":"The same, over a year at this pace, in euros."}},"required":["totalEur","totalPcs","annualEur"],"additionalProperties":false,"description":"What was thrown away."},"stock":{"type":"object","properties":{"valueEur":{"type":"number","description":"The money tied up in stock now."},"pieces":{"type":"number","description":"The pieces in stock now."}},"required":["valueEur","pieces"],"additionalProperties":false,"description":"What the shop holds in this category."},"toDo":{"type":"object","properties":{"reorderPoints":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Products whose reorder point should change: GET /v1/categories/{id}/reorder-points."},"orderNow":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Products at or under their reorder point: GET /v1/categories/{id}/order-list."},"stopStocking":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Products worth no longer stocking: GET /v1/categories/{id}/stop-stocking."}},"required":["reorderPoints","orderNow","stopStocking"],"additionalProperties":false,"description":"What to do now: how long each of the three lists is."}},"required":["categoryId","reportId","periodDays","headline","gains","lossMakers","waste","stock","toDo"],"additionalProperties":false},"example":{"categoryId":40,"reportId":311,"periodDays":30,"headline":[{"key":"sales","label":"Sales","value":48210.5,"unit":"eur","expected":49520.7,"delta":1310.2,"higherIsBetter":true}],"gains":[{"key":"recovered","label":"Sales you missed, won back","valueEur":410.2,"caption":"Shelves that ran empty, kept full."}],"lossMakers":{"count":3,"drainEur":41.5},"waste":{"totalEur":420.75,"totalPcs":212,"annualEur":5119.1},"stock":{"valueEur":18200.4,"pieces":9120},"toDo":{"reorderPoints":58,"orderNow":17,"stopStocking":9}}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`report.none`: There is no report open for this shop.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["report.none"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/categories/{id}/anomalies":{"get":{"operationId":"categories.anomalies","summary":"The products whose numbers say something is off, grouped by what is off, as the Anomalies page shows them.","description":"Read straight off the category's newest report. Each group holds at most 60 products, the most money first. Needs the figures ability.","tags":["categories"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}}],"responses":{"200":{"description":"The products whose numbers say something is off, grouped by what is off, as the Anomalies page shows them.","content":{"application/json":{"schema":{"type":"object","properties":{"categoryId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The category."},"reportId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The report the anomalies were read from."},"moneyAtStakeEur":{"type":"number","description":"The euros at stake across every group, each product counted once."},"groups":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"A stable name for the group."},"title":{"type":"string","description":"What is wrong, as the Anomalies page says it."},"question":{"type":"string","description":"The question a shop owner would ask about it."},"severity":{"type":"string","enum":["money","data","watch"],"description":"money costs euros, data is a figure that cannot be right, watch is worth a look."},"count":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many products are in the group."},"atStakeEur":{"description":"The euros at stake across the group, or null.","type":["number","null"]},"rows":{"type":"array","items":{"type":"object","properties":{"ean":{"type":"string","description":"The product's id, usually its barcode (EAN)."},"name":{"type":"string","description":"The product's name."},"figures":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"What the figure is."},"value":{"type":"number","description":"The figure."},"unit":{"type":"string","description":"Its unit: eur, pcs, pct, days or x."}},"required":["label","value","unit"],"additionalProperties":false},"description":"The figures that show what is wrong."},"detail":{"description":"One more sentence when the figures do not say enough, or null.","type":["string","null"]}},"required":["ean","name","figures","detail"],"additionalProperties":false},"description":"The products, at most 60 per group."}},"required":["id","title","question","severity","count","atStakeEur","rows"],"additionalProperties":false},"description":"The groups, as the Anomalies page shows them."}},"required":["categoryId","reportId","moneyAtStakeEur","groups"],"additionalProperties":false},"example":{"categoryId":40,"reportId":311,"moneyAtStakeEur":512.3,"groups":[{"id":"wasteNoSales","title":"Thrown away, never sold","question":"Why is this on the shelf at all?","severity":"money","count":1,"atStakeEur":18.4,"rows":[{"ean":"6410000000093","name":"Tonic water 1 l","figures":[{"label":"Thrown away","value":18.4,"unit":"eur"}],"detail":null}]}]}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`report.none`: There is no report open for this shop.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["report.none"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/categories/{id}/reports":{"get":{"operationId":"categories.reports","summary":"Every report of a category, newest first: its history.","description":"The newest report is the one every figure is worked out from. Download a report's original file with GET /v1/reports/{id}/file when `hasFile` is true. Needs the figures ability.","tags":["categories"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}},{"name":"cursor","in":"query","required":false,"description":"The `nextCursor` of the page before. Leave it out for the first page. Treat it as an opaque string.","schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"description":"How many rows on one page: 1 to 200, 50 when left out.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"Every report of a category, newest first: its history.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The report's id. Download its original file with GET /v1/reports/{id}/file."},"categoryId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The category the report belongs to."},"fileName":{"description":"The name of the file that was uploaded, or null for a report read from a connection.","type":["string","null"]},"source":{"type":"string","description":"Where the report came from: csv, xlsx, example, shopify or netvisor."},"products":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many products the report holds."},"uploadedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the report was uploaded, in UTC."},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the report or its settings last changed, in UTC."},"newest":{"type":"boolean","description":"True for the newest report: the one every figure is worked out from."},"hasFile":{"type":"boolean","description":"True when the original file was kept and can be downloaded."}},"required":["id","categoryId","fileName","source","products","uploadedAt","updatedAt","newest","hasFile"],"additionalProperties":false},"description":"The rows of this page."},"nextCursor":{"description":"Send it as `cursor` for the next page. Null on the last page.","type":["string","null"]},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many rows the whole list has."}},"required":["data","nextCursor","total"],"additionalProperties":false},"example":{"data":[{"id":311,"categoryId":40,"fileName":"beverages-october.xlsx","source":"xlsx","products":412,"uploadedAt":"2026-10-20T07:12:00.000Z","updatedAt":"2026-10-20T07:12:00.000Z","newest":true,"hasFile":true}],"nextCursor":null,"total":1}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/reports/{id}/file":{"get":{"operationId":"reports.file","summary":"Download the original file of one report, exactly as it was uploaded.","description":"The same file the app's Download link gives, under the same rule: anyone who may read the category may download it. A report read from a connection, or one whose original was not kept, answers 404. Needs the figures ability.","tags":["reports"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}}],"responses":{"200":{"description":"Download the original file of one report, exactly as it was uploaded.","content":{"application/octet-stream":{"schema":{"type":"string","contentMediaType":"application/octet-stream"}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you. `refused.demo`: This is a public demo, and that part is switched off.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh","refused.demo"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/categories/{id}/products":{"get":{"operationId":"categories.products","summary":"Every product of a category with what it holds, sells and triggers at, as the Products page lists them.","description":"From the category's newest report, by name. `q` finds products by name or id. A category of more than 3,000 products lists its 3,000 best sellers, as the app does. Needs the figures ability.","tags":["categories"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}},{"name":"cursor","in":"query","required":false,"description":"The `nextCursor` of the page before. Leave it out for the first page. Treat it as an opaque string.","schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"description":"How many rows on one page: 1 to 200, 50 when left out.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"q","in":"query","required":false,"description":"Only the products whose name (in any case) or id contains this. Leave it out for all of them.","schema":{"type":"string","maxLength":120}}],"responses":{"200":{"description":"Every product of a category with what it holds, sells and triggers at, as the Products page lists them.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"ean":{"type":"string","description":"The product's id in the shop's own system, usually its barcode (EAN)."},"name":{"type":"string","description":"The product's name."},"stockPcs":{"type":"number","description":"Pieces on the shelf on the report day."},"reorderPoint":{"description":"The reorder point the shop's own system holds, or null when none is set.","type":["number","null"]},"newReorderPoint":{"type":"number","description":"The reorder point Panlytics works with: a level a person fixed, or the one worked out. 0 for a product on the stop-stocking list."},"keptByHand":{"type":"boolean","description":"True when a person fixed the level as an exception."},"stopStocking":{"type":"boolean","description":"True when the product is on the stop-stocking list."},"soldPcs":{"type":"number","description":"Pieces sold over the report's period."},"salesEur":{"type":"number","description":"What those pieces brought in, in euros, VAT 0%."},"buyPrice":{"type":"number","description":"What one piece costs to buy, in euros, VAT 0%."},"sellPrice":{"type":"number","description":"What one piece sells for, in euros, VAT 0%."},"unitProfit":{"type":"number","description":"What is kept on one piece, in euros. Negative when it sells below what it cost."}},"required":["ean","name","stockPcs","reorderPoint","newReorderPoint","keptByHand","stopStocking","soldPcs","salesEur","buyPrice","sellPrice","unitProfit"],"additionalProperties":false},"description":"The rows of this page."},"nextCursor":{"description":"Send it as `cursor` for the next page. Null on the last page.","type":["string","null"]},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many rows the whole list has."}},"required":["data","nextCursor","total"],"additionalProperties":false},"example":{"data":[{"ean":"6410000000017","name":"Sparkling water 0.5 l","stockPcs":9,"reorderPoint":12,"newReorderPoint":18,"keptByHand":false,"stopStocking":false,"soldPcs":1210,"salesEur":1840.5,"buyPrice":0.5,"sellPrice":1.52,"unitProfit":1.02}],"nextCursor":null,"total":1}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`report.none`: There is no report open for this shop.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["report.none"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/categories/{id}/products/{ean}":{"get":{"operationId":"categories.product","summary":"One product in full: what it sold, what it missed, its reorder point and why, and what to order.","description":"Everything the app shows when a product's row is opened, from the category's newest report. Needs the figures ability.","tags":["categories"],"parameters":[{"name":"id","in":"path","required":true,"description":"The category's id.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}},{"name":"ean","in":"path","required":true,"description":"The product's id in the shop's own system, usually its barcode (EAN).","schema":{"type":"string","minLength":1,"maxLength":200}}],"responses":{"200":{"description":"One product in full: what it sold, what it missed, its reorder point and why, and what to order.","content":{"application/json":{"schema":{"type":"object","properties":{"ean":{"type":"string","description":"The product's id, usually its barcode (EAN)."},"name":{"type":"string","description":"The product's name."},"class":{"type":"string","description":"The sales class, A to D."},"periodDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many days the report covers."},"onShelfDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Days the product was on the shelf."},"outOfStockDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Days the shelf was empty."},"soldPcs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Pieces sold over the period."},"perDay":{"type":"number","description":"Pieces sold on an average day."},"salesEur":{"type":"number","description":"Sales over the period, in euros."},"marginEur":{"type":"number","description":"Profit on those sales, in euros."},"marginPct":{"type":"number","description":"Profit as a share of sales, in percent."},"lostSalesEur":{"type":"number","description":"Sales missed while the shelf was empty, in euros."},"stockPcs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Pieces held now, across the shop's locations."},"stockEur":{"type":"number","description":"The money tied up in that stock, in euros."},"reorderPointNow":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The reorder point the report gave."},"newReorderPoint":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The reorder point Panlytics works out."},"waitPcs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The part of the new reorder point that sells while a delivery is on its way."},"safetyPcs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The rest of the new reorder point: the safety buffer."},"orderPcs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How much to order when the level is reached, in whole pieces."},"packSize":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many pieces come in one pack."},"packSizeKnown":{"type":"boolean","description":"False when the report's pack size column held one repeated value, so the pack size is a guess."},"orderValueEur":{"type":"number","description":"What that order costs, in euros."},"purchasePrice":{"type":"number","description":"What one piece costs to buy, in euros."},"salesPrice":{"type":"number","description":"What one piece sells for, in euros."},"wastePcs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Pieces thrown away over the period."},"wasteEur":{"type":"number","description":"Thrown away over the period, in euros."},"rank":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Where the product ranks by sales in its category, 1 being the best seller."},"of":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many products the category holds."},"lowConfidence":{"type":"boolean","description":"True when the product sold too little for its figures to be sure."}},"required":["ean","name","class","periodDays","onShelfDays","outOfStockDays","soldPcs","perDay","salesEur","marginEur","marginPct","lostSalesEur","stockPcs","stockEur","reorderPointNow","newReorderPoint","waitPcs","safetyPcs","orderPcs","packSize","packSizeKnown","orderValueEur","purchasePrice","salesPrice","wastePcs","wasteEur","rank","of","lowConfidence"],"additionalProperties":false},"example":{"ean":"6410000000017","name":"Sparkling water 0.5 l","class":"A","periodDays":30,"onShelfDays":27,"outOfStockDays":3,"soldPcs":1210,"perDay":40.3,"salesEur":1840.5,"marginEur":610.2,"marginPct":33.15,"lostSalesEur":182.1,"stockPcs":9,"stockEur":4.5,"reorderPointNow":12,"newReorderPoint":18,"waitPcs":12,"safetyPcs":6,"orderPcs":24,"packSize":24,"packSizeKnown":true,"orderValueEur":12,"purchasePrice":0.5,"salesPrice":1.52,"wastePcs":0,"wasteEur":0,"rank":1,"of":412,"lowConfidence":false}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`report.none`: There is no report open for this shop.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["report.none"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/home":{"get":{"operationId":"organisation.home","summary":"The Home page: the company's figures, one row per shop, and what is waiting for a person.","description":"The same reads as the app's Home page, over every shop the key reaches or one shop with `shopId`. `needsAttention` is the list of things to do now across the shops: an agent waiting for approval, a connection that could not be read, a shop with no report for a month. Needs the figures ability.","tags":["home"],"parameters":[{"name":"shopId","in":"query","required":false,"description":"One shop to read. Leave it out for every shop the key reaches, as the Home page's All shops.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}}],"responses":{"200":{"description":"The Home page: the company's figures, one row per shop, and what is waiting for a person.","content":{"application/json":{"schema":{"type":"object","properties":{"shopIds":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"The shops these figures cover."},"headline":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"A stable name: sales, recoverable, waste, products, categories or reporting."},"label":{"type":"string","description":"What the Home page calls it."},"value":{"type":"number","description":"The figure across the newest report of every category."},"before":{"description":"The same figure over the report before, or null when there was none.","type":["number","null"]},"unit":{"type":"string","enum":["eur","count"],"description":"Euros or a count."},"better":{"type":"string","enum":["up","down"],"description":"Which way is good."}},"required":["key","label","value","before","unit","better"],"additionalProperties":false},"description":"The figures at the top of the Home page, added up over the shops."},"shops":{"type":"array","items":{"type":"object","properties":{"shopId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The shop."},"name":{"type":"string","description":"What it is called."},"city":{"type":"string","description":"Its city, or empty."},"kind":{"type":"string","enum":["manual","shopify","netvisor"],"description":"What feeds it."},"categories":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many categories it has."},"products":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many products their newest reports hold."},"salesEur":{"type":"number","description":"Sales over the newest reports, in whole euros."},"missedSalesEur":{"type":"number","description":"Sales missed while shelves were empty, in whole euros."},"wasteEur":{"type":"number","description":"Thrown away, in whole euros."},"lastReport":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"A time in ISO 8601, in UTC."},{"type":"null"}],"description":"When a report was last read, or null."},"agentsOn":{"type":"boolean","description":"True when the agents may work in this shop."},"status":{"type":"string","enum":["reading","quiet","empty"],"description":"reading: a report in the last 30 days; quiet: none for longer; empty: none ever."}},"required":["shopId","name","city","kind","categories","products","salesEur","missedSalesEur","wasteEur","lastReport","agentsOn","status"],"additionalProperties":false},"description":"One row per shop, as the Home page's table shows them."},"needsAttention":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["approval","source","report"],"description":"approval: an agent waits for a person; source: a connection could not be read; report: no report for over a month."},"shopId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The shop it is about."},"shopName":{"type":"string","description":"Its name."},"what":{"type":"string","description":"What happened, in one sentence."},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When it happened, in UTC."}},"required":["kind","shopId","shopName","what","at"],"additionalProperties":false},"description":"The ten newest things waiting for a person, as the Home page lists them."},"agents":{"type":"object","properties":{"runs":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Runs started in the last seven days."},"failed":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Of those, how many failed."},"costEur":{"type":"number","description":"What those runs cost, in euros."},"todayEur":{"type":"number","description":"What runs cost today, in euros."},"budgetEur":{"type":"number","description":"What the shops allow in a day, in euros."},"approvalsWaiting":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Proposals waiting for a person to approve them in the app."},"shopsOn":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Shops where the agents may work."}},"required":["runs","failed","costEur","todayEur","budgetEur","approvalsWaiting","shopsOn"],"additionalProperties":false,"description":"The agents, in numbers."}},"required":["shopIds","headline","shops","needsAttention","agents"],"additionalProperties":false},"example":{"shopIds":[12],"headline":[{"key":"sales","label":"Sales","value":48210,"before":45102,"unit":"eur","better":"up"}],"shops":[{"shopId":12,"name":"Harbour","city":"Helsinki","kind":"manual","categories":3,"products":1204,"salesEur":48210,"missedSalesEur":1310,"wasteEur":421,"lastReport":"2026-10-20T07:12:00.000Z","agentsOn":true,"status":"reading"}],"needsAttention":[{"kind":"approval","shopId":12,"shopName":"Harbour","what":"An agent is waiting to change a reorder point","at":"2026-10-25T09:00:00.000Z"}],"agents":{"runs":12,"failed":0,"costEur":0.42,"todayEur":0.05,"budgetEur":2,"approvalsWaiting":1,"shopsOn":1}}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/organisation/people":{"get":{"operationId":"organisation.people","summary":"The company's people, each with their role and the shops it covers, as the People page lists them.","description":"Only when the person who made the key may see People in the app, and only the people that page shows them: a manager of some shops sees the CEO and the people inside their own shops. Read only: a key can never add, change or remove a person or a role. Never an email address or a phone number. A key whose maker may not see People answers 403. Needs the figures ability.","tags":["organisation"],"parameters":[{"name":"cursor","in":"query","required":false,"description":"The `nextCursor` of the page before. Leave it out for the first page. Treat it as an opaque string.","schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"description":"How many rows on one page: 1 to 200, 50 when left out.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"The company's people, each with their role and the shops it covers, as the People page lists them.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"memberId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The person's membership id in the company."},"name":{"type":"string","description":"The person's name, or their username when they gave none."},"username":{"type":"string","description":"Their username."},"role":{"type":"string","description":"\"CEO\", or the name of their role."},"tier":{"type":"string","enum":["ceo","manager","operator"],"description":"ceo, manager or operator."},"scope":{"type":"string","enum":["all","shops","categories"],"description":"What their role covers: every shop, chosen shops, or chosen categories of one shop."},"shopIds":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"The shops their role names. Empty when it covers every shop."},"categoryIds":{"type":"array","items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"description":"The categories their role names, when it covers chosen categories."},"signedInYet":{"type":"boolean","description":"False for a person who was added and has not finished their first sign-in."},"disabled":{"type":"boolean","description":"True when their account is switched off."},"lastActiveAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"A time in ISO 8601, in UTC."},{"type":"null"}],"description":"When they last did or read something, in UTC, or null."},"joinedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When they were added to the company, in UTC."}},"required":["memberId","name","username","role","tier","scope","shopIds","categoryIds","signedInYet","disabled","lastActiveAt","joinedAt"],"additionalProperties":false},"description":"The rows of this page."},"nextCursor":{"description":"Send it as `cursor` for the next page. Null on the last page.","type":["string","null"]},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many rows the whole list has."}},"required":["data","nextCursor","total"],"additionalProperties":false},"example":{"data":[{"memberId":4,"name":"Anna Virtanen","username":"anna","role":"Manager","tier":"manager","scope":"shops","shopIds":[12],"categoryIds":[],"signedInYet":true,"disabled":false,"lastActiveAt":"2026-10-25T09:00:00.000Z","joinedAt":"2026-09-01T08:00:00.000Z"}],"nextCursor":null,"total":1}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/categories/{id}/sheet":{"get":{"operationId":"sheet.tabs","summary":"The Sheet page's tabs for a category's newest report, with their columns.","description":"A tab's columns say which ones may be edited. Read a tab's rows with GET /v1/categories/{id}/sheet/{tab}. Needs the figures ability.","tags":["categories"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}}],"responses":{"200":{"description":"The Sheet page's tabs for a category's newest report, with their columns.","content":{"application/json":{"schema":{"type":"object","properties":{"categoryId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The category."},"reportId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Its newest report, whose rows these are."},"updatedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When that report last changed. Send it back with an edit so a change made since is not overwritten."},"tabs":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The tab's id, for GET /v1/categories/{id}/sheet/{tab}."},"label":{"type":"string","description":"What the Sheet page calls it."},"rowCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many rows it holds."},"editable":{"type":"boolean","description":"True when at least one of its columns can be edited."},"columns":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","description":"The column's key, and the `field` of an edit."},"label":{"type":"string","description":"Its heading, as the shop's own workbook writes it."},"format":{"type":"string","description":"How its values are written: a number, euros, pieces, days, a percent or text."},"editable":{"type":"boolean","description":"True when an edit may change it."},"hint":{"description":"What the column is, in plain words, or null.","type":["string","null"]}},"required":["key","label","format","editable","hint"],"additionalProperties":false},"description":"The columns, in order. A row's `cells` follow the same order."}},"required":["id","label","rowCount","editable","columns"],"additionalProperties":false},"description":"The Sheet page's tabs."}},"required":["categoryId","reportId","updatedAt","tabs"],"additionalProperties":false},"example":{"categoryId":40,"reportId":301,"updatedAt":"2026-10-25T09:00:00.000Z","tabs":[{"id":"input","label":"Input","rowCount":461,"editable":true,"columns":[{"key":"stockPcs","label":"STOCK pcs","format":"pcs","editable":true,"hint":"Pieces on the shelf on the report day."}]}]}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`report.none`: There is no report open for this shop.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["report.none"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/categories/{id}/sheet/{tab}":{"get":{"operationId":"sheet.rows","summary":"Rows of one Sheet tab, sorted and searched as the Sheet page does.","description":"Up to 200 rows a call, from `from`. Each row's `cells` follow the tab's column order. Needs the figures ability.","tags":["categories"],"parameters":[{"name":"id","in":"path","required":true,"description":"The category's id.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}},{"name":"tab","in":"path","required":true,"description":"The tab's id, from GET /v1/categories/{id}/sheet.","schema":{"type":"string","minLength":1,"maxLength":40}},{"name":"from","in":"query","required":false,"description":"The first row to answer, counted from 0.","schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"count","in":"query","required":false,"description":"How many rows, 1 to 200.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"sort","in":"query","required":false,"description":"A column key to order by. Leave it out for the tab's own order.","schema":{"type":"string","maxLength":60}},{"name":"dir","in":"query","required":false,"description":"asc or desc.","schema":{"default":"asc","type":"string","enum":["asc","desc"]}},{"name":"q","in":"query","required":false,"description":"Only the rows whose text columns (the product's id, its name) contain this.","schema":{"type":"string","maxLength":120}}],"responses":{"200":{"description":"Rows of one Sheet tab, sorted and searched as the Sheet page does.","content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The first row answered."},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many rows match, in all."},"rows":{"type":"array","items":{"type":"object","properties":{"ean":{"type":"string","description":"The product's id."},"cells":{"type":"array","items":{"type":["string","number","null"]},"description":"One value per column, in the tab's column order."}},"required":["ean","cells"],"additionalProperties":false},"description":"The rows."}},"required":["from","total","rows"],"additionalProperties":false},"example":{"from":0,"total":461,"rows":[{"ean":"6410000000017","cells":["6410000000017","Oat milk 1 l",24]}]}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`report.none`: There is no report open for this shop.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["report.none"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/categories/{id}/sheet-edits":{"post":{"operationId":"sheet.edit","summary":"Change figures in a category's newest report, as the Sheet page's edits do.","description":"Each edit names a product, an editable column and the new value. The batch is saved in one write, every figure is worked out again, and the change is written to the audit log. Send the report's `updatedAt` so an edit made since is never overwritten. Needs the sheet ability.","tags":["categories"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}}],"responses":{"200":{"description":"Change figures in a category's newest report, as the Sheet page's edits do.","content":{"application/json":{"schema":{"type":"object","properties":{"reportId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The report the edits were saved to."},"saved":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many edits were saved."}},"required":["reportId","saved"],"additionalProperties":false},"example":{"reportId":301,"saved":1}}}},"400":{"description":"`api.invalid`: The field is missing or not valid. `bad_request.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid","bad_request.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you. `refused.demo`: This is a public demo, and that part is switched off.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh","refused.demo"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`report.none`: There is no report open for this shop. `api.stale`: This was changed after the time you sent.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["report.none","api.stale"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"edits":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"ean":{"type":"string","minLength":1,"maxLength":200,"description":"The product's id."},"field":{"type":"string","minLength":1,"maxLength":60,"description":"An editable column's key."},"value":{"type":"number","description":"The new value. Only margin may be below zero."}},"required":["ean","field","value"],"additionalProperties":false},"description":"The edits, 1 to 500, saved together or not at all."},"updatedAt":{"description":"The report's `updatedAt` as you read it. When it has changed since, the save answers 409 and changes nothing.","type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"}},"required":["edits"],"additionalProperties":false},"example":{"edits":[{"ean":"6410000000017","field":"stockPcs","value":24}],"updatedAt":"2026-10-25T09:00:00.000Z"}}}}}},"/v1/shops/{id}/exceptions":{"get":{"operationId":"exceptions.list","summary":"The shop's exceptions: the reorder points people fixed by hand, and the products they keep off the stop-stocking list.","description":"As the Exceptions page lists them, newest first. A person limited to chosen categories sees the rules for their own products only. Needs the figures ability.","tags":["shops"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}},{"name":"cursor","in":"query","required":false,"description":"The `nextCursor` of the page before. Leave it out for the first page. Treat it as an opaque string.","schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"description":"How many rows on one page: 1 to 200, 50 when left out.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"The shop's exceptions: the reorder points people fixed by hand, and the products they keep off the stop-stocking list.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"productId":{"type":"string","description":"The product's id, usually its barcode (EAN)."},"name":{"description":"What the product is called, or null when no report of the shop holds it.","type":["string","null"]},"category":{"description":"The category the product was found in, or null.","type":["string","null"]},"keepAt":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The reorder point a person fixed for it, or null when the rule fixes no level."},"neverStop":{"type":"boolean","description":"True when the product must never be put on the stop-stocking list."},"reason":{"type":"string","description":"Why, in the words of the person who set it."},"setBy":{"description":"Who set it, or null once their account is gone.","type":["string","null"]},"setAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When it was set, in UTC."}},"required":["productId","name","category","keepAt","neverStop","reason","setBy","setAt"],"additionalProperties":false},"description":"The rows of this page."},"nextCursor":{"description":"Send it as `cursor` for the next page. Null on the last page.","type":["string","null"]},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many rows the whole list has."}},"required":["data","nextCursor","total"],"additionalProperties":false},"example":{"data":[{"productId":"6410000000017","name":"Oat milk 1 l","category":"Dairy","keepAt":12,"neverStop":true,"reason":"Sold out every Saturday morning.","setBy":"Anna Virtanen","setAt":"2026-10-20T08:00:00.000Z"}],"nextCursor":null,"total":1}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/shops/{id}/exceptions/{ean}":{"put":{"operationId":"exceptions.save","summary":"Fix a product's reorder point by hand, or keep it off the stop-stocking list, or both.","description":"Writes or replaces the shop's one rule for the product, exactly as the Exceptions page does: the same checks, the same audit row. A rule must say something: a level, `neverStop`, or both. The level overrides the worked-out reorder point in every figure from the next read on. Needs the exceptions ability.","tags":["shops"],"parameters":[{"name":"id","in":"path","required":true,"description":"The shop's id.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}},{"name":"ean","in":"path","required":true,"description":"The product's id in the shop's own system, usually its barcode (EAN). A product's full name is accepted too.","schema":{"type":"string","minLength":1,"maxLength":200}}],"responses":{"200":{"description":"Fix a product's reorder point by hand, or keep it off the stop-stocking list, or both.","content":{"application/json":{"schema":{"type":"object","properties":{"productId":{"type":"string","description":"The product the rule is for, as its id: a name sent in the path is turned into its barcode."},"saved":{"type":"boolean","const":true,"description":"Always true."}},"required":["productId","saved"],"additionalProperties":false},"example":{"productId":"6410000000017","saved":true}}}},"400":{"description":"`api.invalid`: The field is missing or not valid. `bad_request.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid","bad_request.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you. `refused.demo`: This is a public demo, and that part is switched off.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh","refused.demo"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"keepAt":{"default":null,"description":"The reorder point to keep the product at, in pieces; null to fix no level.","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"neverStop":{"default":false,"description":"True to keep the product off the stop-stocking list for good.","type":"boolean"},"reason":{"default":"","description":"Why, in a sentence. People read it on the Exceptions page.","type":"string","maxLength":1000}},"additionalProperties":false},"example":{"keepAt":12,"neverStop":true,"reason":"Sold out every Saturday morning."}}}}},"delete":{"operationId":"exceptions.remove","summary":"Remove a product's exception, so its figures are worked out again.","description":"The rule is deleted for good: the hand-fixed level and the reason with it. Ask the person before you call this, and say which product's rule goes. Destructive: it cannot be undone, so an agent asks the person before it calls this. Needs the exceptions ability.","tags":["shops"],"parameters":[{"name":"id","in":"path","required":true,"description":"The shop's id.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}},{"name":"ean","in":"path","required":true,"description":"The product's id in the shop's own system, usually its barcode (EAN). A product's full name is accepted too.","schema":{"type":"string","minLength":1,"maxLength":200}}],"responses":{"200":{"description":"Remove a product's exception, so its figures are worked out again.","content":{"application/json":{"schema":{"type":"object","properties":{"productId":{"type":"string","description":"The product whose rule was removed."},"removed":{"type":"boolean","const":true,"description":"Always true."}},"required":["productId","removed"],"additionalProperties":false},"example":{"productId":"6410000000017","removed":true}}}},"400":{"description":"`api.invalid`: The field is missing or not valid. `bad_request.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid","bad_request.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you. `refused.demo`: This is a public demo, and that part is switched off.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh","refused.demo"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}},"x-panlytics-destructive":true}},"/v1/shops/{id}/exception-imports":{"post":{"operationId":"exceptions.import","summary":"Write many exceptions at once from a .csv or .xlsx file.","description":"Four columns, in this order: the product's barcode, the level to keep it at, whether it must never be stopped, and why. A header row is skipped. All or nothing: a row the file gets wrong refuses the whole file, and nothing is written. Needs the exceptions ability.","tags":["shops"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}}],"responses":{"200":{"description":"Write many exceptions at once from a .csv or .xlsx file.","content":{"application/json":{"schema":{"type":"object","properties":{"imported":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many rules the file wrote."}},"required":["imported"],"additionalProperties":false},"example":{"imported":40}}}},"400":{"description":"`api.invalid`: The field is missing or not valid. `bad_request.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid","bad_request.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you. `refused.demo`: This is a public demo, and that part is switched off.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh","refused.demo"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"413":{"description":"`upload.too_large`: That file is too big to upload.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["upload.too_large"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}},"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"type":"object","required":["file"],"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","description":"The file, as .csv or .xlsx."}}}}}}}},"/v1/shops/{id}/overstock-decisions":{"get":{"operationId":"overstock.list","summary":"What the shop decided about its overstocked products, newest first.","description":"Each decision says which product, which of the four actions, and why. Needs the figures ability.","tags":["shops"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}},{"name":"cursor","in":"query","required":false,"description":"The `nextCursor` of the page before. Leave it out for the first page. Treat it as an opaque string.","schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"description":"How many rows on one page: 1 to 200, 50 when left out.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"What the shop decided about its overstocked products, newest first.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The decision's id."},"productId":{"type":"string","description":"The product it is about."},"action":{"type":"string","enum":["transfer","return","writeOff","discount"],"description":"What was decided: move it to another shop, return it, write it off, or sell it at a discount."},"reason":{"type":"string","description":"Why, in the buyer's words."},"decidedAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When it was decided, in UTC."}},"required":["id","productId","action","reason","decidedAt"],"additionalProperties":false},"description":"The rows of this page."},"nextCursor":{"description":"Send it as `cursor` for the next page. Null on the last page.","type":["string","null"]},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many rows the whole list has."}},"required":["data","nextCursor","total"],"additionalProperties":false},"example":{"data":[{"id":3,"productId":"6410000000017","action":"discount","reason":"Best before in a week.","decidedAt":"2026-10-20T08:00:00.000Z"}],"nextCursor":null,"total":1}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}},"post":{"operationId":"overstock.decide","summary":"Record what to do about an overstocked product: transfer, return, write off or discount.","description":"Needs the sheet ability over the whole shop, as in the app. The decision is recorded and written to the audit log; it moves no stock by itself. Send an Idempotency-Key header so a retry never records it twice. Needs the sheet ability.","tags":["shops"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Any string up to 255 characters, new for each new request. The same key with the same body within 24 hours answers with the first answer again and creates nothing; the same key with another body is refused with 409.","schema":{"type":"string","maxLength":255}}],"responses":{"201":{"description":"Record what to do about an overstocked product: transfer, return, write off or discount.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The id of the decision just recorded."}},"required":["id"],"additionalProperties":false},"example":{"id":3}}}},"400":{"description":"`api.invalid`: The field is missing or not valid. `bad_request.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid","bad_request.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you. `refused.demo`: This is a public demo, and that part is switched off.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh","refused.demo"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`api.idempotency_conflict`: That Idempotency-Key was already used for a different request. `api.idempotency_busy`: The first request with that Idempotency-Key is still running.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.idempotency_conflict","api.idempotency_busy"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"productId":{"type":"string","minLength":1,"maxLength":200,"description":"The product the decision is about, usually its barcode (EAN)."},"action":{"type":"string","enum":["transfer","return","writeOff","discount"],"description":"transfer, return, writeOff or discount."},"reason":{"default":"","description":"Why, in a sentence.","type":"string","maxLength":500}},"required":["productId","action"],"additionalProperties":false},"example":{"productId":"6410000000017","action":"discount","reason":"Best before in a week."}}}}}},"/v1/shops/{id}/baskets":{"get":{"operationId":"baskets.list","summary":"The shop's product groups: products bought together, which keep each other in stock once a person approves them.","description":"Groups are proposals until a person approves them in the app; only an approved group changes the figures. A key may take a product out of a group or delete a group, but approving one stays with a person. Needs the figures ability.","tags":["shops"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}},{"name":"cursor","in":"query","required":false,"description":"The `nextCursor` of the page before. Leave it out for the first page. Treat it as an opaque string.","schema":{"type":"string","maxLength":200}},{"name":"limit","in":"query","required":false,"description":"How many rows on one page: 1 to 200, 50 when left out.","schema":{"default":50,"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"The shop's product groups: products bought together, which keep each other in stock once a person approves them.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"purpose":{"type":"string","description":"What the group is for, which is also its key: unique in the shop."},"reason":{"type":"string","description":"Why these products are bought together."},"approved":{"description":"True once a person approved it, false when they set it aside, null while undecided. Only an approved group changes the figures.","type":["boolean","null"]},"decidedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"A time in ISO 8601, in UTC."},{"type":"null"}],"description":"When a person decided, or null."},"products":{"type":"array","items":{"type":"object","properties":{"ean":{"type":"string","description":"The product's id."},"name":{"type":"string","description":"Its name."},"dropped":{"type":"boolean","description":"True when a person took it out of the group."}},"required":["ean","name","dropped"],"additionalProperties":false},"description":"The group's products, the dropped ones included."}},"required":["purpose","reason","approved","decidedAt","products"],"additionalProperties":false},"description":"The rows of this page."},"nextCursor":{"description":"Send it as `cursor` for the next page. Null on the last page.","type":["string","null"]},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many rows the whole list has."}},"required":["data","nextCursor","total"],"additionalProperties":false},"example":{"data":[{"purpose":"Breakfast","reason":"Bought together on weekday mornings.","approved":null,"decidedAt":null,"products":[{"ean":"6410000000017","name":"Oat milk 1 l","dropped":false},{"ean":"6410000000024","name":"Granola 500 g","dropped":false}]}],"nextCursor":null,"total":1}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}},"delete":{"operationId":"baskets.delete","summary":"Delete one product group for good.","description":"The group and any decision about it are gone; a later scan may propose it again. Ask the person before you call this, and say which group goes. Destructive: it cannot be undone, so an agent asks the person before it calls this. Needs the sheet ability.","tags":["shops"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}},{"name":"purpose","in":"query","required":true,"description":"The group to delete, by its purpose.","schema":{"type":"string","minLength":1,"maxLength":300}}],"responses":{"200":{"description":"Delete one product group for good.","content":{"application/json":{"schema":{"type":"object","properties":{"purpose":{"type":"string","description":"The group that was changed."},"done":{"type":"boolean","const":true,"description":"Always true."}},"required":["purpose","done"],"additionalProperties":false},"example":{"purpose":"Breakfast","done":true}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you. `refused.demo`: This is a public demo, and that part is switched off.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh","refused.demo"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`scan.none`: Nothing has been scanned yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["scan.none"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}},"x-panlytics-destructive":true}},"/v1/shops/{id}/baskets/members":{"put":{"operationId":"baskets.setMember","summary":"Take a product out of a group, or put it back.","description":"Reversible: a product taken out stays listed as dropped. When the group is approved, the change counts at once. Needs the sheet ability.","tags":["shops"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}}],"responses":{"200":{"description":"Take a product out of a group, or put it back.","content":{"application/json":{"schema":{"type":"object","properties":{"purpose":{"type":"string","description":"The group that was changed."},"done":{"type":"boolean","const":true,"description":"Always true."}},"required":["purpose","done"],"additionalProperties":false},"example":{"purpose":"Breakfast","done":true}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you. `refused.demo`: This is a public demo, and that part is switched off.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh","refused.demo"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`scan.none`: Nothing has been scanned yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["scan.none"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"purpose":{"type":"string","minLength":1,"maxLength":300,"description":"The group, by its purpose."},"ean":{"type":"string","minLength":1,"maxLength":200,"description":"The product to take out or put back."},"dropped":{"type":"boolean","description":"True to take it out of the group, false to put it back."}},"required":["purpose","ean","dropped"],"additionalProperties":false},"example":{"purpose":"Breakfast","ean":"6410000000024","dropped":true}}}}}},"/v1/notifications":{"get":{"operationId":"notifications.list","summary":"The newest notifications of the person who made the key, as the bell shows them.","description":"Only news about the shops the key reaches. The notice that an AI signed in stays unread until the person reads it in the app.","tags":["notifications"],"parameters":[],"responses":{"200":{"description":"The newest notifications of the person who made the key, as the bell shows them.","content":{"application/json":{"schema":{"type":"object","properties":{"unread":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many are unread."},"notifications":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"The notification's id."},"kind":{"type":"string","description":"What kind of news it is."},"subject":{"type":"string","description":"The news, in one sentence."},"href":{"description":"The page in the app it links to, or null.","type":["string","null"]},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When it was sent, in UTC."},"readAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"A time in ISO 8601, in UTC."},{"type":"null"}],"description":"When it was read, or null."}},"required":["id","kind","subject","href","createdAt","readAt"],"additionalProperties":false},"description":"The newest few, as the bell shows them."}},"required":["unread","notifications"],"additionalProperties":false},"example":{"unread":1,"notifications":[{"id":"n_9f2","kind":"report.read","subject":"Dairy's new report was read.","href":"/category/40","createdAt":"2026-10-25T09:00:00.000Z","readAt":null}]}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/notifications/{id}/read":{"post":{"operationId":"notifications.read","summary":"Mark one notification read.","description":"An id that is not the person's own matches nothing and changes nothing.","tags":["notifications"],"parameters":[{"name":"id","in":"path","required":true,"description":"The notification's id.","schema":{"type":"string","minLength":1,"maxLength":100}}],"responses":{"200":{"description":"Mark one notification read.","content":{"application/json":{"schema":{"type":"object","properties":{"unread":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many are still unread."}},"required":["unread"],"additionalProperties":false},"example":{"unread":0}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/notifications/read-all":{"post":{"operationId":"notifications.readAll","summary":"Mark every notification read.","description":"Except the notice that an AI signed in, which only the person can clear.","tags":["notifications"],"parameters":[],"responses":{"200":{"description":"Mark every notification read.","content":{"application/json":{"schema":{"type":"object","properties":{"unread":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many are still unread."}},"required":["unread"],"additionalProperties":false},"example":{"unread":1}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/issues":{"post":{"operationId":"issues.create","summary":"Report a problem with Panlytics to the Panlytics team, as the app's Report a problem box does.","description":"Text only: no screenshot or recording. It is filed under the person who made the key and marked as sent with a key. Send an Idempotency-Key header so a retry never files it twice.","tags":["issues"],"parameters":[{"name":"Idempotency-Key","in":"header","required":false,"description":"Any string up to 255 characters, new for each new request. The same key with the same body within 24 hours answers with the first answer again and creates nothing; the same key with another body is refused with 409.","schema":{"type":"string","maxLength":255}}],"responses":{"201":{"description":"Report a problem with Panlytics to the Panlytics team, as the app's Report a problem box does.","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The report's id."},"duplicate":{"type":"boolean","description":"True when the same report had already been filed."}},"required":["id","duplicate"],"additionalProperties":false},"example":{"id":88,"duplicate":false}}}},"400":{"description":"`api.invalid`: The field is missing or not valid. `bad_request.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid","bad_request.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you. `refused.demo`: This is a public demo, and that part is switched off.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh","refused.demo"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`api.idempotency_conflict`: That Idempotency-Key was already used for a different request. `api.idempotency_busy`: The first request with that Idempotency-Key is still running.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.idempotency_conflict","api.idempotency_busy"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute. `limit.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited","limit.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string","minLength":1,"maxLength":4000,"description":"What went wrong, in full sentences."},"page":{"description":"The app page it happened on, if you know it, such as /category/40/actions.","type":"string","maxLength":500}},"required":["message"],"additionalProperties":false},"example":{"message":"The order list shows no products for Dairy since this morning."}}}}}},"/v1/shops/{id}/place":{"patch":{"operationId":"shops.place","summary":"Change where a shop stands and who shops there: its address, its notes, whether the public walks in.","description":"The shop page's \"Who shops here\" form. Needs the sheet ability over the whole shop. Every field is optional, and a field left out stays as it is. A changed address is looked up on OpenStreetMap unless you send a `pin`; a place closed to the public is never looked up and keeps no pin. Written to the audit log. Needs the sheet ability.","tags":["shops"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}}],"responses":{"200":{"description":"Change where a shop stands and who shops there: its address, its notes, whether the public walks in.","content":{"application/json":{"schema":{"type":"object","properties":{"shop":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The shop's id."},"name":{"type":"string","description":"What the shop is called, as people in the company say it."},"branch":{"type":"string","description":"The branch name, or empty."},"city":{"type":"string","description":"The city the shop is in."},"country":{"type":"string","description":"The country the shop is in, or empty."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the shop was made, in UTC."},"givenName":{"type":"string","description":"The name the shop was opened under. Equal to `name` until somebody renames it."},"kind":{"type":"string","enum":["manual","shopify","netvisor"],"description":"What feeds the shop: manual (reports somebody uploads), shopify or netvisor."},"openToPublic":{"type":"boolean","description":"True for a shop people walk into, false for a warehouse or a stockroom."},"notes":{"type":"string","description":"Who shops here, in the company's own words, or empty."},"about":{"type":"string","description":"Anything else worth knowing about this shop, or empty."},"profile":{"description":"The short summary of the area around the shop, when it has been researched. Null otherwise.","type":["string","null"]},"place":{"anyOf":[{"type":"object","properties":{"label":{"type":"string","description":"The address as the map gave it."},"lat":{"type":"number","description":"Latitude."},"lon":{"type":"number","description":"Longitude."}},"required":["label","lat","lon"],"additionalProperties":false},{"type":"null"}],"description":"Where the shop stands on the map, when it has a pin. Null otherwise."},"archivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"A time in ISO 8601, in UTC."},{"type":"null"}],"description":"When the shop was archived, in UTC. Null for an open shop."}},"required":["id","name","branch","city","country","createdAt","givenName","kind","openToPublic","notes","about","profile","place","archivedAt"],"additionalProperties":false,"description":"The shop as it stands now."},"mapNote":{"description":"A sentence when the address saved but the map could not place it, or null.","type":["string","null"]}},"required":["shop","mapNote"],"additionalProperties":false},"example":{"shop":{"id":12,"name":"Harbour","givenName":"Harbour","branch":"","city":"Helsinki","country":"Finland","createdAt":"2026-10-01T08:00:00.000Z","kind":"manual","openToPublic":true,"notes":"Students from the campus nearby, and families at the weekend.","about":"A mid-sized grocery next to the ferry terminal.","profile":null,"place":{"label":"Satamakatu 1, Helsinki","lat":60.1675,"lon":24.9566},"archivedAt":null},"mapNote":null}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"country":{"description":"The country. Left out, it stays as it is.","type":"string","maxLength":80},"city":{"description":"The city. Left out, it stays as it is.","type":"string","maxLength":120},"area":{"description":"The street or district, which the app calls the branch. Left out, it stays as it is.","type":"string","maxLength":200},"notes":{"description":"Who shops here, in the company's own words. Left out, it stays as it is.","type":"string","maxLength":2000},"about":{"description":"Anything else worth knowing about the shop. Left out, it stays as it is.","type":"string","maxLength":2000},"openToPublic":{"description":"True for a shop people walk into, false for a warehouse or a stockroom. A place closed to the public is never looked up on a map and keeps no pin.","type":"boolean"},"pin":{"description":"A pin you already have, such as one read from a map link. Without it, a changed address is looked up on OpenStreetMap.","type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90,"description":"Latitude."},"lon":{"type":"number","minimum":-180,"maximum":180,"description":"Longitude."},"label":{"type":"string","minLength":1,"maxLength":300,"description":"The address as the map gave it."}},"required":["lat","lon","label"],"additionalProperties":false}},"additionalProperties":false},"example":{"city":"Helsinki","area":"Satamakatu 1","notes":"Ferry passengers and office workers at lunch."}}}}}},"/v1/shops/{id}/locate":{"post":{"operationId":"shops.locate","summary":"Look the shop's address up on OpenStreetMap again and pin it on the map.","description":"The shop page's \"Put me on the map\" button. Needs the sheet ability over the whole shop. A place closed to the public is never looked up (409), a shop with no city or street has nothing to look up (400), and an address the map cannot find answers 404 and keeps no pin. Needs the sheet ability.","tags":["shops"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}}],"responses":{"200":{"description":"Look the shop's address up on OpenStreetMap again and pin it on the map.","content":{"application/json":{"schema":{"type":"object","properties":{"place":{"type":"object","properties":{"label":{"type":"string","description":"The address as the map gave it."},"lat":{"type":"number","description":"Latitude."},"lon":{"type":"number","description":"Longitude."}},"required":["label","lat","lon"],"additionalProperties":false,"description":"Where the shop now stands on the map."},"mapNote":{"description":"A sentence about the lookup, or null.","type":["string","null"]}},"required":["place","mapNote"],"additionalProperties":false},"example":{"place":{"label":"Satamakatu 1, Helsinki","lat":60.1675,"lon":24.9566},"mapNote":null}}}},"400":{"description":"`api.invalid`: The field is missing or not valid. `bad_request.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid","bad_request.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`conflict.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["conflict.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/shops/{id}/research":{"post":{"operationId":"shops.research","summary":"Research the area around a shop: who lives there, what they earn, what they buy, with the web sources it rests on.","description":"The shop page's \"Research the area\" button, the same AI pass with web search. Needs the sheet ability over the whole shop. It replaces the shop's earlier research and its summary (`profile`), may move its pin, and is written to the audit log. Fields left out are the shop's own. It spends AI and can take a minute or more. A key's maker may run area research and basket scans 20 times a day in all (429 after that). A place closed to the public has no walk-in customers to research (409). Needs the sheet ability.","tags":["shops"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}}],"responses":{"200":{"description":"Research the area around a shop: who lives there, what they earn, what they buy, with the web sources it rests on.","content":{"application/json":{"schema":{"type":"object","properties":{"sources":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many web sources the research cites."},"mapNote":{"description":"A sentence when the map could not place the address it settled on, or null.","type":["string","null"]},"shop":{"type":"object","properties":{"id":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The shop's id."},"name":{"type":"string","description":"What the shop is called, as people in the company say it."},"branch":{"type":"string","description":"The branch name, or empty."},"city":{"type":"string","description":"The city the shop is in."},"country":{"type":"string","description":"The country the shop is in, or empty."},"createdAt":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When the shop was made, in UTC."},"givenName":{"type":"string","description":"The name the shop was opened under. Equal to `name` until somebody renames it."},"kind":{"type":"string","enum":["manual","shopify","netvisor"],"description":"What feeds the shop: manual (reports somebody uploads), shopify or netvisor."},"openToPublic":{"type":"boolean","description":"True for a shop people walk into, false for a warehouse or a stockroom."},"notes":{"type":"string","description":"Who shops here, in the company's own words, or empty."},"about":{"type":"string","description":"Anything else worth knowing about this shop, or empty."},"profile":{"description":"The short summary of the area around the shop, when it has been researched. Null otherwise.","type":["string","null"]},"place":{"anyOf":[{"type":"object","properties":{"label":{"type":"string","description":"The address as the map gave it."},"lat":{"type":"number","description":"Latitude."},"lon":{"type":"number","description":"Longitude."}},"required":["label","lat","lon"],"additionalProperties":false},{"type":"null"}],"description":"Where the shop stands on the map, when it has a pin. Null otherwise."},"archivedAt":{"anyOf":[{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"A time in ISO 8601, in UTC."},{"type":"null"}],"description":"When the shop was archived, in UTC. Null for an open shop."}},"required":["id","name","branch","city","country","createdAt","givenName","kind","openToPublic","notes","about","profile","place","archivedAt"],"additionalProperties":false,"description":"The shop as it stands now, with its new `profile`."}},"required":["sources","mapNote","shop"],"additionalProperties":false},"example":{"sources":9,"mapNote":null,"shop":{"id":12,"name":"Harbour","givenName":"Harbour","branch":"","city":"Helsinki","country":"Finland","createdAt":"2026-10-01T08:00:00.000Z","kind":"manual","openToPublic":true,"notes":"Students from the campus nearby, and families at the weekend.","about":"A mid-sized grocery next to the ferry terminal.","profile":"A commuter crowd on weekdays and families at the weekend.","place":{"label":"Satamakatu 1, Helsinki","lat":60.1675,"lon":24.9566},"archivedAt":null}}}}},"400":{"description":"`api.invalid`: The field is missing or not valid. `bad_request.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid","bad_request.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`conflict.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["conflict.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute. `limit.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited","limit.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet. `agent.empty`: The assistant came back with nothing. `unavailable.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable","agent.empty","unavailable.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"country":{"description":"The country to research in. Left out, the shop's own.","type":"string","maxLength":80},"city":{"description":"The city. Left out, the shop's own.","type":"string","maxLength":120},"area":{"description":"The street or district. Left out, the shop's own.","type":"string","maxLength":200},"notes":{"description":"What you already know about who shops here. Left out, the shop's own notes.","type":"string","maxLength":2000}},"additionalProperties":false},"example":{}}}}}},"/v1/shops/{id}/basket-scans":{"post":{"operationId":"baskets.scan","summary":"Ask the AI to propose product groups: products bought together, which keep each other in stock.","description":"The Baskets page's scan, the same AI pass over every product of every category. Needs the sheet ability over the whole shop. It replaces the shop's proposals and keeps every decision a person already made on a group that is proposed again. What it finds are proposals: a group changes the figures only once a person approves it in the app. It spends AI and can take a minute or more, and is written to the audit log. A key's maker may run area research and basket scans 20 times a day in all (429 after that). Read the result with GET /v1/shops/{id}/baskets. Needs the sheet ability.","tags":["shops"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}}],"responses":{"200":{"description":"Ask the AI to propose product groups: products bought together, which keep each other in stock.","content":{"application/json":{"schema":{"type":"object","properties":{"found":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many product groups the scan proposed."},"gaps":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many groups the shop almost has, with a product missing."}},"required":["found","gaps"],"additionalProperties":false},"example":{"found":7,"gaps":2}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`report.none`: There is no report open for this shop.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["report.none"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute. `limit.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited","limit.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet. `agent.empty`: The assistant came back with nothing. `unavailable.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable","agent.empty","unavailable.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/shops/{id}/shopify/plan":{"get":{"operationId":"shopify.plan","summary":"What a report read from the shop's Shopify would hold, before anything is written.","description":"Reads the source and describes what a report would hold, with every gap in full sentences, and writes nothing. Thirty plans and reports an hour per person and source, as in the app. Needs the figures ability.","tags":["shops"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}},{"name":"productType","in":"query","required":false,"description":"Only this Shopify product type. Left out, the whole shop.","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"What a report read from the shop's Shopify would hold, before anything is written.","content":{"application/json":{"schema":{"type":"object","properties":{"shopName":{"type":"string","description":"The Shopify shop's name."},"currency":{"type":"string","description":"Its currency."},"windowDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Days the report covers. Never longer than the source will serve."},"periodAsked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The period the category was set up with, when it differs."},"category":{"type":"string","description":"The category the report would be filed under."},"coverage":{"type":"object","properties":{"seen":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Products the source returned, before anything was left out."},"notForSale":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Left out because they are drafts or archived."},"rows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows the report will carry."},"withBarcode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows with a barcode."},"withCost":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows with a cost price."},"withStockTracking":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows whose stock is tracked."},"withSales":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows that sold at least one piece in the period."},"withAvailability":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows with a measured count of days out of stock."}},"required":["seen","notForSale","rows","withBarcode","withCost","withStockTracking","withSales","withAvailability"],"additionalProperties":false,"description":"How much of what the report needs the source holds."},"availability":{"type":"object","properties":{"measured":{"type":"boolean","description":"True when days out of stock were measured."},"daysObserved":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Over how many days of history."},"firstDay":{"description":"The first day observed, or null.","type":["string","null"]}},"required":["measured","daysObserved","firstDay"],"additionalProperties":false,"description":"Whether days out of stock were measured. Fewer days than the window make every count a floor."},"warnings":{"type":"array","items":{"type":"string"},"description":"Everything to know before trusting the figures, in full sentences, in the order they matter."},"types":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"The product type."},"variants":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Its variants."}},"required":["label","variants"],"additionalProperties":false},"description":"Every product type on offer, with its count of variants."},"orders":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Orders in the window."}},"required":["shopName","currency","windowDays","periodAsked","category","coverage","availability","warnings","types","orders"],"additionalProperties":false},"example":{"shopName":"Harbour Online","currency":"EUR","category":"Beverages","types":[{"label":"Beverages","variants":412}],"orders":1840,"windowDays":30,"periodAsked":30,"coverage":{"seen":420,"notForSale":8,"rows":412,"withBarcode":400,"withCost":380,"withStockTracking":412,"withSales":350,"withAvailability":412},"availability":{"measured":true,"daysObserved":30,"firstDay":"2026-09-27"},"warnings":["Waste is not recorded in this source, so the figures assume none."]}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you. `refused.demo`: This is a public demo, and that part is switched off.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh","refused.demo"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`source.none`: No source is connected to this shop. `report.empty`: That came back with nothing in it.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["source.none","report.empty"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"422":{"description":"`source.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["source.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute. `source.busy`: That is a lot of reads from this source in one hour.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited","source.busy"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"502":{"description":"`report.failed`: That report could not be worked out.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["report.failed"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/shops/{id}/shopify/reports":{"post":{"operationId":"shopify.report","summary":"Read the shop's Shopify and file it as a report.","description":"Reads the source again (never a plan you send back) and files the result as the category's next report, through the same pipeline as an upload. An earlier report read from the same source on the same day is replaced. Needs the sheet ability over the whole shop, and is written to the audit log. Read the plan first and tell the person its warnings. Send an Idempotency-Key header so a retry never files it twice. Needs the sheet ability.","tags":["shops"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Any string up to 255 characters, new for each new request. The same key with the same body within 24 hours answers with the first answer again and creates nothing; the same key with another body is refused with 409.","schema":{"type":"string","maxLength":255}}],"responses":{"201":{"description":"Read the shop's Shopify and file it as a report.","content":{"application/json":{"schema":{"type":"object","properties":{"reportId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The new report's id."},"categoryId":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The category it was filed under."},"shopId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The shop."},"category":{"type":"string","description":"The category's name."},"rows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many products the report holds."},"fixes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many values the cleaner repaired or worked out on the way in."},"plan":{"type":"object","properties":{"shopName":{"type":"string","description":"The Shopify shop's name."},"currency":{"type":"string","description":"Its currency."},"windowDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Days the report covers. Never longer than the source will serve."},"periodAsked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The period the category was set up with, when it differs."},"category":{"type":"string","description":"The category the report would be filed under."},"coverage":{"type":"object","properties":{"seen":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Products the source returned, before anything was left out."},"notForSale":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Left out because they are drafts or archived."},"rows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows the report will carry."},"withBarcode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows with a barcode."},"withCost":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows with a cost price."},"withStockTracking":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows whose stock is tracked."},"withSales":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows that sold at least one piece in the period."},"withAvailability":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows with a measured count of days out of stock."}},"required":["seen","notForSale","rows","withBarcode","withCost","withStockTracking","withSales","withAvailability"],"additionalProperties":false,"description":"How much of what the report needs the source holds."},"availability":{"type":"object","properties":{"measured":{"type":"boolean","description":"True when days out of stock were measured."},"daysObserved":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Over how many days of history."},"firstDay":{"description":"The first day observed, or null.","type":["string","null"]}},"required":["measured","daysObserved","firstDay"],"additionalProperties":false,"description":"Whether days out of stock were measured. Fewer days than the window make every count a floor."},"warnings":{"type":"array","items":{"type":"string"},"description":"Everything to know before trusting the figures, in full sentences, in the order they matter."},"types":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"The product type."},"variants":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Its variants."}},"required":["label","variants"],"additionalProperties":false},"description":"Every product type on offer, with its count of variants."},"orders":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Orders in the window."}},"required":["shopName","currency","windowDays","periodAsked","category","coverage","availability","warnings","types","orders"],"additionalProperties":false,"description":"What was read, as the plan describes it."}},"required":["reportId","categoryId","shopId","category","rows","fixes","plan"],"additionalProperties":false},"example":{"reportId":311,"categoryId":40,"shopId":12,"category":"Beverages","rows":412,"fixes":37,"plan":{"shopName":"Harbour Online","currency":"EUR","category":"Beverages","types":[{"label":"Beverages","variants":412}],"orders":1840,"windowDays":30,"periodAsked":30,"coverage":{"seen":420,"notForSale":8,"rows":412,"withBarcode":400,"withCost":380,"withStockTracking":412,"withSales":350,"withAvailability":412},"availability":{"measured":true,"daysObserved":30,"firstDay":"2026-09-27"},"warnings":["Waste is not recorded in this source, so the figures assume none."]}}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you. `refused.demo`: This is a public demo, and that part is switched off.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh","refused.demo"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`source.none`: No source is connected to this shop. `report.empty`: That came back with nothing in it. `api.idempotency_conflict`: That Idempotency-Key was already used for a different request. `api.idempotency_busy`: The first request with that Idempotency-Key is still running.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["source.none","report.empty","api.idempotency_conflict","api.idempotency_busy"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"422":{"description":"`source.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["source.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute. `source.busy`: That is a lot of reads from this source in one hour.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited","source.busy"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"502":{"description":"`report.failed`: That report could not be worked out.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["report.failed"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"productType":{"description":"Only this Shopify product type. Left out, the whole shop.","type":"string","maxLength":200}},"additionalProperties":false},"example":{"productType":"Beverages"}}}}}},"/v1/shops/{id}/netvisor/plan":{"get":{"operationId":"netvisor.plan","summary":"What a report read from the shop's Netvisor would hold, before anything is written.","description":"Reads the source and describes what a report would hold, with every gap in full sentences, and writes nothing. Thirty plans and reports an hour per person and source, as in the app. Needs the figures ability.","tags":["shops"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}},{"name":"productGroup","in":"query","required":false,"description":"Only this Netvisor product group. Left out, the whole company.","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"What a report read from the shop's Netvisor would hold, before anything is written.","content":{"application/json":{"schema":{"type":"object","properties":{"companyName":{"type":"string","description":"The Netvisor company's name."},"windowDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Days the report covers. Never longer than the source will serve."},"periodAsked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The period the category was set up with, when it differs."},"category":{"type":"string","description":"The category the report would be filed under."},"coverage":{"type":"object","properties":{"seen":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Products the source returned, before anything was left out."},"notForSale":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Left out because they are drafts or archived."},"rows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows the report will carry."},"withBarcode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows with a barcode."},"withCost":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows with a cost price."},"withStockTracking":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows whose stock is tracked."},"withSales":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows that sold at least one piece in the period."},"withAvailability":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows with a measured count of days out of stock."}},"required":["seen","notForSale","rows","withBarcode","withCost","withStockTracking","withSales","withAvailability"],"additionalProperties":false,"description":"How much of what the report needs the source holds."},"availability":{"type":"object","properties":{"measured":{"type":"boolean","description":"True when days out of stock were measured."},"daysObserved":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Over how many days of history."},"firstDay":{"description":"The first day observed, or null.","type":["string","null"]}},"required":["measured","daysObserved","firstDay"],"additionalProperties":false,"description":"Whether days out of stock were measured. Fewer days than the window make every count a floor."},"warnings":{"type":"array","items":{"type":"string"},"description":"Everything to know before trusting the figures, in full sentences, in the order they matter."},"groups":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"The product group."},"products":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Its products."}},"required":["label","products"],"additionalProperties":false},"description":"Every product group on offer, with its count of products."},"invoices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Sales invoices in the window."}},"required":["companyName","windowDays","periodAsked","category","coverage","availability","warnings","groups","invoices"],"additionalProperties":false},"example":{"companyName":"Harbour Oy","category":"Beverages","groups":[{"label":"Beverages","products":412}],"invoices":920,"windowDays":30,"periodAsked":30,"coverage":{"seen":420,"notForSale":8,"rows":412,"withBarcode":400,"withCost":380,"withStockTracking":412,"withSales":350,"withAvailability":412},"availability":{"measured":true,"daysObserved":30,"firstDay":"2026-09-27"},"warnings":["Waste is not recorded in this source, so the figures assume none."]}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you. `refused.demo`: This is a public demo, and that part is switched off.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh","refused.demo"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`source.none`: No source is connected to this shop. `report.empty`: That came back with nothing in it.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["source.none","report.empty"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"422":{"description":"`source.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["source.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute. `source.busy`: That is a lot of reads from this source in one hour.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited","source.busy"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"502":{"description":"`report.failed`: That report could not be worked out.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["report.failed"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/shops/{id}/netvisor/reports":{"post":{"operationId":"netvisor.report","summary":"Read the shop's Netvisor and file it as a report.","description":"Reads the source again (never a plan you send back) and files the result as the category's next report, through the same pipeline as an upload. An earlier report read from the same source on the same day is replaced. Needs the sheet ability over the whole shop, and is written to the audit log. Read the plan first and tell the person its warnings. Send an Idempotency-Key header so a retry never files it twice. Needs the sheet ability.","tags":["shops"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}},{"name":"Idempotency-Key","in":"header","required":false,"description":"Any string up to 255 characters, new for each new request. The same key with the same body within 24 hours answers with the first answer again and creates nothing; the same key with another body is refused with 409.","schema":{"type":"string","maxLength":255}}],"responses":{"201":{"description":"Read the shop's Netvisor and file it as a report.","content":{"application/json":{"schema":{"type":"object","properties":{"reportId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The new report's id."},"categoryId":{"anyOf":[{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},{"type":"null"}],"description":"The category it was filed under."},"shopId":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The shop."},"category":{"type":"string","description":"The category's name."},"rows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many products the report holds."},"fixes":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"How many values the cleaner repaired or worked out on the way in."},"plan":{"type":"object","properties":{"companyName":{"type":"string","description":"The Netvisor company's name."},"windowDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Days the report covers. Never longer than the source will serve."},"periodAsked":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The period the category was set up with, when it differs."},"category":{"type":"string","description":"The category the report would be filed under."},"coverage":{"type":"object","properties":{"seen":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Products the source returned, before anything was left out."},"notForSale":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Left out because they are drafts or archived."},"rows":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows the report will carry."},"withBarcode":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows with a barcode."},"withCost":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows with a cost price."},"withStockTracking":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows whose stock is tracked."},"withSales":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows that sold at least one piece in the period."},"withAvailability":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Rows with a measured count of days out of stock."}},"required":["seen","notForSale","rows","withBarcode","withCost","withStockTracking","withSales","withAvailability"],"additionalProperties":false,"description":"How much of what the report needs the source holds."},"availability":{"type":"object","properties":{"measured":{"type":"boolean","description":"True when days out of stock were measured."},"daysObserved":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Over how many days of history."},"firstDay":{"description":"The first day observed, or null.","type":["string","null"]}},"required":["measured","daysObserved","firstDay"],"additionalProperties":false,"description":"Whether days out of stock were measured. Fewer days than the window make every count a floor."},"warnings":{"type":"array","items":{"type":"string"},"description":"Everything to know before trusting the figures, in full sentences, in the order they matter."},"groups":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","description":"The product group."},"products":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Its products."}},"required":["label","products"],"additionalProperties":false},"description":"Every product group on offer, with its count of products."},"invoices":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Sales invoices in the window."}},"required":["companyName","windowDays","periodAsked","category","coverage","availability","warnings","groups","invoices"],"additionalProperties":false,"description":"What was read, as the plan describes it."}},"required":["reportId","categoryId","shopId","category","rows","fixes","plan"],"additionalProperties":false},"example":{"reportId":311,"categoryId":40,"shopId":12,"category":"Beverages","rows":412,"fixes":37,"plan":{"companyName":"Harbour Oy","category":"Beverages","groups":[{"label":"Beverages","products":412}],"invoices":920,"windowDays":30,"periodAsked":30,"coverage":{"seen":420,"notForSale":8,"rows":412,"withBarcode":400,"withCost":380,"withStockTracking":412,"withSales":350,"withAvailability":412},"availability":{"measured":true,"daysObserved":30,"firstDay":"2026-09-27"},"warnings":["Waste is not recorded in this source, so the figures assume none."]}}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you. `refused.demo`: This is a public demo, and that part is switched off.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh","refused.demo"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`source.none`: No source is connected to this shop. `report.empty`: That came back with nothing in it. `api.idempotency_conflict`: That Idempotency-Key was already used for a different request. `api.idempotency_busy`: The first request with that Idempotency-Key is still running.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["source.none","report.empty","api.idempotency_conflict","api.idempotency_busy"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"422":{"description":"`source.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["source.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute. `source.busy`: That is a lot of reads from this source in one hour.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited","source.busy"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"502":{"description":"`report.failed`: That report could not be worked out.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["report.failed"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"productGroup":{"description":"Only this Netvisor product group. Left out, the whole company.","type":"string","maxLength":200}},"additionalProperties":false},"example":{"productGroup":"Beverages"}}}}}},"/v1/shops/{id}/shopify/products":{"get":{"operationId":"shopify.products","summary":"The products in the shop's Shopify, fifty at a time, as the Sources page lists them.","description":"By title. Each call first lets the copy of the Shopify data catch up for a few seconds, at most 120 times an hour per person, so the list is fresh without spending the shop's own Shopify allowance. Needs the figures ability.","tags":["shops"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}},{"name":"q","in":"query","required":false,"description":"Only the rows whose title, SKU or barcode (orders: name) contain this.","schema":{"type":"string","maxLength":120}},{"name":"cursor","in":"query","required":false,"description":"The `nextCursor` of the page before.","schema":{"type":"string","maxLength":500}}],"responses":{"200":{"description":"The products in the shop's Shopify, fifty at a time, as the Sources page lists them.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"variantId":{"type":"string","description":"Shopify's variant id."},"title":{"type":"string","description":"The product and variant title."},"sku":{"type":"string","description":"The SKU, or empty."},"barcode":{"type":"string","description":"The barcode, or empty."},"productType":{"type":"string","description":"The Shopify product type, or empty."},"status":{"type":"string","description":"active, draft or archived."},"price":{"type":"number","description":"The price."},"cost":{"description":"The cost price, or null.","type":["number","null"]},"stock":{"type":"number","description":"Pieces in stock."},"tracked":{"type":"boolean","description":"True when Shopify tracks its stock."}},"required":["variantId","title","sku","barcode","productType","status","price","cost","stock","tracked"],"additionalProperties":false},"description":"Up to fifty rows."},"nextCursor":{"description":"Send it as `cursor` for the next page. Null on the last page.","type":["string","null"]},"currency":{"type":"string","description":"The shop's currency."}},"required":["data","nextCursor","currency"],"additionalProperties":false},"example":{"data":[{"variantId":"4410001","title":"Oat milk 1 l","sku":"OAT-1","barcode":"6410000000017","productType":"Beverages","status":"active","price":2.49,"cost":1.2,"stock":14,"tracked":true}],"nextCursor":null,"currency":"EUR"}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`source.none`: No source is connected to this shop.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["source.none"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/shops/{id}/shopify/orders":{"get":{"operationId":"shopify.orders","summary":"The orders in the shop's Shopify, newest first, fifty at a time.","description":"As the Sources page lists them. Each call first lets the copy of the Shopify data catch up for a few seconds, at most 120 times an hour per person. Needs the figures ability.","tags":["shops"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}},{"name":"q","in":"query","required":false,"description":"Only the rows whose title, SKU or barcode (orders: name) contain this.","schema":{"type":"string","maxLength":120}},{"name":"cursor","in":"query","required":false,"description":"The `nextCursor` of the page before.","schema":{"type":"string","maxLength":500}}],"responses":{"200":{"description":"The orders in the shop's Shopify, newest first, fifty at a time.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"orderId":{"type":"string","description":"Shopify's order id."},"name":{"type":"string","description":"The order's name, such as 1001."},"createdAt":{"type":"string","description":"When it was placed."},"financialStatus":{"type":"string","description":"Shopify's payment status."},"cancelledAt":{"description":"When it was cancelled, or null.","type":["string","null"]},"subtotal":{"type":"number","description":"Its subtotal."},"itemCount":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Pieces in it."},"currency":{"type":"string","description":"Its currency."}},"required":["orderId","name","createdAt","financialStatus","cancelledAt","subtotal","itemCount","currency"],"additionalProperties":false},"description":"Up to fifty rows."},"nextCursor":{"description":"Send it as `cursor` for the next page. Null on the last page.","type":["string","null"]},"currency":{"type":"string","description":"The shop's currency."}},"required":["data","nextCursor","currency"],"additionalProperties":false},"example":{"data":[{"orderId":"5500001","name":"Order 1001","createdAt":"2026-10-20T08:00:00.000Z","financialStatus":"paid","cancelledAt":null,"subtotal":24.9,"itemCount":6,"currency":"EUR"}],"nextCursor":null,"currency":"EUR"}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`source.none`: No source is connected to this shop.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["source.none"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/shops/{id}/shopify/drafts":{"get":{"operationId":"shopify.drafts","summary":"The draft orders in the shop's Shopify from the last 90 days.","description":"Read live from Shopify, as the Sources page does. At most 120 reads an hour per person. Needs the figures ability.","tags":["shops"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}}],"responses":{"200":{"description":"The draft orders in the shop's Shopify from the last 90 days.","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","description":"The draft's name."},"createdAt":{"type":"string","description":"When it was made."},"items":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Pieces in it."},"subtotal":{"type":"number","description":"Its subtotal."},"status":{"type":"string","description":"Shopify's status for it."}},"required":["name","createdAt","items","subtotal","status"],"additionalProperties":false},"description":"The draft orders of the last 90 days."},"currency":{"type":"string","description":"The shop's currency."},"capped":{"type":"boolean","description":"True when there were more than could be read, so these are the newest only."},"windowDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"Always 90."}},"required":["data","currency","capped","windowDays"],"additionalProperties":false},"example":{"data":[{"name":"Draft 12","createdAt":"2026-10-20T08:00:00.000Z","items":3,"subtotal":12.5,"status":"open"}],"currency":"EUR","capped":false,"windowDays":90}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`source.none`: No source is connected to this shop.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["source.none"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute. `source.busy`: That is a lot of reads from this source in one hour.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited","source.busy"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"502":{"description":"`source.unreachable`: That source is not answering.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["source.unreachable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}},"/v1/shops/{id}/source-refresh":{"post":{"operationId":"sources.refresh","summary":"Read the shop's connected Shopify and Netvisor again now.","description":"The Sources page's Refresh button. Needs the shops ability over the shop. It catches the copy of the source's data up for at most ten seconds per source and changes no figures by itself; file a report to use what it read. Needs the shops ability.","tags":["shops"],"parameters":[{"name":"id","in":"path","required":true,"description":"The id in the path.","schema":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647}}],"responses":{"200":{"description":"Read the shop's connected Shopify and Netvisor again now.","content":{"application/json":{"schema":{"type":"object","properties":{"refreshed":{"type":"array","items":{"type":"string","enum":["Shopify","Netvisor"]},"description":"The sources read again."},"at":{"type":"string","format":"date-time","pattern":"^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$","description":"When, in UTC."}},"required":["refreshed","at"],"additionalProperties":false},"example":{"refreshed":["Shopify"],"at":"2026-10-27T08:00:00.000Z"}}}},"400":{"description":"`api.invalid`: The field is missing or not valid.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.invalid"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"401":{"description":"`api.key_missing`: This call carried no API key. `api.key_refused`: That API key is not a live key. `api.wrong_key_kind`: This key does not open these endpoints.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.key_missing","api.key_refused","api.wrong_key_kind"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"403":{"description":"`refused`: You do not have permission to do that. `auth.not_fresh`: This step needs you to prove it is you. `refused.demo`: This is a public demo, and that part is switched off.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["refused","auth.not_fresh","refused.demo"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"404":{"description":"`not_found.said`: ","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["not_found.said"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"409":{"description":"`source.none`: No source is connected to this shop. `source.disconnected`: Every connection here is disconnected or needs reconnecting.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["source.none","source.disconnected"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"429":{"description":"`api.rate_limited`: This key made too many calls in one minute.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["api.rate_limited"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"500":{"description":"`server`: Something went wrong on our side.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["server"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"502":{"description":"`source.unreachable`: That source is not answering.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["source.unreachable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}},"503":{"description":"`developer.unavailable`: API keys are not set up on this deployment yet.","content":{"application/json":{"schema":{"type":"object","required":["code","error","requestId"],"properties":{"code":{"type":"string","description":"The stable code. Read this, not the sentence.","enum":["developer.unavailable"]},"error":{"type":"string","description":"The code's sentence, for a person reading along."},"requestId":{"type":["string","null"],"description":"Set when the fault is ours; quote it when you report it."},"detail":{"type":["string","null"],"description":"For `api.invalid`, the field that was refused."}}}}}}}}}}}