{"openapi":"3.0.3","info":{"title":"Ajour Public API","version":"1.0.0","description":"Read your Ajour sales, products and report figures. The API is read-only. Every number matches the Ajour dashboard and reports.\n\nAll calls need an API key. Create one in the Ajour back office under Settings → API keys.","contact":{"name":"Ajour","url":"https://docs.ajour.dk"}},"servers":[{"url":"https://api.ajour.dk/v1","description":"Production"}],"security":[{"apiKey":[]}],"tags":[{"name":"Company and catalog","description":"Who the key belongs to, and the lists you filter by."},{"name":"Sales","description":"Key figures, breakdowns and raw sales lines."},{"name":"Reports","description":"The same PDF and Excel reports as in the back office."}],"paths":{"/company":{"get":{"operationId":"getCompany","tags":["Company and catalog"],"summary":"Get the company that owns the key","description":"Returns the company the API key belongs to, and the key's own scopes and locations. Works with any scope. Use it as your first test call.","responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Company"},"example":{"id":412,"name":"Café Nørrebro ApS","cvr":"12345678","currency":"DKK","timeZone":"Europe/Copenhagen","workHours":{"start":"07:00","end":"23:00"},"key":{"keyId":"7Kq2Vx9b","scopes":["catalog:read","sales:read"],"locationIds":null}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/locations":{"get":{"operationId":"listLocations","tags":["Company and catalog"],"summary":"List locations","description":"The company's locations (shops) that the key can see. Deleted locations are left out. `lastSyncedAt` is the time of the newest sales upload from that location, so you can see how fresh the data is. Requires scope `catalog:read`.","responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","description":"A page of locations.","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Location"}},"nextCursor":{"type":"string","nullable":true,"description":"Pass as `cursor` to get the next page. `null` on the last page."}}},"example":{"data":[{"id":1031,"name":"Nørrebrogade","lastSyncedAt":"2026-11-22T16:05:12Z"},{"id":1032,"name":"Vesterbro","lastSyncedAt":"2026-11-22T15:58:40Z"}],"nextCursor":null}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/product-groups":{"get":{"operationId":"listProductGroups","tags":["Company and catalog"],"summary":"List product groups","description":"Product groups with their POS number as `id`. Use `updatedSince` to copy only changes. Requires scope `catalog:read`.","parameters":[{"$ref":"#/components/parameters/updatedSince"},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","description":"A page of product groups.","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ProductGroup"}},"nextCursor":{"type":"string","nullable":true,"description":"Pass as `cursor` to get the next page. `null` on the last page."}}},"example":{"data":[{"id":"10","name":"Kaffe","updatedAt":"2026-09-02T08:11:00+02:00"},{"id":"20","name":"Kage","updatedAt":"2026-10-14T12:30:00+02:00"}],"nextCursor":"eyJpZCI6IjIwIn0"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/products":{"get":{"operationId":"listProducts","tags":["Company and catalog"],"summary":"List products","description":"The product catalogue with prices from the Ajour back office. `stock` is filled only when the product tracks stock. Requires scope `catalog:read`.","parameters":[{"name":"productGroupId","in":"query","description":"Only products in this product group (POS number).","schema":{"type":"string"},"example":"10"},{"$ref":"#/components/parameters/updatedSince"},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","description":"A page of products.","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"nextCursor":{"type":"string","nullable":true,"description":"Pass as `cursor` to get the next page. `null` on the last page."}}},"example":{"data":[{"id":"1001","name":"Cappuccino","productGroupId":"10","kind":"single","salesPrice":42,"costPrice":9.5,"vatPercent":25,"barcode":null,"trackStock":false,"stock":null,"updatedAt":"2026-11-03T10:02:00+01:00"}],"nextCursor":null}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/products/{productId}":{"get":{"operationId":"getProduct","tags":["Company and catalog"],"summary":"Get one product","description":"One product by its POS number. Same shape as one item in the product list. Returns `404` if the number is unknown for this company. Requires scope `catalog:read`.","parameters":[{"name":"productId","in":"path","required":true,"description":"POS product number.","schema":{"type":"string"},"example":"1001"}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"},"example":{"id":"1001","name":"Cappuccino","productGroupId":"10","kind":"single","salesPrice":42,"costPrice":9.5,"vatPercent":25,"barcode":null,"trackStock":false,"stock":null,"updatedAt":"2026-11-03T10:02:00+01:00"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/salespersons":{"get":{"operationId":"listSalespersons","tags":["Company and catalog"],"summary":"List salesperson names","description":"The salesperson names found on sales in the key's locations. Registers store names, not ids, so use the name in the `salesperson` filter. Requires scope `sales:read`.","responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","description":"A page of salesperson names.","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Salesperson"}},"nextCursor":{"type":"string","nullable":true,"description":"Pass as `cursor` to get the next page. `null` on the last page."}}},"example":{"data":[{"name":"Anna"},{"name":"Mikkel"}],"nextCursor":null}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/sales/summary":{"get":{"operationId":"getSalesSummary","tags":["Sales"],"summary":"Get key figures for a period","description":"The same key figures as the cards on the Ajour dashboard. Add `compare=previousYear` to also get last year's figures for the same weekdays, aligned the same way as the dashboard. The period can be at most 366 days. Requires scope `sales:read`.","parameters":[{"$ref":"#/components/parameters/from"},{"$ref":"#/components/parameters/to"},{"$ref":"#/components/parameters/locationId"},{"$ref":"#/components/parameters/productGroupId"},{"$ref":"#/components/parameters/productId"},{"$ref":"#/components/parameters/orderType"},{"$ref":"#/components/parameters/salesperson"},{"$ref":"#/components/parameters/vat"},{"name":"metrics","in":"query","description":"Only return these figures. Leave out to get all.","style":"form","explode":true,"schema":{"type":"array","items":{"$ref":"#/components/schemas/MetricName"}}},{"$ref":"#/components/parameters/compare"}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SalesSummary"},"example":{"period":{"from":"2026-11-01","to":"2026-11-21"},"currency":"DKK","vat":"include","metrics":{"totalTurnover":486210.5,"posTurnover":451900,"onlineTurnover":34310.5,"transactions":6120,"averageTransaction":79.45,"discount":8120,"returns":1340,"contributionMargin":301455.2,"contributionMarginPercent":62},"previousYear":{"period":{"from":"2025-11-02","to":"2025-11-22"},"metrics":{"totalTurnover":441870,"transactions":5893}}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableContent"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/sales/breakdown":{"get":{"operationId":"getSalesBreakdown","tags":["Sales"],"summary":"Get sales grouped by one dimension","description":"One endpoint for every dashboard chart and report table. `groupBy` picks the dimension. Rows are sorted by turnover, highest first. Time groupings (`hour`, `weekday`, `day`, `month`) are sorted by time instead. `hour` only returns the company's work hours, like the dashboard. The period can be at most 366 days. Requires scope `sales:read`.","parameters":[{"name":"groupBy","in":"query","required":true,"description":"The dimension to group by.","schema":{"$ref":"#/components/schemas/GroupBy"},"example":"productGroup"},{"$ref":"#/components/parameters/from"},{"$ref":"#/components/parameters/to"},{"$ref":"#/components/parameters/locationId"},{"$ref":"#/components/parameters/productGroupId"},{"$ref":"#/components/parameters/productId"},{"$ref":"#/components/parameters/orderType"},{"$ref":"#/components/parameters/salesperson"},{"$ref":"#/components/parameters/vat"},{"name":"limit","in":"query","description":"Return only the top N rows, for example the 10 most popular products.","schema":{"type":"integer","minimum":1,"maximum":1000}},{"$ref":"#/components/parameters/compare"}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SalesBreakdown"},"example":{"groupBy":"productGroup","period":{"from":"2026-11-01","to":"2026-11-21"},"currency":"DKK","vat":"include","rows":[{"key":"10","label":"Kaffe","quantity":7410,"turnover":288340,"share":59.3},{"key":"20","label":"Kage","quantity":3122,"turnover":121050,"share":24.9}],"total":{"quantity":12880,"turnover":486210.5}}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableContent"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/sales":{"get":{"operationId":"listSales","tags":["Sales"],"summary":"List sales lines","description":"Every receipt line, for when you build your own figures or copy data to a data warehouse. Lines with the same `receiptNumber` and `locationId` make one receipt. Sorted by date, then id. For a nightly copy, store the newest `syncedAt` you have and pass it as `syncedSince` next time. The period can be at most 92 days. Requires scope `sales:read`.","parameters":[{"$ref":"#/components/parameters/from"},{"$ref":"#/components/parameters/to"},{"$ref":"#/components/parameters/locationId"},{"$ref":"#/components/parameters/productGroupId"},{"$ref":"#/components/parameters/productId"},{"$ref":"#/components/parameters/orderType"},{"$ref":"#/components/parameters/salesperson"},{"$ref":"#/components/parameters/vat"},{"name":"syncedSince","in":"query","description":"Only lines uploaded to Ajour after this time.","schema":{"type":"string","format":"date-time"},"example":"2026-11-21T00:00:00Z"},{"$ref":"#/components/parameters/limit"},{"$ref":"#/components/parameters/cursor"}],"responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","description":"A page of sales lines.","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SaleLine"}},"nextCursor":{"type":"string","nullable":true,"description":"Pass as `cursor` to get the next page. `null` on the last page."}}},"example":{"data":[{"id":"88213904","locationId":1031,"date":"2026-11-21T08:14:52+01:00","receiptNumber":204511,"orderType":"pos","lineType":"product","product":{"id":"1001","name":"Cappuccino"},"productGroupId":"10","quantity":2,"unitPrice":42,"discount":0,"amountInclVat":84,"amountExclVat":67.2,"isReturn":false,"salesperson":"Anna","clientId":null,"syncedAt":"2026-11-21T08:20:03Z"}],"nextCursor":"eyJkIjoiMjAyNi0xMS0yMVQwODoxNDo1MiIsImkiOjg4MjEzOTA0fQ"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableContent"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/reports":{"get":{"operationId":"listReports","tags":["Reports"],"summary":"List report types","description":"Each report you can download, with its formats and the filters it accepts. Reports with customer card data show only when the key has the `customers:read` scope. Requires scope `reports:read`.","responses":{"200":{"description":"OK","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"RateLimit":{"$ref":"#/components/headers/RateLimit"},"RateLimit-Policy":{"$ref":"#/components/headers/RateLimit-Policy"}},"content":{"application/json":{"schema":{"type":"object","description":"The report types.","required":["data","nextCursor"],"properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ReportType"}},"nextCursor":{"type":"string","nullable":true,"description":"Pass as `cursor` to get the next page. `null` on the last page."}}},"example":{"data":[{"type":"total-sales","name":"Total sales","formats":["pdf","xlsx"],"filters":["locationId","productGroupId","productId","orderType"]},{"type":"sales-per-salesperson","name":"Sales per salesperson","formats":["pdf","xlsx"],"filters":["locationId","salesperson"]}],"nextCursor":null}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/TooManyRequests"}}}},"/reports/{reportType}":{"get":{"operationId":"getReport","tags":["Reports"],"summary":"Download a report as PDF or Excel","description":"Builds the report and returns the file: the same PDF or Excel file as in the Ajour back office. Choose the format with `format` or the `Accept` header. Large periods can take up to 90 seconds. Requires scope `reports:read`. `sales-per-client` and `client-card-balances` also need `customers:read`. At most 10 report files per minute per key.","parameters":[{"name":"reportType","in":"path","required":true,"description":"The report to build. See `GET /reports` for the list.","schema":{"$ref":"#/components/schemas/ReportTypeName"},"example":"total-sales"},{"name":"format","in":"query","description":"File format.","schema":{"type":"string","enum":["pdf","xlsx"],"default":"pdf"}},{"$ref":"#/components/parameters/from"},{"$ref":"#/components/parameters/to"},{"$ref":"#/components/parameters/locationId"},{"$ref":"#/components/parameters/productGroupId"},{"$ref":"#/components/parameters/productId"},{"$ref":"#/components/parameters/orderType"},{"$ref":"#/components/parameters/salesperson"},{"$ref":"#/components/parameters/vat"},{"name":"clientCode","in":"query","description":"Customer card code, for reports that use it. Needs `customers:read`.","schema":{"type":"string"}},{"name":"cardType","in":"query","description":"Customer card type, for reports that use it. Needs `customers:read`.","schema":{"type":"string"}}],"responses":{"200":{"description":"The report file.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Content-Disposition":{"description":"Suggested file name.","schema":{"type":"string"},"example":"attachment; filename=\"TotalSalesReport.xlsx\""}},"content":{"application/pdf":{"schema":{"type":"string","format":"binary"}},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{"schema":{"type":"string","format":"binary"}}}},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"$ref":"#/components/responses/UnprocessableContent"},"429":{"$ref":"#/components/responses/TooManyRequests"},"503":{"$ref":"#/components/responses/ReportTimeout"}}}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"ajr_live_<keyId>_<secret>","description":"An Ajour API key, sent as `Authorization: Bearer <key>`. Create keys in the Ajour back office under Settings → API keys. Each key has scopes: `catalog:read`, `sales:read`, `reports:read` and `customers:read`."}},"headers":{"X-Request-Id":{"description":"Unique id of this request. Quote it when you contact Ajour support.","schema":{"type":"string"},"example":"01JD3W6Y7P4T"},"RateLimit":{"description":"Requests left in the current window, and seconds until it resets.","schema":{"type":"string"},"example":"\"default\";r=117;t=42"},"RateLimit-Policy":{"description":"The rate limit policy for this key.","schema":{"type":"string"},"example":"\"default\";q=120;w=60"},"Retry-After":{"description":"Seconds to wait before you try again.","schema":{"type":"integer"},"example":18}},"parameters":{"from":{"name":"from","in":"query","required":true,"description":"First day of the period, as a local date in Europe/Copenhagen.","schema":{"type":"string","format":"date"},"example":"2026-11-01"},"to":{"name":"to","in":"query","required":true,"description":"Last day of the period, included. Local date in Europe/Copenhagen.","schema":{"type":"string","format":"date"},"example":"2026-11-21"},"locationId":{"name":"locationId","in":"query","description":"Only these locations. Repeat the parameter for more than one. Must be locations the key can see. Leave out for all of them.","style":"form","explode":true,"schema":{"type":"array","items":{"type":"integer"}},"example":[1031]},"productGroupId":{"name":"productGroupId","in":"query","description":"Only this product group (POS number).","schema":{"type":"string"}},"productId":{"name":"productId","in":"query","description":"Only these products (POS numbers). Repeat the parameter for more than one.","style":"form","explode":true,"schema":{"type":"array","items":{"type":"string"}}},"orderType":{"name":"orderType","in":"query","description":"Only these order types. Repeat the parameter for more than one.","style":"form","explode":true,"schema":{"type":"array","items":{"$ref":"#/components/schemas/OrderType"}}},"salesperson":{"name":"salesperson","in":"query","description":"Only this salesperson, by name as on the register.","schema":{"type":"string"}},"vat":{"name":"vat","in":"query","description":"Show money amounts including or excluding VAT.","schema":{"type":"string","enum":["include","exclude"],"default":"include"}},"compare":{"name":"compare","in":"query","description":"Add last year's figures for the same weekdays.","schema":{"type":"string","enum":["previousYear"]}},"updatedSince":{"name":"updatedSince","in":"query","description":"Only items changed after this time.","schema":{"type":"string","format":"date-time"},"example":"2026-11-01T00:00:00+01:00"},"limit":{"name":"limit","in":"query","description":"Items per page.","schema":{"type":"integer","minimum":1,"maximum":1000,"default":100}},"cursor":{"name":"cursor","in":"query","description":"The `nextCursor` value from the previous page.","schema":{"type":"string"}}},"responses":{"BadRequest":{"description":"A parameter has the wrong format, or an unknown value.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://docs.ajour.dk/errors/invalid-parameter","title":"Invalid parameter","status":400,"detail":"groupBy must be one of productGroup, product, location, salesperson, hour, weekday, day, month.","requestId":"01JD3W6Y7P4T","errors":{"groupBy":["Unknown value 'store'."]}}}}},"Unauthorized":{"description":"The API key is missing, wrong, revoked or expired.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://docs.ajour.dk/errors/unauthorized","title":"Unauthorized","status":401,"detail":"The API key is not valid.","requestId":"01JD3W6Y7P4T"}}}},"Forbidden":{"description":"The key is valid but does not have the scope this call needs, or the company is not active.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://docs.ajour.dk/errors/missing-scope","title":"Missing scope","status":403,"detail":"This call needs the scope sales:read.","requestId":"01JD3W6Y7P4T"}}}},"NotFound":{"description":"The item does not exist, or it is a location the key cannot see.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://docs.ajour.dk/errors/not-found","title":"Not found","status":404,"detail":"No product with id 9999.","requestId":"01JD3W6Y7P4T"}}}},"UnprocessableContent":{"description":"The parameters have the right format but are not allowed together.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://docs.ajour.dk/errors/date-range-too-long","title":"Date range is too long","status":422,"detail":"Sales lines allow at most 92 days. You asked for 120.","requestId":"01JD3W6Y7P4T","errors":{"to":["Must be at most 92 days after from."]}}}}},"TooManyRequests":{"description":"Too many requests for this key. Wait for `Retry-After` seconds.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"},"Retry-After":{"$ref":"#/components/headers/Retry-After"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://docs.ajour.dk/errors/rate-limited","title":"Too many requests","status":429,"detail":"This key may make 120 requests per minute. Try again in 18 seconds.","requestId":"01JD3W6Y7P4T"}}}},"ReportTimeout":{"description":"The report took longer than 90 seconds. Try again with a shorter period.","headers":{"X-Request-Id":{"$ref":"#/components/headers/X-Request-Id"}},"content":{"application/problem+json":{"schema":{"$ref":"#/components/schemas/ProblemDetails"},"example":{"type":"https://docs.ajour.dk/errors/report-timeout","title":"Report took too long","status":503,"detail":"The report took longer than 90 seconds. Try a shorter period.","requestId":"01JD3W6Y7P4T"}}}}},"schemas":{"ProblemDetails":{"type":"object","description":"An error in the RFC 9457 Problem Details format.","required":["type","title","status"],"properties":{"type":{"type":"string","format":"uri","description":"A link to a page that explains this error."},"title":{"type":"string","description":"Short summary of the error type."},"status":{"type":"integer","description":"The HTTP status code."},"detail":{"type":"string","description":"What went wrong in this request."},"requestId":{"type":"string","description":"Same as the `X-Request-Id` header."},"errors":{"type":"object","description":"Validation messages per parameter.","additionalProperties":{"type":"array","items":{"type":"string"}}}}},"Scope":{"type":"string","enum":["catalog:read","sales:read","reports:read","customers:read"]},"Company":{"type":"object","required":["id","name","currency","timeZone","key"],"properties":{"id":{"type":"integer","description":"Ajour company id."},"name":{"type":"string"},"cvr":{"type":"string","nullable":true,"description":"Danish company registration number (CVR)."},"currency":{"type":"string","description":"Currency of all money amounts.","example":"DKK"},"timeZone":{"type":"string","description":"Time zone of all local dates.","example":"Europe/Copenhagen"},"workHours":{"type":"object","nullable":true,"description":"Opening hours used by the hour breakdown.","properties":{"start":{"type":"string","example":"07:00"},"end":{"type":"string","example":"23:00"}}},"key":{"type":"object","description":"The API key used for this call.","required":["keyId","scopes"],"properties":{"keyId":{"type":"string","description":"Public key id, as shown in the back office."},"scopes":{"type":"array","items":{"$ref":"#/components/schemas/Scope"}},"locationIds":{"type":"array","nullable":true,"items":{"type":"integer"},"description":"Locations the key is limited to. `null` means all locations."}}}}},"Location":{"type":"object","required":["id","name"],"properties":{"id":{"type":"integer","description":"Ajour location id."},"name":{"type":"string"},"lastSyncedAt":{"type":"string","format":"date-time","nullable":true,"description":"Time of the newest sales upload from this location."}}},"ProductGroup":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string","description":"POS product group number."},"name":{"type":"string"},"updatedAt":{"type":"string","format":"date-time","nullable":true}}},"Product":{"type":"object","required":["id","name"],"properties":{"id":{"type":"string","description":"POS product number."},"name":{"type":"string"},"productGroupId":{"type":"string","nullable":true,"description":"POS product group number."},"kind":{"type":"string","description":"Product kind, for example `single`."},"salesPrice":{"type":"number","format":"double","description":"Sales price including VAT. In DKK, 2 decimals."},"costPrice":{"type":"number","format":"double","description":"Cost price. In DKK, 2 decimals.","nullable":true},"vatPercent":{"type":"number","description":"VAT rate in percent."},"barcode":{"type":"string","nullable":true},"trackStock":{"type":"boolean"},"stock":{"type":"number","nullable":true,"description":"Stock count. `null` when the product does not track stock."},"updatedAt":{"type":"string","format":"date-time","nullable":true}}},"Salesperson":{"type":"object","required":["name"],"properties":{"name":{"type":"string","description":"Name as on the register."}}},"OrderType":{"type":"string","enum":["pos","online","invoice"]},"GroupBy":{"type":"string","enum":["productGroup","product","location","salesperson","hour","weekday","day","month"]},"MetricName":{"type":"string","enum":["totalTurnover","posTurnover","onlineTurnover","transactions","averageTransaction","discount","returns","contributionMargin","contributionMarginPercent"]},"Period":{"type":"object","required":["from","to"],"properties":{"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"}}},"Metrics":{"type":"object","description":"Key figures. Only the requested metrics are present.","properties":{"totalTurnover":{"type":"number","format":"double","description":"All turnover. In DKK, 2 decimals."},"posTurnover":{"type":"number","format":"double","description":"Turnover from the registers. In DKK, 2 decimals."},"onlineTurnover":{"type":"number","format":"double","description":"Turnover from online orders. In DKK, 2 decimals."},"transactions":{"type":"integer","description":"Number of receipts."},"averageTransaction":{"type":"number","format":"double","description":"Average turnover per receipt. In DKK, 2 decimals."},"discount":{"type":"number","format":"double","description":"Total discount given. In DKK, 2 decimals."},"returns":{"type":"number","format":"double","description":"Total returns. In DKK, 2 decimals."},"contributionMargin":{"type":"number","format":"double","description":"Turnover minus cost price. In DKK, 2 decimals."},"contributionMarginPercent":{"type":"number","description":"Contribution margin as a percent of turnover."}}},"SalesSummary":{"type":"object","required":["period","currency","vat","metrics"],"properties":{"period":{"$ref":"#/components/schemas/Period"},"currency":{"type":"string","example":"DKK"},"vat":{"type":"string","enum":["include","exclude"]},"metrics":{"$ref":"#/components/schemas/Metrics"},"previousYear":{"type":"object","description":"Only when `compare=previousYear`.","properties":{"period":{"$ref":"#/components/schemas/Period"},"metrics":{"$ref":"#/components/schemas/Metrics"}}}}},"BreakdownRow":{"type":"object","required":["key","label","quantity","turnover"],"properties":{"key":{"type":"string","description":"Id of the row: POS number, location id, salesperson name, hour (`0`-`23`), weekday (`1`=Monday), date or month (`2026-11`)."},"label":{"type":"string","description":"Display name of the row."},"quantity":{"type":"number","description":"Units sold."},"turnover":{"type":"number","format":"double","description":"Turnover. In DKK, 2 decimals."},"share":{"type":"number","description":"Share of total turnover in percent."},"previousYear":{"type":"object","description":"Only when `compare=previousYear`.","properties":{"quantity":{"type":"number"},"turnover":{"type":"number","format":"double","description":"Turnover last year. In DKK, 2 decimals."}}}}},"SalesBreakdown":{"type":"object","required":["groupBy","period","currency","vat","rows","total"],"properties":{"groupBy":{"$ref":"#/components/schemas/GroupBy"},"period":{"$ref":"#/components/schemas/Period"},"currency":{"type":"string","example":"DKK"},"vat":{"type":"string","enum":["include","exclude"]},"rows":{"type":"array","items":{"$ref":"#/components/schemas/BreakdownRow"}},"total":{"type":"object","properties":{"quantity":{"type":"number"},"turnover":{"type":"number","format":"double","description":"Total turnover. In DKK, 2 decimals."}}}}},"SaleLine":{"type":"object","description":"One line on a receipt.","required":["id","locationId","date","receiptNumber","orderType","quantity"],"properties":{"id":{"type":"string","description":"Ajour sales line id."},"locationId":{"type":"integer"},"date":{"type":"string","format":"date-time","description":"Time of the sale, as written by the register."},"receiptNumber":{"type":"integer","description":"Lines with the same receipt number and location make one receipt."},"orderType":{"$ref":"#/components/schemas/OrderType"},"lineType":{"type":"string","description":"Kind of line, for example `product`."},"product":{"type":"object","nullable":true,"properties":{"id":{"type":"string","description":"POS product number."},"name":{"type":"string"}}},"productGroupId":{"type":"string","nullable":true},"quantity":{"type":"number"},"unitPrice":{"type":"number","format":"double","description":"Price per unit including VAT. In DKK, 2 decimals."},"discount":{"type":"number","format":"double","description":"Discount on this line. In DKK, 2 decimals."},"amountInclVat":{"type":"number","format":"double","description":"Line amount including VAT. In DKK, 2 decimals."},"amountExclVat":{"type":"number","format":"double","description":"Line amount excluding VAT. In DKK, 2 decimals."},"isReturn":{"type":"boolean"},"salesperson":{"type":"string","nullable":true},"clientId":{"type":"string","nullable":true,"description":"Customer card, if one was used."},"syncedAt":{"type":"string","format":"date-time","description":"Time the line was uploaded to Ajour."}}},"ReportTypeName":{"type":"string","enum":["total-sales","total-sales-per-date","total-sales-per-product-group","sales-per-date-and-time","sales-per-date-time-and-product","sales-per-salesperson","sales-per-salesperson-avg-sales-per-expedition","sales-returns-per-salesperson","turnover-per-guest","logbook-per-salesperson","sales-per-client","client-card-balances"]},"ReportType":{"type":"object","required":["type","name","formats","filters"],"properties":{"type":{"$ref":"#/components/schemas/ReportTypeName"},"name":{"type":"string"},"formats":{"type":"array","items":{"type":"string","enum":["pdf","xlsx"]}},"filters":{"type":"array","items":{"type":"string"},"description":"Query parameters this report uses."}}}}}}