{"openapi":"3.1.0","info":{"title":"Aurient API","version":"1","description":"Connect your website, online shop, reports, accounting software or your own apps to Aurient. Make a key under Admin → API."},"servers":[{"url":"https://api.aurient-gls.com/v1"}],"security":[{"apiKey":[]}],"paths":{"/quotes":{"post":{"operationId":"sales.createQuote","summary":"Create quote","description":"Create a quotation for a customer. It doesn't reserve stock. Prices default to list price; valid 14 days unless set.","tags":["Sales"],"x-aurient-kind":"write","x-aurient-permission":"sales.quote.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"customer":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"warehouse":{"description":"Defaults to the customer's usual warehouse","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"validUntil":{"description":"Defaults to 14 days from today","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"exchangeRate":{"description":"Foreign-currency documents only: 1 unit of the document currency in the base currency. Defaults to the rate for the date (Finance → Currencies); changing it needs finance.currency.manage","type":"number","exclusiveMinimum":0,"maximum":1000000000},"notes":{"type":"string","maxLength":2000},"rep":{"description":"Who the sale belongs to (a person's name, email or id). Defaults to the customer's rep, else whoever enters it; changing it needs sales.rep.change","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"lines":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"object","properties":{"item":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000},"unit":{"type":"string","minLength":1,"maxLength":20,"description":"Unit of measure code or name, e.g. CASE. Defaults to the item's purchase or sales unit; quantity and price on the line are per this unit"},"unitPrice":{"description":"Per line unit. Defaults to the price set for that unit, else the item list price x units","type":"number","minimum":0,"maximum":1000000000000},"discountPct":{"type":"number","minimum":0,"maximum":100},"description":{"type":"string","maxLength":255}},"required":["item","qty"]}}},"required":["customer","lines"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/quotes/{quote}/convert":{"post":{"operationId":"sales.convertQuote","summary":"Turn quote into order","description":"The customer said yes: create a sales order from an open quote (reserving stock) and mark the quote Won.","tags":["Sales"],"x-aurient-kind":"write","x-aurient-permission":"sales.order.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"quote","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Quote id or number, e.g. QT-301"},"description":"Quote id or number, e.g. QT-301"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/quotes/{quote}/lost":{"post":{"operationId":"sales.markQuoteLost","summary":"Mark quote as lost","description":"Record that the customer said no. The quote stays on file.","tags":["Sales"],"x-aurient-kind":"write","x-aurient-permission":"sales.quote.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","maxLength":80}},"required":[]}}}},"parameters":[{"name":"quote","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Quote id or number, e.g. QT-301"},"description":"Quote id or number, e.g. QT-301"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/sales-orders":{"post":{"operationId":"sales.createSalesOrder","summary":"Create sales order","description":"Confirm a customer order; stock is reserved immediately. Prices default to list price. Returns warnings (credit limit, low availability) that don't block the order.","tags":["Sales"],"x-aurient-kind":"write","x-aurient-permission":"sales.order.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"customer":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"warehouse":{"description":"Defaults to the customer's usual warehouse","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"requiredDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"customerRef":{"description":"Customer's own PO number","type":"string","maxLength":60},"exchangeRate":{"description":"Foreign-currency documents only: 1 unit of the document currency in the base currency. Defaults to the rate for the date (Finance → Currencies); changing it needs finance.currency.manage","type":"number","exclusiveMinimum":0,"maximum":1000000000},"notes":{"type":"string","maxLength":2000},"rep":{"description":"Who the sale belongs to (a person's name, email or id). Defaults to the customer's rep, else whoever enters it; changing it needs sales.rep.change","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"lines":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"object","properties":{"item":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000},"unit":{"type":"string","minLength":1,"maxLength":20,"description":"Unit of measure code or name, e.g. CASE. Defaults to the item's purchase or sales unit; quantity and price on the line are per this unit"},"unitPrice":{"description":"Per line unit. Defaults to the price set for that unit, else the item list price x units","type":"number","minimum":0,"maximum":1000000000000},"discountPct":{"type":"number","minimum":0,"maximum":100},"description":{"type":"string","maxLength":255}},"required":["item","qty"]}}},"required":["customer","lines"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/sales-orders/{salesOrder}":{"patch":{"operationId":"sales.updateSalesOrder","summary":"Edit sales order","description":"Change an open sales order that has not shipped anything: warehouse, required date, customer reference, notes or lines (lines are replaced).","tags":["Sales"],"x-aurient-kind":"write","x-aurient-permission":"sales.order.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"warehouse":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"requiredDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"customerRef":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"rep":{"description":"Who the sale belongs to (a person's name, email or id). Defaults to the customer's rep, else whoever enters it; changing it needs sales.rep.change","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"lines":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"object","properties":{"item":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000},"unit":{"type":"string","minLength":1,"maxLength":20,"description":"Unit of measure code or name, e.g. CASE. Defaults to the item's purchase or sales unit; quantity and price on the line are per this unit"},"unitPrice":{"description":"Per line unit. Defaults to the price set for that unit, else the item list price x units","type":"number","minimum":0,"maximum":1000000000000},"discountPct":{"type":"number","minimum":0,"maximum":100},"description":{"type":"string","maxLength":255}},"required":["item","qty"]}}},"required":[]}}}},"parameters":[{"name":"salesOrder","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/sales-orders/{salesOrder}/cancel":{"post":{"operationId":"sales.cancelSalesOrder","summary":"Cancel sales order","description":"Cancel an open order and release its reserved stock. A partly shipped order is closed instead (what shipped stays shipped).","tags":["Sales"],"x-aurient-kind":"write","x-aurient-permission":"sales.order.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"salesOrder","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Sales order id or number, e.g. SO-5531"},"description":"Sales order id or number, e.g. SO-5531"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/sales-orders/{salesOrder}/close-short":{"post":{"operationId":"sales.closeShort","summary":"Close a part-shipped order short","description":"For an order that has shipped some of its lines: stop shipping the rest and release the stock it reserved. backorder = put what was not shipped on a new order for the same customer (same prices), to ship when stock arrives.","tags":["Sales"],"x-aurient-kind":"write","x-aurient-permission":"sales.order.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"backorder":{"default":false,"type":"boolean"},"reason":{"type":"string","minLength":3,"maxLength":200}},"required":["reason"]}}}},"parameters":[{"name":"salesOrder","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Sales order id or number, e.g. SO-5531"},"description":"Sales order id or number, e.g. SO-5531"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/sales-orders/{salesOrder}/ship":{"post":{"operationId":"sales.ship","summary":"Ship order","description":"Post a shipment for an open sales order: stock leaves the warehouse at average cost. Omit lines to ship everything still to ship.","tags":["Sales"],"x-aurient-kind":"write","x-aurient-permission":"sales.order.ship","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"shipDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"lines":{"description":"Omit to ship everything still to ship","type":"array","items":{"type":"object","properties":{"item":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000,"description":"In the sales order line unit"},"lots":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"lot":{"type":"string","minLength":1,"maxLength":40,"description":"Lot / batch number"},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000,"description":"Quantity from this lot, in the line unit"}},"required":["lot","qty"]},"description":"Pick these lots instead of first-expiry-first-out"},"bin":{"type":"string","minLength":1,"maxLength":20,"description":"Bin code inside the warehouse, e.g. A-01"},"weight":{"description":"Catch-weight items: the actual weight shipped in the item base unit (e.g. kg); defaults to the nominal weight","type":"number","exclusiveMinimum":0,"maximum":1000000000}},"required":["item","qty"]}},"carrier":{"type":"string","maxLength":80},"trackingRef":{"type":"string","maxLength":80}},"required":[]}}}},"parameters":[{"name":"salesOrder","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Sales order id or number, e.g. SO-5531"},"description":"Sales order id or number, e.g. SO-5531"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/sales-orders/{salesOrder}/invoice":{"post":{"operationId":"sales.invoice","summary":"Invoice order","description":"Create and post the customer invoice for what has shipped but is not invoiced yet on a sales order: everything, or only the quantities given in lines (item and qty in the order's unit). Due date follows the customer terms.","tags":["Sales"],"x-aurient-kind":"write","x-aurient-permission":"sales.invoice.create","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"invoiceDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"exchangeRate":{"description":"Foreign-currency orders: the rate for the invoice (defaults to the rate on the invoice date)","type":"number","exclusiveMinimum":0,"maximum":1000000000},"lines":{"description":"Omit to invoice everything shipped and not invoiced yet","type":"array","items":{"type":"object","properties":{"item":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000,"description":"In the sales order line unit"}},"required":["item","qty"]}}},"required":[]}}}},"parameters":[{"name":"salesOrder","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Sales order id or number, e.g. SO-5531"},"description":"Sales order id or number, e.g. SO-5531"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/sales-orders/{salesOrder}/ship-and-invoice":{"post":{"operationId":"sales.shipAndInvoice","summary":"Ship and invoice","description":"Ship a sales order and invoice what was shipped in one step: everything left, or only the quantities given in lines.","tags":["Sales"],"x-aurient-kind":"write","x-aurient-permission":"sales.order.ship","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"shipDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"lines":{"description":"Omit to ship everything still to ship","type":"array","items":{"type":"object","properties":{"item":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000,"description":"In the sales order line unit"},"lots":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"lot":{"type":"string","minLength":1,"maxLength":40,"description":"Lot / batch number"},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000,"description":"Quantity from this lot, in the line unit"}},"required":["lot","qty"]},"description":"Pick these lots instead of first-expiry-first-out"},"bin":{"type":"string","minLength":1,"maxLength":20,"description":"Bin code inside the warehouse, e.g. A-01"},"weight":{"description":"Catch-weight items: the actual weight shipped in the item base unit (e.g. kg); defaults to the nominal weight","type":"number","exclusiveMinimum":0,"maximum":1000000000}},"required":["item","qty"]}},"carrier":{"type":"string","maxLength":80},"trackingRef":{"type":"string","maxLength":80},"invoiceDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":[]}}}},"parameters":[{"name":"salesOrder","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Sales order id or number, e.g. SO-5531"},"description":"Sales order id or number, e.g. SO-5531"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/invoices/{invoice}/void":{"post":{"operationId":"sales.voidInvoice","summary":"Void invoice","description":"Cancel a posted invoice that has no payments applied. The shipped goods can then be invoiced again.","tags":["Sales"],"x-aurient-kind":"write","x-aurient-permission":"sales.invoice.void","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":255}},"required":["reason"]}}}},"parameters":[{"name":"invoice","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/purchase-orders":{"post":{"operationId":"purchasing.createPurchaseOrder","summary":"Create purchase order","description":"Create a purchase order to a supplier for a warehouse. Unit costs default to the last cost from that supplier. send=false saves a draft (nothing is sent).","tags":["Purchasing"],"x-aurient-kind":"write","x-aurient-permission":"purchasing.po.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"supplier":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"warehouse":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Ship-to warehouse code, e.g. BGI"},"expectedDate":{"description":"Defaults to today + supplier lead time","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"supplierRef":{"type":"string","maxLength":60},"notes":{"type":"string","maxLength":2000},"lines":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"object","properties":{"item":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000},"unit":{"type":"string","minLength":1,"maxLength":20,"description":"Unit of measure code or name, e.g. CASE. Defaults to the item's purchase or sales unit; quantity and price on the line are per this unit"},"unitCost":{"description":"Per line unit. Defaults to the supplier cost, then the item standard cost","type":"number","minimum":0,"maximum":1000000000000},"description":{"type":"string","maxLength":255},"tax":{"description":"Tax rate code for this line (e.g. BB-VAT, ZERO). Defaults to the supplier's rate, else the item's","anyOf":[{"type":"string","maxLength":20},{"type":"null"}]}},"required":["item","qty"]}},"send":{"description":"true = send to supplier now; false = save as draft","anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"exchangeRate":{"description":"Foreign-currency documents only: 1 unit of the document currency in the base currency. Defaults to the rate for the date (Finance → Currencies); changing it needs finance.currency.manage","type":"number","exclusiveMinimum":0,"maximum":1000000000}},"required":["supplier","warehouse","lines"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/purchase-orders/{purchaseOrder}":{"patch":{"operationId":"purchasing.updatePurchaseOrder","summary":"Edit purchase order","description":"Change a draft or sent purchase order that has not received anything yet: supplier, warehouse, expected date, notes or lines (lines are replaced).","tags":["Purchasing"],"x-aurient-kind":"write","x-aurient-permission":"purchasing.po.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"version":{"description":"Version you loaded; refused if someone changed it since","type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"supplier":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"warehouse":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"expectedDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"supplierRef":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"lines":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"object","properties":{"item":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000},"unit":{"type":"string","minLength":1,"maxLength":20,"description":"Unit of measure code or name, e.g. CASE. Defaults to the item's purchase or sales unit; quantity and price on the line are per this unit"},"unitCost":{"description":"Per line unit. Defaults to the supplier cost, then the item standard cost","type":"number","minimum":0,"maximum":1000000000000},"description":{"type":"string","maxLength":255},"tax":{"description":"Tax rate code for this line (e.g. BB-VAT, ZERO). Defaults to the supplier's rate, else the item's","anyOf":[{"type":"string","maxLength":20},{"type":"null"}]}},"required":["item","qty"]}}},"required":[]}}}},"parameters":[{"name":"purchaseOrder","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/purchase-orders/{purchaseOrder}/send":{"post":{"operationId":"purchasing.sendPurchaseOrder","summary":"Send purchase order","description":"Mark a draft purchase order as sent to the supplier. It then counts as On order. If the company emails purchase orders automatically, it also goes to the supplier by email.","tags":["Purchasing"],"x-aurient-kind":"write","x-aurient-permission":"purchasing.po.send","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"purchaseOrder","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"PO id or number, e.g. PO-1042"},"description":"PO id or number, e.g. PO-1042"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/purchase-orders/{purchaseOrder}/cancel":{"post":{"operationId":"purchasing.cancelPurchaseOrder","summary":"Cancel purchase order","description":"Cancel a purchase order. Anything already received stays in stock; the rest will not arrive.","tags":["Purchasing"],"x-aurient-kind":"write","x-aurient-permission":"purchasing.po.send","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"purchaseOrder","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"PO id or number, e.g. PO-1042"},"description":"PO id or number, e.g. PO-1042"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/purchase-orders/{purchaseOrder}/receive":{"post":{"operationId":"purchasing.receive","summary":"Receive goods","description":"Post a goods receipt against a sent purchase order: stock goes up at the PO cost, the PO becomes partially/fully received, and (by default) the supplier bill is created. Omit lines to receive everything still due.","tags":["Purchasing"],"x-aurient-kind":"write","x-aurient-permission":"inventory.receive","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"receiptDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"deliveryNote":{"type":"string","maxLength":60},"lines":{"description":"What actually arrived. Omit to receive everything still due.","type":"array","items":{"type":"object","properties":{"item":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"qty":{"type":"number","minimum":0,"description":"In the purchase order line unit"},"lots":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"lot":{"description":"Lot / batch number; made from the document number when omitted","type":"string","minLength":1,"maxLength":40},"qty":{"description":"Quantity of this lot, in the line unit; omit with a single lot","type":"number","exclusiveMinimum":0,"maximum":1000000000},"expiry":{"description":"Expiry date (needed for items that track expiry, unless they have a shelf life)","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"supplierLot":{"type":"string","maxLength":40}}},"description":"Lots arriving (lot-tracked items)"},"bin":{"type":"string","minLength":1,"maxLength":20,"description":"Bin code inside the warehouse, e.g. A-01"}},"required":["item","qty"]}},"bin":{"description":"Bin everything goes into (warehouses that use bins); defaults to the item bin, then the receiving bin","type":"string","minLength":1,"maxLength":20},"createBill":{"description":"Create the supplier bill for what was received (as the prototype did)","anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"supplierInvoiceRef":{"type":"string","maxLength":60},"notes":{"type":"string","maxLength":2000}},"required":[]}}}},"parameters":[{"name":"purchaseOrder","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/purchase-orders/suggest":{"get":{"operationId":"purchasing.suggest","summary":"Suggest purchase order lines","description":"Suggested lines for a supplier's items that are below reorder point and not already on an open PO, with quantities and last costs. Use before create_purchase_order.","tags":["Purchasing"],"x-aurient-kind":"read","x-aurient-permission":"purchasing.po.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"supplier","in":"query","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"}]}},"/supplier-returns":{"post":{"operationId":"purchasing.returnToSupplier","summary":"Return to supplier","description":"Send goods back to a supplier: takes them out of stock and creates a supplier credit note you can offset against their bills.","tags":["Purchasing"],"x-aurient-kind":"write","x-aurient-permission":"purchasing.return.create","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"supplier":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"warehouse":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Warehouse the goods leave from"},"purchaseOrder":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"reason":{"type":"string","maxLength":80,"description":"Damaged, Wrong item, Expired or Over-delivered (code or label)"},"returnDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"notes":{"type":"string","maxLength":2000},"lines":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"item":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000},"unit":{"type":"string","minLength":1,"maxLength":20,"description":"Unit of measure code or name, e.g. CASE. Defaults to the item's purchase or sales unit; quantity and price on the line are per this unit"},"unitCost":{"type":"number","minimum":0,"maximum":1000000000000,"description":"Amount in the document currency"},"lots":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"lot":{"type":"string","minLength":1,"maxLength":40,"description":"Lot / batch number"},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000,"description":"Quantity from this lot, in the line unit"}},"required":["lot","qty"]},"description":"Pick these lots instead of first-expiry-first-out"},"bin":{"type":"string","minLength":1,"maxLength":20,"description":"Bin code inside the warehouse, e.g. A-01"}},"required":["item","qty"]}}},"required":["supplier","warehouse","reason","lines"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/gl/accounts":{"get":{"operationId":"gl.accounts.list","summary":"Chart of accounts","description":"The chart of accounts with each account's balance (as of a date) and net change in a period. Use to find an account number or see where money sits.","tags":["General ledger"],"x-aurient-kind":"read","x-aurient-permission":"gl.view.accounts","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"category","in":"query","required":false,"schema":{"type":"string","enum":["asset","liability","equity","income","cost_of_sales","expense"]}},{"name":"postingOnly","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},{"name":"includeBlocked","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},{"name":"from","in":"query","required":false,"schema":{"description":"Net change from this date","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"Net change from this date"},{"name":"to","in":"query","required":false,"schema":{"description":"Balance as of this date (default today)","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"Balance as of this date (default today)"}]},"post":{"operationId":"gl.accounts.create","summary":"Add G/L account","description":"Add an account to the chart of accounts (posting, heading or total account).","tags":["General ledger"],"x-aurient-kind":"write","x-aurient-permission":"gl.setup.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"no":{"type":"string","pattern":"^[0-9A-Z.-]{1,20}$","description":"Account number; it decides where the account sorts in the chart"},"name":{"type":"string","minLength":1,"maxLength":120},"accountType":{"default":"posting","type":"string","enum":["posting","heading","total","begin_total","end_total"]},"category":{"type":"string","enum":["asset","liability","equity","income","cost_of_sales","expense"]},"subcategory":{"type":"string","maxLength":60},"totaling":{"description":"Total accounts only: ranges such as 40000..49999","type":"string","maxLength":250},"indentation":{"type":"integer","minimum":0,"maximum":6},"directPosting":{"description":"false = control account; only documents may post to it","anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"reconciliation":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"description":{"description":"What belongs in this account, in plain words","type":"string","maxLength":500}},"required":["no","name","category"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/gl/accounts/{account}":{"get":{"operationId":"gl.accounts.get","summary":"G/L account","description":"One account: balance, monthly net change for the last 12 months, and its recent entries with a running balance and the documents behind them.","tags":["General ledger"],"x-aurient-kind":"read","x-aurient-permission":"gl.view.accounts","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"account","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"G/L account number (e.g. 61100) or name"},"description":"G/L account number (e.g. 61100) or name"},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}]},"patch":{"operationId":"gl.accounts.update","summary":"Edit G/L account","description":"Rename, block/unblock, describe, or change direct posting on an account. The category can only change while the account has no entries.","tags":["General ledger"],"x-aurient-kind":"write","x-aurient-permission":"gl.setup.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"subcategory":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"totaling":{"anyOf":[{"type":"string","maxLength":250},{"type":"null"}]},"indentation":{"type":"integer","minimum":0,"maximum":6},"directPosting":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"reconciliation":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"blocked":{"description":"true stops anything new posting to the account","anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"category":{"description":"Only allowed while the account has no entries","type":"string","enum":["asset","liability","equity","income","cost_of_sales","expense"]}},"required":[]}}}},"parameters":[{"name":"account","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"G/L account number (e.g. 61100) or name"},"description":"G/L account number (e.g. 61100) or name"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/gl/entries":{"get":{"operationId":"gl.entries","summary":"G/L entries","description":"General ledger entries filtered by account, dates, document, customer, supplier, warehouse or words. With an account, includes the running balance.","tags":["General ledger"],"x-aurient-kind":"read","x-aurient-permission":"gl.view.accounts","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"account","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"G/L account number (e.g. 61100) or name"},"description":"G/L account number (e.g. 61100) or name"},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"document","in":"query","required":false,"schema":{"description":"Document number, e.g. INV-8701","type":"string","maxLength":30},"description":"Document number, e.g. INV-8701"},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"supplier","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"q","in":"query","required":false,"schema":{"description":"Words in the entry description","type":"string","maxLength":100},"description":"Words in the entry description"},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}}]}},"/gl/trial-balance":{"get":{"operationId":"gl.trialBalance","summary":"Trial balance","description":"Every posting account with its opening balance, debits, credits and closing balance for a period (default: fiscal year to date). Debits always equal credits.","tags":["General ledger"],"x-aurient-kind":"read","x-aurient-permission":"gl.view.accounts","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"from","in":"query","required":false,"schema":{"description":"Defaults to the start of the fiscal year","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"Defaults to the start of the fiscal year"},{"name":"to","in":"query","required":false,"schema":{"description":"Defaults to today","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"Defaults to today"},{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"hideZero","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}}]}},"/gl/income-statement":{"get":{"operationId":"gl.incomeStatement","summary":"Income statement","description":"Profit and loss for a period (default: fiscal year to date): sales, cost of sales, gross profit, expenses and net profit, optionally against the previous period or year.","tags":["General ledger"],"x-aurient-kind":"read","x-aurient-permission":"gl.view.accounts","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"from","in":"query","required":false,"schema":{"description":"Defaults to the start of the fiscal year","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"Defaults to the start of the fiscal year"},{"name":"to","in":"query","required":false,"schema":{"description":"Defaults to today","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"Defaults to today"},{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"hideZero","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},{"name":"compare","in":"query","required":false,"schema":{"default":"none","type":"string","enum":["none","previous_period","previous_year"]}}]}},"/gl/balance-sheet":{"get":{"operationId":"gl.balanceSheet","summary":"Balance sheet","description":"Assets, liabilities and equity as of a date (default today), including this year's profit not yet closed to retained earnings. Assets always equal liabilities plus equity.","tags":["General ledger"],"x-aurient-kind":"read","x-aurient-permission":"gl.view.accounts","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"asOf","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"}]}},"/gl/document/{ref}":{"get":{"operationId":"gl.documentEntries","summary":"Find G/L entries","description":"Every G/L transaction a document produced (\"Find entries\" / \"Navigate\"): the entries, accounts, amounts, and for stock documents the inventory value entries and cost corrections.","tags":["General ledger"],"x-aurient-kind":"read","x-aurient-permission":["gl.view.accounts","gl.view.sales","gl.view.purchasing","gl.view.inventory","gl.view.pos","gl.view.finance"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"ref","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":40,"description":"Any document number: INV-8701, BILL-2290, SH-640, PAY-3150, JE-1004, GL-000123"},"description":"Any document number: INV-8701, BILL-2290, SH-640, PAY-3150, JE-1004, GL-000123"}]}},"/gl/transactions":{"get":{"operationId":"gl.transactions.list","summary":"G/L register","description":"Posted G/L transactions (the register): date, source (sales, purchases, inventory, journal...), document, amount, who or what posted it, and reversals.","tags":["General ledger"],"x-aurient-kind":"read","x-aurient-permission":"gl.view.accounts","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"source","in":"query","required":false,"schema":{"type":"string","enum":["SALES","PURCHASES","INVENTORY","CASHRECEIPT","PAYMENT","EXPENSE","GENJNL","REVERSAL","COSTADJ","REVALUATION","OPENING","CLOSE"]}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"filters","in":"query","required":false,"schema":{"description":"Column searches as JSON, e.g. [{\"k\":\"customer_name\",\"q\":\"best\"},{\"k\":\"total\",\"from\":10,\"to\":500},{\"k\":\"invoice_date\",\"from\":\"2026-01-01\",\"to\":\"2026-01-31\"},{\"k\":\"status_label\",\"in\":[\"Paid\",\"Unpaid\"]}]","type":"string","maxLength":4000},"description":"Column searches as JSON, e.g. [{\"k\":\"customer_name\",\"q\":\"best\"},{\"k\":\"total\",\"from\":10,\"to\":500},{\"k\":\"invoice_date\",\"from\":\"2026-01-01\",\"to\":\"2026-01-31\"},{\"k\":\"status_label\",\"in\":[\"Paid\",\"Unpaid\"]}]"},{"name":"sort","in":"query","required":false,"schema":{"description":"A field to sort by; put - in front for largest / newest / Z first, e.g. -total","type":"string","maxLength":60},"description":"A field to sort by; put - in front for largest / newest / Z first, e.g. -total"}]}},"/gl/reconciliation":{"get":{"operationId":"gl.reconciliation","summary":"Ledger checks","description":"Proves the ledger matches the business: customer balances vs receivables, supplier balances vs payables, stock value vs inventory accounts, debits = credits, and nothing waiting to post. Lists receipts not yet billed.","tags":["General ledger"],"x-aurient-kind":"read","x-aurient-permission":"gl.view.accounts","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/gl/journal-entries":{"post":{"operationId":"gl.journal.create","summary":"Journal entry","description":"Post (or save as a draft) a manual journal entry: accruals, prepayments, depreciation, reclassifications, corrections. Debits must equal credits. Control accounts (receivables, payables, inventory, bank) only take documents. reverseOn makes an accrual reverse itself automatically.","tags":["General ledger"],"x-aurient-kind":"write","x-aurient-permission":"gl.journal.post","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"date":{"description":"Posting date; defaults to today","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":{"type":"string","minLength":1,"maxLength":255},"lines":{"minItems":2,"maxItems":200,"type":"array","items":{"type":"object","properties":{"account":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"G/L account number (e.g. 61100) or name"},"debit":{"type":"number","minimum":0,"maximum":1000000000000},"credit":{"type":"number","minimum":0,"maximum":1000000000000},"description":{"type":"string","maxLength":255},"warehouse":{"description":"Warehouse dimension","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"costCenter":{"description":"Cost centre dimension code","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]}},"required":["account"]}},"reverseOn":{"description":"Accruals: reverse automatically on this date (e.g. the 1st of next month)","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"post":{"description":"false = save as a draft in the journal for someone to review and post","anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"externalRef":{"type":"string","maxLength":60}},"required":["description","lines"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/gl/journal-drafts":{"get":{"operationId":"gl.journal.drafts","summary":"Journal drafts","description":"Journal entries saved as drafts, waiting for someone to review and post them.","tags":["General ledger"],"x-aurient-kind":"read","x-aurient-permission":"gl.view.accounts","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/gl/journal-drafts/{entry}/post":{"post":{"operationId":"gl.journal.postDraft","summary":"Post journal draft","description":"Post a journal entry that was saved as a draft.","tags":["General ledger"],"x-aurient-kind":"write","x-aurient-permission":"gl.journal.post","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"entry","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":20,"description":"Draft entry key from the journal list"},"description":"Draft entry key from the journal list"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/gl/journal-drafts/{entry}":{"delete":{"operationId":"gl.journal.deleteDraft","summary":"Delete journal draft","description":"Throw away a journal draft that was never posted.","tags":["General ledger"],"x-aurient-kind":"write","x-aurient-permission":"gl.journal.post","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"entry","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":20,"description":"Draft entry key from the journal list"},"description":"Draft entry key from the journal list"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/gl/transactions/{transaction}/reverse":{"post":{"operationId":"gl.transactions.reverse","summary":"Reverse journal entry","description":"Reverse a posted manual journal entry with mirror entries. Postings from documents are corrected on the document instead (void the invoice, issue a credit note, return the goods).","tags":["General ledger"],"x-aurient-kind":"write","x-aurient-permission":"gl.journal.post","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"reason":{"type":"string","minLength":1,"maxLength":255}},"required":["reason"]}}}},"parameters":[{"name":"transaction","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":30,"description":"G/L transaction (GL-000123) or journal entry number (JE-1004)"},"description":"G/L transaction (GL-000123) or journal entry number (JE-1004)"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/gl/posting-setup":{"get":{"operationId":"gl.postingSetup.get","summary":"Posting setup","description":"How documents choose accounts: posting groups, the general posting setup (business x product group), inventory posting setup, bank, tax and expense-category accounts, and any combinations in use that are missing setup.","tags":["General ledger"],"x-aurient-kind":"read","x-aurient-permission":"gl.view.accounts","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/gl/posting-groups":{"put":{"operationId":"gl.postingGroups.upsert","summary":"Save posting group","description":"Create or update a posting group (business, product, customer, vendor, inventory or bank). Customer, vendor and bank groups need their account.","tags":["General ledger"],"x-aurient-kind":"write","x-aurient-permission":"gl.setup.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"kind":{"type":"string","enum":["business","product","customer","vendor","inventory","bank"]},"code":{"type":"string","pattern":"^[A-Z0-9_-]{1,20}$"},"description":{"type":"string","maxLength":100},"account":{"description":"customer: receivables; vendor: payables; bank: bank G/L account","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]}},"required":["kind","code"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/gl/posting-setup/general":{"put":{"operationId":"gl.postingSetup.general","summary":"Save general posting setup","description":"Set the accounts for a business group × product group combination: sales, sales credit, sales discount, purchase, cost of goods sold, inventory adjustment, goods received not invoiced.","tags":["General ledger"],"x-aurient-kind":"write","x-aurient-permission":"gl.setup.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"businessGroup":{"description":"Business group code; omit or null for the fallback row","anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"type":"null"}]},"productGroup":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"salesAccount":{"anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"G/L account number (e.g. 61100) or name"},{"type":"null"}]},"salesCreditAccount":{"anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"G/L account number (e.g. 61100) or name"},{"type":"null"}]},"salesDiscountAccount":{"anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"G/L account number (e.g. 61100) or name"},{"type":"null"}]},"purchaseAccount":{"anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"G/L account number (e.g. 61100) or name"},{"type":"null"}]},"cogsAccount":{"anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"G/L account number (e.g. 61100) or name"},{"type":"null"}]},"inventoryAdjustmentAccount":{"anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"G/L account number (e.g. 61100) or name"},{"type":"null"}]},"grniAccount":{"anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"G/L account number (e.g. 61100) or name"},{"type":"null"}]}},"required":["productGroup"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/gl/posting-setup/inventory":{"put":{"operationId":"gl.postingSetup.inventory","summary":"Save inventory posting setup","description":"Set the inventory and in-transit accounts for a warehouse × inventory group (no warehouse = all warehouses).","tags":["General ledger"],"x-aurient-kind":"write","x-aurient-permission":"gl.setup.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"warehouse":{"description":"Warehouse code; omit or null for the fallback row","anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"type":"null"}]},"inventoryGroup":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"inventoryAccount":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"G/L account number (e.g. 61100) or name"},"inTransitAccount":{"anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"G/L account number (e.g. 61100) or name"},{"type":"null"}]}},"required":["inventoryGroup","inventoryAccount"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/gl/account-mappings":{"put":{"operationId":"gl.accountMapping","summary":"Set account for tax, expense or bank","description":"Point a tax rate (output/input tax accounts), an expense category, a stock adjustment reason, or a bank account (bank posting group) at its G/L account.","tags":["General ledger"],"x-aurient-kind":"write","x-aurient-permission":"gl.setup.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"kind":{"type":"string","enum":["tax_rate","expense_category","reason_code","bank_account"]},"ref":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Tax rate code, expense category name, reason code/label or bank account name"},"account":{"description":"tax_rate: output tax; expense_category / reason_code: the G/L account","anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"G/L account number (e.g. 61100) or name"},{"type":"null"}]},"purchaseAccount":{"description":"tax_rate only: input tax account","anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"G/L account number (e.g. 61100) or name"},{"type":"null"}]},"bankGroup":{"description":"bank_account only: bank posting group code","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]}},"required":["kind","ref"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/gl/setup":{"put":{"operationId":"gl.setup.update","summary":"General ledger setup","description":"Allowed posting dates, retained earnings / opening balance / rounding / expense tax / production absorption accounts, and whether cost adjustment runs automatically.","tags":["General ledger"],"x-aurient-kind":"write","x-aurient-permission":"gl.period.close","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"allowPostingFrom":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"allowPostingTo":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"retainedEarningsAccount":{"anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"G/L account number (e.g. 61100) or name"},{"type":"null"}]},"openingBalanceAccount":{"anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"G/L account number (e.g. 61100) or name"},{"type":"null"}]},"roundingAccount":{"anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"G/L account number (e.g. 61100) or name"},{"type":"null"}]},"expenseTaxAccount":{"anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"G/L account number (e.g. 61100) or name"},{"type":"null"}]},"productionAccount":{"description":"Manufacturing: the account labour and overhead absorbed into production is credited to (default 51400)","anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"G/L account number (e.g. 61100) or name"},{"type":"null"}]},"automaticCostAdjustment":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},"required":[]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/gl/periods":{"get":{"operationId":"gl.periods.list","summary":"Accounting periods","description":"Monthly accounting periods with open/closed status and how much was posted in each.","tags":["General ledger"],"x-aurient-kind":"read","x-aurient-permission":"gl.view.accounts","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"year","in":"query","required":false,"schema":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}}]}},"/gl/periods/{period}/close":{"post":{"operationId":"gl.periods.close","summary":"Close period","description":"Close an accounting period so nothing more can post into it (documents dated in it are refused). Everything waiting to post must be posted first.","tags":["General ledger"],"x-aurient-kind":"write","x-aurient-permission":"gl.period.close","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"period","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Period id, \"2026-10\" or \"Oct 2026\""},"description":"Period id, \"2026-10\" or \"Oct 2026\""},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/gl/periods/close-up-to":{"post":{"operationId":"gl.periods.closeUpTo","summary":"Close months up to a date","description":"Close every open accounting period that ends on or before a date, oldest first, so nothing more can be back-dated into them. Everything waiting to post must be posted first.","tags":["General ledger"],"x-aurient-kind":"write","x-aurient-permission":"gl.period.close","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"upTo":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Close every open period ending on or before this date"}},"required":["upTo"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/gl/periods/{period}/reopen":{"post":{"operationId":"gl.periods.reopen","summary":"Reopen period","description":"Reopen a closed accounting period so corrections can post into it.","tags":["General ledger"],"x-aurient-kind":"write","x-aurient-permission":"gl.period.close","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":255}},"required":["reason"]}}}},"parameters":[{"name":"period","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Period id, \"2026-10\" or \"Oct 2026\""},"description":"Period id, \"2026-10\" or \"Oct 2026\""},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/gl/fiscal-years/{year}/close":{"post":{"operationId":"gl.year.close","summary":"Close fiscal year","description":"Year-end close: closes every period of the year and moves the year's profit or loss from the income statement accounts into retained earnings.","tags":["General ledger"],"x-aurient-kind":"write","x-aurient-permission":"gl.period.close","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"year","in":"path","required":true,"schema":{"type":"integer","minimum":2000,"maximum":2100}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/inventory/adjust-cost":{"post":{"operationId":"inventory.adjustCost","summary":"Adjust cost","description":"Re-cost stock from its full history (\"Adjust cost - item entries\"): when a receipt cost changed (bill price, freight/duty), everything sold or moved afterwards gets its cost corrected, and COGS/inventory on the ledger follow. Omit item to check every item.","tags":["Stock"],"x-aurient-kind":"write","x-aurient-permission":"inventory.cost.adjust","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"item":{"description":"Omit to re-cost every item waiting for adjustment","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]}},"required":[]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/inventory/revalue":{"post":{"operationId":"inventory.revalue","summary":"Revalue stock","description":"Set a new unit cost for an item's stock on hand in one warehouse (e.g. write-down of damaged or obsolete stock). The difference posts to inventory adjustments.","tags":["Stock"],"x-aurient-kind":"write","x-aurient-permission":"inventory.cost.adjust","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"item":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"warehouse":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"unitCost":{"type":"number","minimum":0,"maximum":1000000000000,"description":"New unit cost for the stock on hand"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"reason":{"type":"string","minLength":1,"maxLength":255}},"required":["item","warehouse","unitCost","reason"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/bills/{bill}/item-charges":{"post":{"operationId":"inventory.assignItemCharge","summary":"Assign freight/duty to receipts","description":"Move a freight, duty or handling line of a bill onto the cost of the goods it brought in (landed cost). The cost is spread over the receipt lines by value or quantity; what was already sold is re-costed.","tags":["Stock"],"x-aurient-kind":"write","x-aurient-permission":"inventory.cost.adjust","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"line":{"type":"integer","minimum":1,"maximum":9007199254740991,"description":"Line number on the bill (the freight/duty line)"},"receipts":{"minItems":1,"maxItems":20,"type":"array","items":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"}},"by":{"default":"value","type":"string","enum":["value","qty"]}},"required":["line","receipts"]}}}},"parameters":[{"name":"bill","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/items/{item}/costs":{"get":{"operationId":"inventory.itemCosts","summary":"Item cost history","description":"How an item's cost was built, as shown in the item page's \"Cost and movements\" section: the stock layers still on hand (which deliveries the stock came from, oldest sold first, and their cost now), every stock movement with the cost it went in or out at and its cost now, every later cost change (bill price differences, freight/duty, re-costing, revaluation, worksheet corrections) and the average cost and value per warehouse.","tags":["Stock"],"x-aurient-kind":"read","x-aurient-permission":"costs.view.items","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"item","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"}]}},"/inventory/cost-worksheet":{"get":{"operationId":"inventory.costWorksheet","summary":"Cost worksheet","description":"The cost worksheet (Fix Item Costs): for one item, every movement that brought stock in at its own cost (receipts, opening stock, production and assembly output) with its cost then and now, whether it can be corrected, and whether the item waits for re-costing. Without an item: the items whose costs need looking at (waiting for re-costing, not yet on the ledger, or stock value that disagrees with the ledger).","tags":["Stock"],"x-aurient-kind":"read","x-aurient-permission":"inventory.cost.adjust","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"item","in":"query","required":false,"schema":{"description":"Omit to list the items whose costs need looking at","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"description":"Omit to list the items whose costs need looking at"}]}},"/inventory/reapply-costs":{"post":{"operationId":"inventory.reapplyCosts","summary":"Reapply item costs","description":"Correct the cost of stock that came in at the wrong cost (cost worksheet): give the right unit cost for receipts, opening stock or production/assembly output, and everything sold or moved from that stock since is re-costed, with cost of goods and inventory on the ledger following. Receipts must be fully billed first (the bill sets their cost). With no lines it only re-costs. The difference goes to inventory adjustment unless an account is given.","tags":["Stock"],"x-aurient-kind":"write","x-aurient-permission":"inventory.cost.adjust","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"item":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"lines":{"default":[],"description":"Leave empty to only re-cost what was sold or moved since","maxItems":500,"type":"array","items":{"type":"object","properties":{"move":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Stock movement id from the cost worksheet (a receipt, opening stock or production/assembly output)"},"unitCost":{"type":"number","minimum":0,"maximum":1000000000000,"description":"The right unit cost, base currency, per base unit"}},"required":["move","unitCost"]}},"account":{"description":"G/L account number the difference goes to; default inventory adjustment","type":"string","maxLength":60},"reason":{"type":"string","minLength":1,"maxLength":255}},"required":["item","reason"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/gl/post-pending":{"post":{"operationId":"gl.postPending","summary":"Post pending to ledger","description":"Post anything still waiting for the general ledger (history after setup, items that failed because of missing setup) and run automatic accrual reversals that are due. Reports what could not post and why.","tags":["General ledger"],"x-aurient-kind":"read","x-aurient-permission":"gl.setup.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/targets":{"get":{"operationId":"targets.grid","summary":"Targets and budgets","description":"Monthly targets for a year for sales reps, customers, customer segments, items or item categories (sales value, or units for items), or spending budgets for expense accounts, each with what actually happened this year and last year. Reps also show what their customers’ targets add up to.","tags":["Targets"],"x-aurient-kind":"read","x-aurient-permission":"targets.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"kind","in":"query","required":true,"schema":{"type":"string","enum":["rep","customer","segment","item","category","budget"],"description":"rep, customer, segment, item, category or budget"},"description":"rep, customer, segment, item, category or budget"},{"name":"year","in":"query","required":false,"schema":{"description":"Defaults to this year","type":"integer","minimum":2000,"maximum":2100},"description":"Defaults to this year"},{"name":"measure","in":"query","required":false,"schema":{"description":"value (default) or units (items only)","type":"string","enum":["value","units"]},"description":"value (default) or units (items only)"},{"name":"subjects","in":"query","required":false,"schema":{"description":"Just these ids","maxItems":50,"type":"array","items":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"description":"Just these ids"}]},"post":{"operationId":"targets.save","summary":"Set targets or budgets","description":"Set monthly targets (or spending budgets) for sales reps, customers, segments, items or categories. A cell with no amount takes that month’s target away.","tags":["Targets"],"x-aurient-kind":"write","x-aurient-permission":"targets.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"kind":{"type":"string","enum":["rep","customer","segment","item","category","budget"]},"measure":{"type":"string","enum":["value","units"]},"cells":{"minItems":1,"maxItems":3000,"type":"array","items":{"type":"object","properties":{"subject":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Id, or the rep / customer / segment / item / category / account by name, code or number"},"month":{"type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"},"amount":{"anyOf":[{"type":"number","minimum":0,"maximum":1000000000000},{"type":"null"}],"description":"Empty (null) takes the target away"}},"required":["subject","month","amount"]}}},"required":["kind","cells"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/targets/fill":{"post":{"operationId":"targets.fill","summary":"Fill targets from last year or a yearly figure","description":"Fill a year of monthly targets or budgets in one go: copy last year’s actuals up or down by a percentage, spread a yearly figure evenly over the months, or spread it the way last year went. Leave out subjects to fill everything that sold (or spent) last year.","tags":["Targets"],"x-aurient-kind":"write","x-aurient-permission":"targets.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"kind":{"type":"string","enum":["rep","customer","segment","item","category","budget"]},"measure":{"type":"string","enum":["value","units"]},"year":{"type":"integer","minimum":2000,"maximum":2100},"how":{"type":"string","enum":["last_year","even","like_last_year"],"description":"last_year: last year’s actuals ± pct; even: total split over 12 months; like_last_year: total split like last year"},"pct":{"description":"For last_year: e.g. 10 for 10% more","type":"number","minimum":-100,"maximum":1000},"total":{"description":"For even and like_last_year: the year’s figure for each subject","type":"number","minimum":0,"maximum":1000000000000},"subjects":{"maxItems":500,"type":"array","items":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"}}},"required":["kind","year","how"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/targets/progress":{"get":{"operationId":"targets.progress","summary":"Progress against targets","description":"For one month (default this month): each target and budget set, how much has been done so far, the percentage, and whether it’s ahead of or behind the pace needed (budgets: how close to going over). Also the signed-in person’s own rep target.","tags":["Targets"],"x-aurient-kind":"read","x-aurient-permission":null,"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"month","in":"query","required":false,"schema":{"description":"YYYY-MM, default this month","type":"string","pattern":"^\\d{4}-(0[1-9]|1[0-2])$"},"description":"YYYY-MM, default this month"},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["rep","customer","segment","item","category","budget"]}}]}},"/budgets/check":{"get":{"operationId":"targets.checkBudget","summary":"Check a spend against the budget","description":"Before recording an expense: would this amount in this expense category take its account to 80% or over its budget for the month?","tags":["Targets"],"x-aurient-kind":"read","x-aurient-permission":["purchasing.po.manage","finance.expense.record","finance.bill.manage","gl.view.accounts","targets.view"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"category","in":"query","required":true,"schema":{"type":"string","minLength":1}},{"name":"amount","in":"query","required":true,"schema":{"type":"number","minimum":0}},{"name":"date","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}]}},"/customer-payments":{"post":{"operationId":"finance.receivePayment","summary":"Record customer payment","description":"Record money received from a customer and apply it to invoices: a named invoice, an explicit split, or automatically to the oldest open invoices. Anything left stays on account.","tags":["Money"],"x-aurient-kind":"write","x-aurient-permission":"finance.payment.receive","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"customer":{"description":"Required unless invoice is given","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"invoice":{"description":"Pay this invoice","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"amount":{"type":"number","exclusiveMinimum":0,"maximum":1000000000000},"paymentDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"method":{"description":"Bank transfer, Cheque, Card or Cash","type":"string","maxLength":40},"bankAccount":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"reference":{"type":"string","maxLength":80},"allocations":{"description":"Explicit split across invoices","maxItems":100,"type":"array","items":{"type":"object","properties":{"document":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Invoice or bill id/number"},"amount":{"type":"number","exclusiveMinimum":0,"maximum":1000000000000}},"required":["document","amount"]}},"exchangeRate":{"description":"Foreign-currency documents only: 1 unit of the document currency in the base currency. Defaults to the rate for the date (Finance → Currencies); changing it needs finance.currency.manage","type":"number","exclusiveMinimum":0,"maximum":1000000000},"autoAllocate":{"description":"Apply what is left to the oldest open invoices","anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"notes":{"type":"string","maxLength":2000}},"required":["amount"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/bills":{"post":{"operationId":"finance.createBill","summary":"Enter supplier bill","description":"Enter a supplier invoice by hand (or from an AI-read PDF): stock items and/or non-stock charges such as freight. Due date follows supplier terms.","tags":["Money"],"x-aurient-kind":"write","x-aurient-permission":"finance.bill.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"supplier":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"supplierInvoiceRef":{"description":"The supplier's invoice number","type":"string","maxLength":60},"billDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"dueDate":{"description":"Defaults to bill date + supplier terms","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"purchaseOrder":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"attachmentId":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"notes":{"type":"string","maxLength":2000},"post":{"description":"false = keep as draft","anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"exchangeRate":{"description":"Foreign-currency documents only: 1 unit of the document currency in the base currency. Defaults to the rate for the date (Finance → Currencies); changing it needs finance.currency.manage","type":"number","exclusiveMinimum":0,"maximum":1000000000},"lines":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"object","properties":{"item":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":{"type":"string","maxLength":255},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000},"unit":{"description":"Stock lines: unit the supplier billed in (converted to the receipt unit)","type":"string","minLength":1,"maxLength":20},"unitCost":{"type":"number","minimum":0,"maximum":1000000000000,"description":"Amount in the document currency"},"tax":{"description":"Tax rate code for this line (e.g. BB-VAT, ZERO). Defaults to the supplier's rate, else the item's","anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"expenseCategory":{"description":"For non-stock lines such as freight","type":"string","maxLength":60},"account":{"description":"G/L account number for a non-stock line; overrides the expense category account","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"chargeTo":{"description":"Freight, duty or handling that is part of the cost of goods received (landed cost)","type":"object","properties":{"receipts":{"minItems":1,"maxItems":20,"type":"array","items":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Goods receipts (e.g. RC-805) whose stock should carry this cost"},"by":{"default":"value","description":"Split by receipt line value or quantity","type":"string","enum":["value","qty"]}},"required":["receipts"]}},"required":["qty","unitCost"]}}},"required":["supplier","lines"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/bills/{bill}/post":{"post":{"operationId":"finance.postBill","summary":"Post draft bill","description":"Post a draft bill so it counts as owed.","tags":["Money"],"x-aurient-kind":"write","x-aurient-permission":"finance.bill.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"bill","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/supplier-payments":{"post":{"operationId":"finance.payBill","summary":"Pay a bill","description":"Record money paid to a supplier and apply it to their bills: a named bill, an explicit split, or automatically to the bills due soonest.","tags":["Money"],"x-aurient-kind":"write","x-aurient-permission":"finance.bill.pay","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"supplier":{"description":"Required unless bill is given","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"bill":{"description":"Pay this bill","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"amount":{"type":"number","exclusiveMinimum":0,"maximum":1000000000000},"paymentDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"method":{"type":"string","maxLength":40},"bankAccount":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"reference":{"type":"string","maxLength":80},"allocations":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"document":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Invoice or bill id/number"},"amount":{"type":"number","exclusiveMinimum":0,"maximum":1000000000000}},"required":["document","amount"]}},"autoAllocate":{"description":"Apply what is left to the bills due soonest","anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"exchangeRate":{"description":"Foreign-currency documents only: 1 unit of the document currency in the base currency. Defaults to the rate for the date (Finance → Currencies); changing it needs finance.currency.manage","type":"number","exclusiveMinimum":0,"maximum":1000000000},"notes":{"type":"string","maxLength":2000}},"required":["amount"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/supplier-credits/apply":{"post":{"operationId":"finance.applySupplierCredit","summary":"Offset supplier credit","description":"Use a supplier credit note (e.g. from a return) to reduce what we owe on one of their bills.","tags":["Money"],"x-aurient-kind":"write","x-aurient-permission":"finance.bill.pay","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"creditNote":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Credit note number, e.g. SCN-10 or CN-100"},"document":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Bill or invoice to offset"},"amount":{"description":"Defaults to as much as both allow","type":"number","exclusiveMinimum":0,"maximum":1000000000000}},"required":["creditNote","document"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/customer-credits/apply":{"post":{"operationId":"finance.applyCustomerCredit","summary":"Offset customer credit","description":"Use a customer credit note to reduce what they owe on an invoice.","tags":["Money"],"x-aurient-kind":"write","x-aurient-permission":"finance.payment.receive","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"creditNote":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Credit note number, e.g. SCN-10 or CN-100"},"document":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Bill or invoice to offset"},"amount":{"description":"Defaults to as much as both allow","type":"number","exclusiveMinimum":0,"maximum":1000000000000}},"required":["creditNote","document"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/expenses":{"post":{"operationId":"finance.recordExpense","summary":"Record expense","description":"Record an overhead paid directly (rent, wages, fuel, freight & duty...).","tags":["Money"],"x-aurient-kind":"write","x-aurient-permission":"finance.expense.record","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"expenseDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"category":{"type":"string","maxLength":60,"description":"Rent, Utilities, Wages, Fuel, Freight & duty, Repairs, Marketing, Office, Other"},"amount":{"type":"number","exclusiveMinimum":0,"maximum":1000000000000},"taxAmount":{"description":"Tax included in the amount (or give tax and it is worked out)","type":"number","minimum":0,"maximum":1000000000000},"tax":{"description":"Tax rate code: the tax included in the amount is worked out at this rate","type":"string","maxLength":20},"payee":{"type":"string","minLength":1,"maxLength":160},"currency":{"description":"Paid in another currency (defaults to the base currency)","type":"string","minLength":3,"maxLength":3},"exchangeRate":{"description":"Foreign-currency documents only: 1 unit of the document currency in the base currency. Defaults to the rate for the date (Finance → Currencies); changing it needs finance.currency.manage","type":"number","exclusiveMinimum":0,"maximum":1000000000},"method":{"type":"string","maxLength":40},"bankAccount":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"warehouse":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"attachmentId":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"notes":{"type":"string","maxLength":255}},"required":["category","amount","payee"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/audit/trail":{"get":{"operationId":"audit.trail","summary":"Audit trail","description":"Search the audit trail: who did what, when, from where, and exactly which fields changed (from -> to). Filter by period, person, record type, action (create, update, void, post, login, login_failed ...), done by a person, an approved assistant action or the system, and words or a document number. Newest first.","tags":["Audit trail"],"x-aurient-kind":"read","x-aurient-permission":"admin.audit.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"user","in":"query","required":false,"schema":{"description":"Person (user id)","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"description":"Person (user id)"},{"name":"entityType","in":"query","required":false,"schema":{"description":"Record type, e.g. invoices, items, users","type":"string","maxLength":40},"description":"Record type, e.g. invoices, items, users"},{"name":"action","in":"query","required":false,"schema":{"description":"e.g. create, update, void, post, login, login_failed","type":"string","maxLength":40},"description":"e.g. create, update, void, post, login, login_failed"},{"name":"via","in":"query","required":false,"schema":{"description":"integration = through the public API","type":"string","enum":["user","ai","system","integration"]},"description":"integration = through the public API"},{"name":"q","in":"query","required":false,"schema":{"description":"Words or a document number in what happened","type":"string","maxLength":100},"description":"Words or a document number in what happened"},{"name":"limit","in":"query","required":false,"schema":{"default":100,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}}]}},"/audit/record":{"get":{"operationId":"audit.record","summary":"Record history","description":"The full history of one record (an item, customer, supplier, person, document ...): every change with who, when, from where and the fields changed (from -> to), oldest first.","tags":["Audit trail"],"x-aurient-kind":"read","x-aurient-permission":"admin.audit.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"entityType","in":"query","required":true,"schema":{"type":"string","maxLength":40}},{"name":"entityId","in":"query","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"name":"limit","in":"query","required":false,"schema":{"default":200,"type":"integer","minimum":1,"maximum":500}}]}},"/audit/check":{"post":{"operationId":"audit.check","summary":"Check the audit trail","description":"Prove the audit trail has not been altered: seals any new entries, then re-computes every seal and walks the chain. Reports entries that were changed or deleted after they were sealed, how many entries there are, and the fingerprint of the latest seal (an auditor can note it and compare later).","tags":["Audit trail"],"x-aurient-kind":"read","x-aurient-permission":"admin.audit.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/return-requests":{"get":{"operationId":"returns.list","summary":"Return requests","description":"Return requests (goods customers didn't keep at delivery): age, customer, invoice, value and status (waiting for credit, credited with its credit note, declined), whether the goods are back in stock, plus what needs attention.","tags":["Returns"],"x-aurient-kind":"read","x-aurient-permission":"returns.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["waiting","credited","declined"]}},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"invoice","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}}]}},"/return-requests/{request}":{"get":{"operationId":"returns.get","summary":"Return request","description":"One return request: the invoice, order, run and driver it came from, each line (sent, kept, coming back, why, value), whether the goods are back in stock, and how it was settled.","tags":["Returns"],"x-aurient-kind":"read","x-aurient-permission":"returns.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"request","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Return request id or number, e.g. RR-1000"},"description":"Return request id or number, e.g. RR-1000"}]}},"/return-requests/{request}/receive":{"post":{"operationId":"returns.receive","summary":"Goods received back","description":"The warehouse confirms what came back on a return request: good goods go back into stock at what they cost when they went out (Dr inventory, Cr cost of goods sold); damaged ones are written off (they stay in cost of goods sold). No credit note is made; the request stays waiting for accounts receivable.","tags":["Returns"],"x-aurient-kind":"write","x-aurient-permission":"returns.receive","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"lines":{"description":"Default: everything on the request came back in good order","maxItems":200,"type":"array","items":{"type":"object","properties":{"line":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Return request line"},"qty":{"type":"number","minimum":0,"maximum":1000000000,"description":"How much came back, in the line unit"},"damaged":{"description":"Came back damaged: written off, not put into stock","anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},"required":["line","qty"]}},"note":{"type":"string","maxLength":255}},"required":[]}}}},"parameters":[{"name":"request","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Return request id or number, e.g. RR-1000"},"description":"Return request id or number, e.g. RR-1000"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/return-requests/{request}/decline":{"post":{"operationId":"returns.decline","summary":"Decline a return request","description":"Closes a return request without a credit note: no money goes back to the customer, who owes the full invoice. Says why, and whether the goods actually came back (kept on the request and in the audit trail). Stock the warehouse already put back stays put back.","tags":["Returns"],"x-aurient-kind":"write","x-aurient-permission":"returns.decline","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":255,"description":"Why no credit is given"},"goodsCameBack":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}],"description":"Did the goods actually come back?"}},"required":["reason","goodsCameBack"]}}}},"parameters":[{"name":"request","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Return request id or number, e.g. RR-1000"},"description":"Return request id or number, e.g. RR-1000"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/items":{"get":{"operationId":"items.list","summary":"List items","description":"Find items (stock items with their stock position: on hand, available, on order, sold in 30 days, days of cover; non-inventory items and services too, with no stock) and their price. Filter by words, supplier, warehouse or below-reorder.","tags":["Items"],"x-aurient-kind":"read","x-aurient-permission":["inventory.item.view","inventory.stock.view"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"q","in":"query","required":false,"schema":{"description":"Words to match in SKU, name or description","type":"string","maxLength":100},"description":"Words to match in SKU, name or description"},{"name":"supplier","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"belowReorder","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},{"name":"includeInactive","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}}]},"post":{"operationId":"items.create","summary":"Add item","description":"Add a new item: a stock item (with its supplier, cost, opening stock and reorder points), a non-inventory item (bought and sold, never counted) or a service, with its price.","tags":["Items"],"x-aurient-kind":"write","x-aurient-permission":"inventory.item.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"sku":{"type":"string","minLength":1,"maxLength":40},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000},"itemType":{"description":"stock = counted and valued (default); non_inventory = bought and sold, never counted (bags, supplies, special orders); service = work or a charge (delivery, labour)","type":"string","enum":["stock","non_inventory","service"]},"supplier":{"description":"Default supplier (needed for stock items)","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"uom":{"type":"string","maxLength":12},"barcode":{"type":"string","maxLength":40},"standardCost":{"description":"Purchase cost; 0 when left out","type":"number","minimum":0,"maximum":1000000000000},"listPrice":{"type":"number","minimum":0,"maximum":1000000000000,"description":"Amount in the document currency"},"expenseAccount":{"description":"Non-inventory items and services: the account buying it is charged to (account number)","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"incomeAccount":{"description":"The account selling it is credited to (account number); empty = the usual sales account","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"warrantyMonths":{"description":"Serial-numbered items: warranty from the day each unit is sold","type":"integer","minimum":1,"maximum":240},"taxRate":{"description":"Tax rate code, e.g. BB-VAT","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"productPostingGroup":{"description":"General product posting group code, e.g. RETAIL. Decides sales, COGS and purchase accounts.","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"inventoryPostingGroup":{"description":"Inventory posting group code, e.g. RESALE. Decides the inventory account.","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"warehouses":{"type":"array","items":{"type":"object","properties":{"warehouse":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"onHand":{"description":"Opening stock (only when creating an item)","type":"number","minimum":0},"reorderPoint":{"type":"number","minimum":0},"reorderQty":{"type":"number","minimum":0},"bin":{"description":"Usual bin for the item in this warehouse","type":"string","maxLength":40}},"required":["warehouse"]}},"units":{"description":"Other units besides the base unit, e.g. CASE of 12","maxItems":20,"type":"array","items":{"type":"object","properties":{"unit":{"type":"string","minLength":1,"maxLength":20,"description":"Unit of measure code or name, e.g. CASE. Defaults to the item's purchase or sales unit; quantity and price on the line are per this unit"},"qtyPerBase":{"type":"number","exclusiveMinimum":0,"maximum":10000000,"description":"How many base units one of this unit holds, e.g. 12"},"barcode":{"type":"string","maxLength":40},"listPrice":{"description":"Selling price per this unit; omit to use base price x quantity","type":"number","minimum":0,"maximum":1000000000000},"standardCost":{"description":"Purchase cost per this unit; omit to use base cost x quantity","type":"number","minimum":0,"maximum":1000000000000},"weightKg":{"type":"number","minimum":0,"maximum":1000000},"lengthCm":{"type":"number","minimum":0,"maximum":100000},"widthCm":{"type":"number","minimum":0,"maximum":100000},"heightCm":{"type":"number","minimum":0,"maximum":100000}},"required":["unit","qtyPerBase"]}},"purchaseUnit":{"description":"Default unit on purchase orders","type":"string","minLength":1,"maxLength":20},"salesUnit":{"description":"Default unit on quotes and sales orders","type":"string","minLength":1,"maxLength":20},"lotTracking":{"description":"serial = one serial number per unit","type":"string","enum":["none","lot","lot_expiry","serial"]},"shelfLifeDays":{"type":"integer","minimum":1,"maximum":36500},"kitType":{"description":"kit = sold as one, ships its components; assembly = built into stock","type":"string","enum":["none","kit","assembly"]},"isStocked":{"description":"Older form of itemType: false = non-inventory item","anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"allowOutOfStock":{"description":"Allow sale when out of stock: this item may sell below zero stock, whatever the company setting","anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"hideFromPos":{"description":"Hide from the till (buttons, search, scanning); still sold on orders and invoices","anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"allowPriceOverride":{"description":"Staff may change its price at the till without a manager","anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},"required":["sku","name","listPrice"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/items/{item}":{"get":{"operationId":"items.get","summary":"Item details","description":"Everything about one item: prices, stock and reorder point per warehouse, average cost, open purchase orders, open sales orders and recent stock movements.","tags":["Items"],"x-aurient-kind":"read","x-aurient-permission":"inventory.item.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"item","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Item id or SKU"},"description":"Item id or SKU"}]},"patch":{"operationId":"items.update","summary":"Edit item","description":"Change an item: name, supplier, cost, price, tax, active flag, or reorder point/quantity per warehouse.","tags":["Items"],"x-aurient-kind":"write","x-aurient-permission":"inventory.item.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"supplier":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"uom":{"type":"string","maxLength":12},"barcode":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"standardCost":{"type":"number","minimum":0,"maximum":1000000000000,"description":"Amount in the document currency"},"listPrice":{"type":"number","minimum":0,"maximum":1000000000000,"description":"Amount in the document currency"},"taxRate":{"anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"type":"null"}]},"isActive":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"productPostingGroup":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"inventoryPostingGroup":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"warehouses":{"description":"Reorder settings per warehouse","type":"array","items":{"type":"object","properties":{"warehouse":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"reorderPoint":{"type":"number","minimum":0},"reorderQty":{"type":"number","minimum":0},"bin":{"description":"Usual bin for the item in this warehouse","type":"string","maxLength":40}},"required":["warehouse"]}},"purchaseUnit":{"anyOf":[{"type":"string","minLength":1,"maxLength":20,"description":"Unit of measure code or name, e.g. CASE. Defaults to the item's purchase or sales unit; quantity and price on the line are per this unit"},{"type":"null"}]},"salesUnit":{"anyOf":[{"type":"string","minLength":1,"maxLength":20,"description":"Unit of measure code or name, e.g. CASE. Defaults to the item's purchase or sales unit; quantity and price on the line are per this unit"},{"type":"null"}]},"lotTracking":{"description":"Switching on: stock already on hand stays without a lot or serial number","type":"string","enum":["none","lot","lot_expiry","serial"]},"itemType":{"description":"From stock: only with nothing on hand anywhere","type":"string","enum":["stock","non_inventory","service"]},"expenseAccount":{"anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"type":"null"}]},"incomeAccount":{"anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"type":"null"}]},"warrantyMonths":{"anyOf":[{"type":"integer","minimum":1,"maximum":240},{"type":"null"}]},"shelfLifeDays":{"anyOf":[{"type":"integer","minimum":1,"maximum":36500},{"type":"null"}]},"expiryWarningDays":{"type":"integer","minimum":0,"maximum":3650},"allowOutOfStock":{"description":"Allow sale when out of stock: this item may sell below zero stock, whatever the company setting","anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"hideFromPos":{"description":"Hide from the till (buttons, search, scanning); still sold on orders and invoices","anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"allowPriceOverride":{"description":"Staff may change its price at the till without a manager","anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},"required":[]}}}},"parameters":[{"name":"item","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/suppliers":{"get":{"operationId":"suppliers.list","summary":"List suppliers","description":"Suppliers with what we owe them, overdue amounts, bills due in 7 days, and open/late purchase orders.","tags":["Suppliers"],"x-aurient-kind":"read","x-aurient-permission":"purchasing.supplier.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"includeArchived","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}}]},"post":{"operationId":"suppliers.create","summary":"Add supplier","description":"Add a new supplier with payment terms and lead time.","tags":["Suppliers"],"x-aurient-kind":"write","x-aurient-permission":"purchasing.supplier.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"code":{"description":"Short code; generated when omitted","type":"string","maxLength":20},"name":{"type":"string","minLength":1,"maxLength":160},"city":{"type":"string","maxLength":80},"country":{"type":"string","maxLength":60},"email":{"type":"string","maxLength":190,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","maxLength":40},"currency":{"type":"string","minLength":3,"maxLength":3},"paymentTermsDays":{"type":"integer","minimum":0,"maximum":365},"notes":{"type":"string","maxLength":2000},"leadTimeDays":{"type":"integer","minimum":0,"maximum":365},"tax":{"description":"Tax rate code on their bills unless a line says otherwise (e.g. ZERO for an overseas supplier); null = the item's rate","anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"businessPostingGroup":{"description":"General business posting group code, e.g. DOMESTIC","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"vendorPostingGroup":{"description":"Vendor posting group code; decides the payables account","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]}},"required":["name"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/suppliers/{supplier}":{"get":{"operationId":"suppliers.get","summary":"Supplier details","description":"One supplier: terms, lead time, balance owed, their items, open purchase orders, unpaid bills and recent payments.","tags":["Suppliers"],"x-aurient-kind":"read","x-aurient-permission":"purchasing.supplier.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"supplier","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"}]},"patch":{"operationId":"suppliers.update","summary":"Edit supplier","description":"Change supplier details, terms, lead time, or archive them.","tags":["Suppliers"],"x-aurient-kind":"write","x-aurient-permission":"purchasing.supplier.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"code":{"description":"Short code; generated when omitted","type":"string","maxLength":20},"name":{"type":"string","minLength":1,"maxLength":160},"city":{"type":"string","maxLength":80},"country":{"type":"string","maxLength":60},"email":{"type":"string","maxLength":190,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","maxLength":40},"currency":{"type":"string","minLength":3,"maxLength":3},"paymentTermsDays":{"type":"integer","minimum":0,"maximum":365},"notes":{"type":"string","maxLength":2000},"leadTimeDays":{"type":"integer","minimum":0,"maximum":365},"tax":{"description":"Tax rate code on their bills unless a line says otherwise (e.g. ZERO for an overseas supplier); null = the item's rate","anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"businessPostingGroup":{"description":"General business posting group code, e.g. DOMESTIC","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"vendorPostingGroup":{"description":"Vendor posting group code; decides the payables account","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"archived":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},"required":[]}}}},"parameters":[{"name":"supplier","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/customers":{"get":{"operationId":"customers.list","summary":"List customers","description":"Customers with what they owe, overdue amount, oldest overdue days, credit limit and available credit, and sales in the last 30/90 days.","tags":["Customers"],"x-aurient-kind":"read","x-aurient-permission":"sales.customer.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"includeArchived","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}}]},"post":{"operationId":"customers.create","summary":"Add customer","description":"Add a new customer with their usual warehouse, payment terms and credit limit.","tags":["Customers"],"x-aurient-kind":"write","x-aurient-permission":"sales.customer.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"code":{"description":"Short code; generated when omitted","type":"string","maxLength":20},"name":{"type":"string","minLength":1,"maxLength":160},"city":{"type":"string","maxLength":80},"country":{"type":"string","maxLength":60},"email":{"type":"string","maxLength":190,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","maxLength":40},"currency":{"type":"string","minLength":3,"maxLength":3},"paymentTermsDays":{"type":"integer","minimum":0,"maximum":365},"notes":{"type":"string","maxLength":2000},"warehouse":{"description":"Usually ships from","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"creditLimit":{"type":"number","minimum":0,"maximum":1000000000000,"description":"Amount in the document currency"},"businessPostingGroup":{"description":"General business posting group code, e.g. DOMESTIC","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"customerPostingGroup":{"description":"Customer posting group code; decides the receivables account","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"priceList":{"description":"Their price list (customer group) code; null = none","anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"rep":{"description":"Their main sales rep (a person's name, email or id); null = none","anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"type":"null"}]},"segment":{"description":"Their customer segment, e.g. Supermarkets (made if new); null = none","anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"routeArea":{"description":"Route area they are delivered in (code); null = Unassigned. A delivery location can have its own.","anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"type":"null"}]}},"required":["name"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/customers/{customer}":{"get":{"operationId":"customers.get","summary":"Customer details","description":"One customer: terms, credit limit, balance, unpaid invoices with aging, open orders, open quotes, recent payments and top items bought.","tags":["Customers"],"x-aurient-kind":"read","x-aurient-permission":"sales.customer.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"customer","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"}]},"patch":{"operationId":"customers.update","summary":"Edit customer","description":"Change customer details, terms, credit limit, usual warehouse, or archive them.","tags":["Customers"],"x-aurient-kind":"write","x-aurient-permission":"sales.customer.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"code":{"description":"Short code; generated when omitted","type":"string","maxLength":20},"name":{"type":"string","minLength":1,"maxLength":160},"city":{"type":"string","maxLength":80},"country":{"type":"string","maxLength":60},"email":{"type":"string","maxLength":190,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","maxLength":40},"currency":{"type":"string","minLength":3,"maxLength":3},"paymentTermsDays":{"type":"integer","minimum":0,"maximum":365},"notes":{"type":"string","maxLength":2000},"warehouse":{"description":"Usually ships from","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"creditLimit":{"type":"number","minimum":0,"maximum":1000000000000,"description":"Amount in the document currency"},"businessPostingGroup":{"description":"General business posting group code, e.g. DOMESTIC","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"customerPostingGroup":{"description":"Customer posting group code; decides the receivables account","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"priceList":{"description":"Their price list (customer group) code; null = none","anyOf":[{"type":"string","maxLength":20},{"type":"null"}]},"rep":{"description":"Their main sales rep (a person's name, email or id); null = none","anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"type":"null"}]},"segment":{"description":"Their customer segment, e.g. Supermarkets (made if new); null = none","anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"routeArea":{"description":"Route area they are delivered in (code); null = Unassigned. A delivery location can have its own.","anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"type":"null"}]},"archived":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},"required":[]}}}},"parameters":[{"name":"customer","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/warehouses":{"get":{"operationId":"warehouses.list","summary":"Warehouses","description":"All warehouses with their stock value, units on hand and items below reorder point.","tags":["Stock"],"x-aurient-kind":"read","x-aurient-permission":null,"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"warehouses.create","summary":"Add warehouse","description":"Add a new warehouse / branch location.","tags":["Stock"],"x-aurient-kind":"write","x-aurient-permission":"admin.settings.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"code":{"type":"string","pattern":"^[A-Z0-9]{1,8}$"},"name":{"type":"string","minLength":1,"maxLength":120},"country":{"type":"string","maxLength":60},"currency":{"type":"string","minLength":3,"maxLength":3}},"required":["code","name"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/setup":{"get":{"operationId":"setup.lists","summary":"Setup lists","description":"Pick-list values: warehouses, tax rates, payment methods, bank accounts, reason codes, expense categories, roles and currencies.","tags":["Settings"],"x-aurient-kind":"read","x-aurient-permission":null,"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/documents/{ref}":{"get":{"operationId":"documents.get","summary":"Open a document","description":"Full detail of any document by number (PO-1042, SO-5531, INV-8710, BILL-2290, RC-805, SH-640, QT-310, TR-311, PAY-3150...): header, lines, status, the documents before/after it in the flow, payments applied, comments, attachments and history.","tags":["Documents and lists"],"x-aurient-kind":"read","x-aurient-permission":null,"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"ref","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Document id or number"},"description":"Document id or number"},{"name":"kind","in":"query","required":false,"schema":{"description":"Optional when the number has a prefix like PO-, INV-","type":"string","enum":["quote","sales_order","shipment","invoice","credit_note","customer_payment","purchase_order","goods_receipt","bill","supplier_credit","supplier_payment","supplier_return","transfer","adjustment","count","expense","journal_entry","assembly","production","customer_refund","pos_session","pos_tab"]},"description":"Optional when the number has a prefix like PO-, INV-"}]}},"/documents":{"get":{"operationId":"documents.list","summary":"List documents","description":"List documents of one kind (purchase_order, sales_order, invoice, bill, shipment, goods_receipt, quote, transfer, customer_payment, supplier_payment, supplier_return, credit_note, supplier_credit, adjustment, count, expense) filtered by status, customer/supplier, dates or number.","tags":["Documents and lists"],"x-aurient-kind":"read","x-aurient-permission":null,"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"kind","in":"query","required":true,"schema":{"type":"string","enum":["quote","sales_order","shipment","invoice","credit_note","customer_payment","purchase_order","goods_receipt","bill","supplier_credit","supplier_payment","supplier_return","transfer","adjustment","count","expense","journal_entry","assembly","production","customer_refund","pos_session","pos_tab"]}},{"name":"status","in":"query","required":false,"schema":{"type":"string","maxLength":30}},{"name":"party","in":"query","required":false,"schema":{"description":"Customer or supplier","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"description":"Customer or supplier"},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"q","in":"query","required":false,"schema":{"description":"Part of the document number","type":"string","maxLength":60},"description":"Part of the document number"},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}}]}},"/search":{"get":{"operationId":"search.records","summary":"Search","description":"Quick search across document numbers, items, customers and suppliers. Use when the user names something and you need its id or number.","tags":["Documents and lists"],"x-aurient-kind":"read","x-aurient-permission":null,"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":200}},{"name":"limit","in":"query","required":false,"schema":{"default":20,"type":"integer","minimum":1,"maximum":50}}]}},"/comments":{"post":{"operationId":"comments.add","summary":"Add note","description":"Leave a note on a record (e.g. \"Supplier says it ships Tuesday\"). Notes are visible to the team and to the assistant.","tags":["Documents and lists"],"x-aurient-kind":"write","x-aurient-permission":null,"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"entityType":{"type":"string","maxLength":32},"entityId":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"body":{"type":"string","minLength":1,"maxLength":5000}},"required":["entityType","entityId","body"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/payments/settings":{"get":{"operationId":"payments.settings","summary":"Online payments","description":"Whether customers can pay invoices online with PayPal (the company's own PayPal), and where those payments are recorded.","tags":["Settings"],"x-aurient-kind":"read","x-aurient-permission":"admin.settings.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}},"put":{"operationId":"payments.settings.save","summary":"Connect PayPal","description":"Connect the company's own PayPal (REST app client ID and secret) so customers can pay invoices online, and choose the bank account PayPal payments are recorded in.","tags":["Settings"],"x-aurient-kind":"write","x-aurient-permission":"admin.settings.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"enabled":{"type":"boolean"},"env":{"default":"live","type":"string","enum":["live","sandbox"]},"clientId":{"type":"string","maxLength":255},"secret":{"description":"Leave out to keep the saved one","type":"string","maxLength":500},"bankAccount":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":["enabled"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/invoices/{invoice}/pay-link":{"get":{"operationId":"payments.payLink","summary":"Pay-now link","description":"The link a customer opens to pay an unpaid invoice online (PayPal or card), when the company takes online payments.","tags":["Settings"],"x-aurient-kind":"read","x-aurient-permission":"sales.invoice.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"invoice","in":"path","required":true,"schema":{"type":["string","number"]}}]}},"/transfers":{"post":{"operationId":"inventory.sendTransfer","summary":"Transfer stock","description":"Move stock between warehouses. It leaves the source now (at average cost) and arrives when someone receives it at the other end. Refuses to send stock reserved for orders.","tags":["Stock"],"x-aurient-kind":"write","x-aurient-permission":"inventory.transfer","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"from":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Source warehouse"},"to":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Destination warehouse"},"transferDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"expectedDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"notes":{"type":"string","maxLength":2000},"lines":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"object","properties":{"item":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000},"unit":{"type":"string","minLength":1,"maxLength":20,"description":"Unit of measure code or name, e.g. CASE. Defaults to the item's purchase or sales unit; quantity and price on the line are per this unit"},"lots":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"lot":{"type":"string","minLength":1,"maxLength":40,"description":"Lot / batch number"},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000,"description":"Quantity from this lot, in the line unit"}},"required":["lot","qty"]},"description":"Pick these lots instead of first-expiry-first-out"},"bin":{"description":"Bin to take it from","type":"string","minLength":1,"maxLength":20}},"required":["item","qty"]}}},"required":["from","to","lines"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/transfers/{transfer}/receive":{"post":{"operationId":"inventory.receiveTransfer","summary":"Receive transfer","description":"Book a transfer in at the destination warehouse. Omit lines to receive everything still in transit.","tags":["Stock"],"x-aurient-kind":"write","x-aurient-permission":"inventory.transfer","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"lines":{"description":"Omit to receive everything in transit","type":"array","items":{"type":"object","properties":{"item":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000,"description":"Base units"},"bin":{"type":"string","minLength":1,"maxLength":20,"description":"Bin code inside the warehouse, e.g. A-01"}},"required":["item","qty"]}},"bin":{"description":"Bin it all goes into at the destination","type":"string","minLength":1,"maxLength":20}},"required":[]}}}},"parameters":[{"name":"transfer","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Transfer id or number, e.g. TR-311"},"description":"Transfer id or number, e.g. TR-311"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/stock-adjustments":{"post":{"operationId":"inventory.adjust","summary":"Adjust stock","description":"Correct stock with a reason (Damaged, Expired, Found, Theft or loss, Correction). Negative changes take stock out; cannot go below zero.","tags":["Stock"],"x-aurient-kind":"write","x-aurient-permission":"inventory.adjust","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"warehouse":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"reason":{"type":"string","maxLength":80,"description":"Damaged, Expired, Found, Theft or loss, Correction"},"adjDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"notes":{"type":"string","maxLength":2000},"lines":{"minItems":1,"maxItems":500,"type":"array","items":{"type":"object","properties":{"item":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"change":{"type":"number"},"unit":{"type":"string","minLength":1,"maxLength":20,"description":"Unit of measure code or name, e.g. CASE. Defaults to the item's purchase or sales unit; quantity and price on the line are per this unit"},"lot":{"description":"Lot to adjust (lot-tracked items)","type":"string","minLength":1,"maxLength":40},"expiry":{"description":"Expiry for a new lot","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"bin":{"type":"string","minLength":1,"maxLength":20,"description":"Bin code inside the warehouse, e.g. A-01"}},"required":["item","change"]},"description":"Negative change takes stock out"}},"required":["warehouse","reason","lines"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/stock-counts":{"post":{"operationId":"inventory.count","summary":"Count stock","description":"Enter what's physically on the shelf; the system works out each difference and posts it. Use for cycle counts and full stock-takes.","tags":["Stock"],"x-aurient-kind":"write","x-aurient-permission":"inventory.adjust","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"warehouse":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"countDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"notes":{"type":"string","maxLength":2000},"lines":{"minItems":1,"maxItems":2000,"type":"array","items":{"type":"object","properties":{"item":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"counted":{"type":"number","minimum":0},"unit":{"type":"string","minLength":1,"maxLength":20,"description":"Unit of measure code or name, e.g. CASE. Defaults to the item's purchase or sales unit; quantity and price on the line are per this unit"},"lot":{"description":"Count one lot only","type":"string","minLength":1,"maxLength":40},"expiry":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"bin":{"description":"Count one bin only","type":"string","minLength":1,"maxLength":20}},"required":["item","counted"]}}},"required":["warehouse","lines"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/lists/purchase-orders":{"get":{"operationId":"lists.purchaseOrders","summary":"All purchase orders","description":"Every purchase order, newest first, with supplier, warehouse, status (Draft, Sent, Late, Partially received, Received, Cancelled), expected date and value.","tags":["Documents and lists"],"x-aurient-kind":"read","x-aurient-permission":"purchasing.po.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"q","in":"query","required":false,"schema":{"description":"Part of the document number or party name","type":"string","maxLength":80},"description":"Part of the document number or party name"},{"name":"status","in":"query","required":false,"schema":{"type":"string","maxLength":30}},{"name":"supplier","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":300,"type":"integer","minimum":1,"maximum":1000}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"filters","in":"query","required":false,"schema":{"description":"Column searches as JSON, e.g. [{\"k\":\"customer_name\",\"q\":\"best\"},{\"k\":\"total\",\"from\":10,\"to\":500},{\"k\":\"invoice_date\",\"from\":\"2026-01-01\",\"to\":\"2026-01-31\"},{\"k\":\"status_label\",\"in\":[\"Paid\",\"Unpaid\"]}]","type":"string","maxLength":4000},"description":"Column searches as JSON, e.g. [{\"k\":\"customer_name\",\"q\":\"best\"},{\"k\":\"total\",\"from\":10,\"to\":500},{\"k\":\"invoice_date\",\"from\":\"2026-01-01\",\"to\":\"2026-01-31\"},{\"k\":\"status_label\",\"in\":[\"Paid\",\"Unpaid\"]}]"},{"name":"sort","in":"query","required":false,"schema":{"description":"A field to sort by; put - in front for largest / newest / Z first, e.g. -total","type":"string","maxLength":60},"description":"A field to sort by; put - in front for largest / newest / Z first, e.g. -total"}]}},"/lists/sales-orders":{"get":{"operationId":"lists.salesOrders","summary":"All sales orders","description":"Every sales order, newest first, with customer, warehouse, status (Open, Partially shipped, Shipped, Invoiced, Cancelled), lines and value.","tags":["Documents and lists"],"x-aurient-kind":"read","x-aurient-permission":"sales.order.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"q","in":"query","required":false,"schema":{"description":"Part of the document number or party name","type":"string","maxLength":80},"description":"Part of the document number or party name"},{"name":"status","in":"query","required":false,"schema":{"type":"string","maxLength":30}},{"name":"supplier","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":300,"type":"integer","minimum":1,"maximum":1000}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"filters","in":"query","required":false,"schema":{"description":"Column searches as JSON, e.g. [{\"k\":\"customer_name\",\"q\":\"best\"},{\"k\":\"total\",\"from\":10,\"to\":500},{\"k\":\"invoice_date\",\"from\":\"2026-01-01\",\"to\":\"2026-01-31\"},{\"k\":\"status_label\",\"in\":[\"Paid\",\"Unpaid\"]}]","type":"string","maxLength":4000},"description":"Column searches as JSON, e.g. [{\"k\":\"customer_name\",\"q\":\"best\"},{\"k\":\"total\",\"from\":10,\"to\":500},{\"k\":\"invoice_date\",\"from\":\"2026-01-01\",\"to\":\"2026-01-31\"},{\"k\":\"status_label\",\"in\":[\"Paid\",\"Unpaid\"]}]"},{"name":"sort","in":"query","required":false,"schema":{"description":"A field to sort by; put - in front for largest / newest / Z first, e.g. -total","type":"string","maxLength":60},"description":"A field to sort by; put - in front for largest / newest / Z first, e.g. -total"}]}},"/lists/invoices":{"get":{"operationId":"lists.invoices","summary":"All invoices","description":"Every posted invoice and credit note, newest first, with balance, due date, age and status (Paid, Part paid, Unpaid, Overdue, Credit).","tags":["Documents and lists"],"x-aurient-kind":"read","x-aurient-permission":"sales.invoice.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"q","in":"query","required":false,"schema":{"description":"Part of the document number or party name","type":"string","maxLength":80},"description":"Part of the document number or party name"},{"name":"status","in":"query","required":false,"schema":{"type":"string","maxLength":30}},{"name":"supplier","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":300,"type":"integer","minimum":1,"maximum":1000}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"filters","in":"query","required":false,"schema":{"description":"Column searches as JSON, e.g. [{\"k\":\"customer_name\",\"q\":\"best\"},{\"k\":\"total\",\"from\":10,\"to\":500},{\"k\":\"invoice_date\",\"from\":\"2026-01-01\",\"to\":\"2026-01-31\"},{\"k\":\"status_label\",\"in\":[\"Paid\",\"Unpaid\"]}]","type":"string","maxLength":4000},"description":"Column searches as JSON, e.g. [{\"k\":\"customer_name\",\"q\":\"best\"},{\"k\":\"total\",\"from\":10,\"to\":500},{\"k\":\"invoice_date\",\"from\":\"2026-01-01\",\"to\":\"2026-01-31\"},{\"k\":\"status_label\",\"in\":[\"Paid\",\"Unpaid\"]}]"},{"name":"sort","in":"query","required":false,"schema":{"description":"A field to sort by; put - in front for largest / newest / Z first, e.g. -total","type":"string","maxLength":60},"description":"A field to sort by; put - in front for largest / newest / Z first, e.g. -total"}]}},"/lists/bills":{"get":{"operationId":"lists.bills","summary":"All bills","description":"Every posted supplier bill and credit note, newest first, with PO, due date, balance and status.","tags":["Documents and lists"],"x-aurient-kind":"read","x-aurient-permission":"purchasing.bill.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"q","in":"query","required":false,"schema":{"description":"Part of the document number or party name","type":"string","maxLength":80},"description":"Part of the document number or party name"},{"name":"status","in":"query","required":false,"schema":{"type":"string","maxLength":30}},{"name":"supplier","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":300,"type":"integer","minimum":1,"maximum":1000}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"filters","in":"query","required":false,"schema":{"description":"Column searches as JSON, e.g. [{\"k\":\"customer_name\",\"q\":\"best\"},{\"k\":\"total\",\"from\":10,\"to\":500},{\"k\":\"invoice_date\",\"from\":\"2026-01-01\",\"to\":\"2026-01-31\"},{\"k\":\"status_label\",\"in\":[\"Paid\",\"Unpaid\"]}]","type":"string","maxLength":4000},"description":"Column searches as JSON, e.g. [{\"k\":\"customer_name\",\"q\":\"best\"},{\"k\":\"total\",\"from\":10,\"to\":500},{\"k\":\"invoice_date\",\"from\":\"2026-01-01\",\"to\":\"2026-01-31\"},{\"k\":\"status_label\",\"in\":[\"Paid\",\"Unpaid\"]}]"},{"name":"sort","in":"query","required":false,"schema":{"description":"A field to sort by; put - in front for largest / newest / Z first, e.g. -total","type":"string","maxLength":60},"description":"A field to sort by; put - in front for largest / newest / Z first, e.g. -total"}]}},"/lists/shipments":{"get":{"operationId":"lists.shipments","summary":"Shipments","description":"Goods shipped to customers, newest first, with sales order, warehouse, units and the invoice (or \"not invoiced\").","tags":["Documents and lists"],"x-aurient-kind":"read","x-aurient-permission":"sales.shipment.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"q","in":"query","required":false,"schema":{"description":"Part of the document number or party name","type":"string","maxLength":80},"description":"Part of the document number or party name"},{"name":"status","in":"query","required":false,"schema":{"type":"string","maxLength":30}},{"name":"supplier","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":300,"type":"integer","minimum":1,"maximum":1000}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"filters","in":"query","required":false,"schema":{"description":"Column searches as JSON, e.g. [{\"k\":\"customer_name\",\"q\":\"best\"},{\"k\":\"total\",\"from\":10,\"to\":500},{\"k\":\"invoice_date\",\"from\":\"2026-01-01\",\"to\":\"2026-01-31\"},{\"k\":\"status_label\",\"in\":[\"Paid\",\"Unpaid\"]}]","type":"string","maxLength":4000},"description":"Column searches as JSON, e.g. [{\"k\":\"customer_name\",\"q\":\"best\"},{\"k\":\"total\",\"from\":10,\"to\":500},{\"k\":\"invoice_date\",\"from\":\"2026-01-01\",\"to\":\"2026-01-31\"},{\"k\":\"status_label\",\"in\":[\"Paid\",\"Unpaid\"]}]"},{"name":"sort","in":"query","required":false,"schema":{"description":"A field to sort by; put - in front for largest / newest / Z first, e.g. -total","type":"string","maxLength":60},"description":"A field to sort by; put - in front for largest / newest / Z first, e.g. -total"}]}},"/lists/receipts":{"get":{"operationId":"lists.receipts","summary":"Purchase receipts","description":"Goods received from suppliers, newest first, with PO, warehouse, units, value at cost and the bill it created.","tags":["Documents and lists"],"x-aurient-kind":"read","x-aurient-permission":"purchasing.receipt.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"q","in":"query","required":false,"schema":{"description":"Part of the document number or party name","type":"string","maxLength":80},"description":"Part of the document number or party name"},{"name":"status","in":"query","required":false,"schema":{"type":"string","maxLength":30}},{"name":"supplier","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":300,"type":"integer","minimum":1,"maximum":1000}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"filters","in":"query","required":false,"schema":{"description":"Column searches as JSON, e.g. [{\"k\":\"customer_name\",\"q\":\"best\"},{\"k\":\"total\",\"from\":10,\"to\":500},{\"k\":\"invoice_date\",\"from\":\"2026-01-01\",\"to\":\"2026-01-31\"},{\"k\":\"status_label\",\"in\":[\"Paid\",\"Unpaid\"]}]","type":"string","maxLength":4000},"description":"Column searches as JSON, e.g. [{\"k\":\"customer_name\",\"q\":\"best\"},{\"k\":\"total\",\"from\":10,\"to\":500},{\"k\":\"invoice_date\",\"from\":\"2026-01-01\",\"to\":\"2026-01-31\"},{\"k\":\"status_label\",\"in\":[\"Paid\",\"Unpaid\"]}]"},{"name":"sort","in":"query","required":false,"schema":{"description":"A field to sort by; put - in front for largest / newest / Z first, e.g. -total","type":"string","maxLength":60},"description":"A field to sort by; put - in front for largest / newest / Z first, e.g. -total"}]}},"/lists/returns":{"get":{"operationId":"lists.returns","summary":"Returns to suppliers","description":"Goods sent back to suppliers with reason, original PO, units and the credit received.","tags":["Documents and lists"],"x-aurient-kind":"read","x-aurient-permission":"purchasing.return.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"q","in":"query","required":false,"schema":{"description":"Part of the document number or party name","type":"string","maxLength":80},"description":"Part of the document number or party name"},{"name":"status","in":"query","required":false,"schema":{"type":"string","maxLength":30}},{"name":"supplier","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":300,"type":"integer","minimum":1,"maximum":1000}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"filters","in":"query","required":false,"schema":{"description":"Column searches as JSON, e.g. [{\"k\":\"customer_name\",\"q\":\"best\"},{\"k\":\"total\",\"from\":10,\"to\":500},{\"k\":\"invoice_date\",\"from\":\"2026-01-01\",\"to\":\"2026-01-31\"},{\"k\":\"status_label\",\"in\":[\"Paid\",\"Unpaid\"]}]","type":"string","maxLength":4000},"description":"Column searches as JSON, e.g. [{\"k\":\"customer_name\",\"q\":\"best\"},{\"k\":\"total\",\"from\":10,\"to\":500},{\"k\":\"invoice_date\",\"from\":\"2026-01-01\",\"to\":\"2026-01-31\"},{\"k\":\"status_label\",\"in\":[\"Paid\",\"Unpaid\"]}]"},{"name":"sort","in":"query","required":false,"schema":{"description":"A field to sort by; put - in front for largest / newest / Z first, e.g. -total","type":"string","maxLength":60},"description":"A field to sort by; put - in front for largest / newest / Z first, e.g. -total"}]}},"/lists/payments":{"get":{"operationId":"lists.payments","summary":"Payments","description":"Payments received from customers (direction=in) or made to suppliers (direction=out), newest first, with what each was applied to.","tags":["Documents and lists"],"x-aurient-kind":"read","x-aurient-permission":["sales.payment.view","purchasing.payment.view"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"q","in":"query","required":false,"schema":{"description":"Part of the document number or party name","type":"string","maxLength":80},"description":"Part of the document number or party name"},{"name":"status","in":"query","required":false,"schema":{"type":"string","maxLength":30}},{"name":"supplier","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":300,"type":"integer","minimum":1,"maximum":1000}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"filters","in":"query","required":false,"schema":{"description":"Column searches as JSON, e.g. [{\"k\":\"customer_name\",\"q\":\"best\"},{\"k\":\"total\",\"from\":10,\"to\":500},{\"k\":\"invoice_date\",\"from\":\"2026-01-01\",\"to\":\"2026-01-31\"},{\"k\":\"status_label\",\"in\":[\"Paid\",\"Unpaid\"]}]","type":"string","maxLength":4000},"description":"Column searches as JSON, e.g. [{\"k\":\"customer_name\",\"q\":\"best\"},{\"k\":\"total\",\"from\":10,\"to\":500},{\"k\":\"invoice_date\",\"from\":\"2026-01-01\",\"to\":\"2026-01-31\"},{\"k\":\"status_label\",\"in\":[\"Paid\",\"Unpaid\"]}]"},{"name":"sort","in":"query","required":false,"schema":{"description":"A field to sort by; put - in front for largest / newest / Z first, e.g. -total","type":"string","maxLength":60},"description":"A field to sort by; put - in front for largest / newest / Z first, e.g. -total"},{"name":"direction","in":"query","required":false,"schema":{"default":"in","type":"string","enum":["in","out"]}}]}},"/lists/transfers":{"get":{"operationId":"lists.transfers","summary":"All transfers","description":"Stock transfers between warehouses with items, units and status.","tags":["Documents and lists"],"x-aurient-kind":"read","x-aurient-permission":"inventory.transfer.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"q","in":"query","required":false,"schema":{"description":"Part of the document number or party name","type":"string","maxLength":80},"description":"Part of the document number or party name"},{"name":"status","in":"query","required":false,"schema":{"type":"string","maxLength":30}},{"name":"supplier","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":300,"type":"integer","minimum":1,"maximum":1000}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"filters","in":"query","required":false,"schema":{"description":"Column searches as JSON, e.g. [{\"k\":\"customer_name\",\"q\":\"best\"},{\"k\":\"total\",\"from\":10,\"to\":500},{\"k\":\"invoice_date\",\"from\":\"2026-01-01\",\"to\":\"2026-01-31\"},{\"k\":\"status_label\",\"in\":[\"Paid\",\"Unpaid\"]}]","type":"string","maxLength":4000},"description":"Column searches as JSON, e.g. [{\"k\":\"customer_name\",\"q\":\"best\"},{\"k\":\"total\",\"from\":10,\"to\":500},{\"k\":\"invoice_date\",\"from\":\"2026-01-01\",\"to\":\"2026-01-31\"},{\"k\":\"status_label\",\"in\":[\"Paid\",\"Unpaid\"]}]"},{"name":"sort","in":"query","required":false,"schema":{"description":"A field to sort by; put - in front for largest / newest / Z first, e.g. -total","type":"string","maxLength":60},"description":"A field to sort by; put - in front for largest / newest / Z first, e.g. -total"}]}},"/lists/customers":{"get":{"operationId":"lists.customers","summary":"All customers (a page at a time)","description":"Customers with location, terms, sales in 30 days, what they owe, overdue and credit used, with column searches and sorting.","tags":["Documents and lists"],"x-aurient-kind":"read","x-aurient-permission":"sales.customer.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":1000}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"filters","in":"query","required":false,"schema":{"description":"Column searches as JSON, e.g. [{\"k\":\"customer_name\",\"q\":\"best\"},{\"k\":\"total\",\"from\":10,\"to\":500},{\"k\":\"invoice_date\",\"from\":\"2026-01-01\",\"to\":\"2026-01-31\"},{\"k\":\"status_label\",\"in\":[\"Paid\",\"Unpaid\"]}]","type":"string","maxLength":4000},"description":"Column searches as JSON, e.g. [{\"k\":\"customer_name\",\"q\":\"best\"},{\"k\":\"total\",\"from\":10,\"to\":500},{\"k\":\"invoice_date\",\"from\":\"2026-01-01\",\"to\":\"2026-01-31\"},{\"k\":\"status_label\",\"in\":[\"Paid\",\"Unpaid\"]}]"},{"name":"sort","in":"query","required":false,"schema":{"description":"A field to sort by; put - in front for largest / newest / Z first, e.g. -total","type":"string","maxLength":60},"description":"A field to sort by; put - in front for largest / newest / Z first, e.g. -total"}]}},"/lists/suppliers":{"get":{"operationId":"lists.suppliers","summary":"All suppliers (a page at a time)","description":"Suppliers with location, terms, lead time, open and late purchase orders and what we owe, with column searches and sorting.","tags":["Documents and lists"],"x-aurient-kind":"read","x-aurient-permission":"purchasing.supplier.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":1000}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"filters","in":"query","required":false,"schema":{"description":"Column searches as JSON, e.g. [{\"k\":\"customer_name\",\"q\":\"best\"},{\"k\":\"total\",\"from\":10,\"to\":500},{\"k\":\"invoice_date\",\"from\":\"2026-01-01\",\"to\":\"2026-01-31\"},{\"k\":\"status_label\",\"in\":[\"Paid\",\"Unpaid\"]}]","type":"string","maxLength":4000},"description":"Column searches as JSON, e.g. [{\"k\":\"customer_name\",\"q\":\"best\"},{\"k\":\"total\",\"from\":10,\"to\":500},{\"k\":\"invoice_date\",\"from\":\"2026-01-01\",\"to\":\"2026-01-31\"},{\"k\":\"status_label\",\"in\":[\"Paid\",\"Unpaid\"]}]"},{"name":"sort","in":"query","required":false,"schema":{"description":"A field to sort by; put - in front for largest / newest / Z first, e.g. -total","type":"string","maxLength":60},"description":"A field to sort by; put - in front for largest / newest / Z first, e.g. -total"}]}},"/lists/items":{"get":{"operationId":"lists.items","summary":"All items (a page at a time)","description":"Active items (stock, non-inventory and services) with type, supplier, stock on hand, available, on order, sold in 30 days, days of cover and price, with column searches and sorting.","tags":["Documents and lists"],"x-aurient-kind":"read","x-aurient-permission":["inventory.item.view","inventory.stock.view"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":1000}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"filters","in":"query","required":false,"schema":{"description":"Column searches as JSON, e.g. [{\"k\":\"customer_name\",\"q\":\"best\"},{\"k\":\"total\",\"from\":10,\"to\":500},{\"k\":\"invoice_date\",\"from\":\"2026-01-01\",\"to\":\"2026-01-31\"},{\"k\":\"status_label\",\"in\":[\"Paid\",\"Unpaid\"]}]","type":"string","maxLength":4000},"description":"Column searches as JSON, e.g. [{\"k\":\"customer_name\",\"q\":\"best\"},{\"k\":\"total\",\"from\":10,\"to\":500},{\"k\":\"invoice_date\",\"from\":\"2026-01-01\",\"to\":\"2026-01-31\"},{\"k\":\"status_label\",\"in\":[\"Paid\",\"Unpaid\"]}]"},{"name":"sort","in":"query","required":false,"schema":{"description":"A field to sort by; put - in front for largest / newest / Z first, e.g. -total","type":"string","maxLength":60},"description":"A field to sort by; put - in front for largest / newest / Z first, e.g. -total"},{"name":"type","in":"query","required":false,"schema":{"description":"Only items of this type","type":"string","enum":["stock","non_inventory","service"]},"description":"Only items of this type"}]}},"/crm/leads":{"get":{"operationId":"crm.pipeline","summary":"Sales pipeline","description":"The leads and deals in each stage (new, contacted, qualified, proposal sent, won, lost) with what they are worth, who owns them and the next follow-up. Filter by stage, owner (\"me\" or a name) or words.","tags":["Leads and follow-ups"],"x-aurient-kind":"read","x-aurient-permission":"sales.crm.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"stage","in":"query","required":false,"schema":{"type":"string","enum":["new","contacted","qualified","proposal","won","lost"]}},{"name":"owner","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":120}},{"name":"closedDays","in":"query","required":false,"schema":{"default":30,"type":"integer","minimum":0,"maximum":3650}}]},"post":{"operationId":"crm.createLead","summary":"Add a lead","description":"Add a lead or deal to the pipeline: someone who might buy (a new prospect, or more business from an existing customer), with what it could be worth and an optional first follow-up.","tags":["Leads and follow-ups"],"x-aurient-kind":"write","x-aurient-permission":"sales.crm.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"title":{"type":"string","minLength":2,"maxLength":160,"description":"What the deal is, e.g. \"Weekly coffee supply for Blue Bay Café\""},"contact":{"description":"The person","type":"string","maxLength":120},"organisation":{"description":"Their business","type":"string","maxLength":160},"email":{"type":"string","maxLength":190,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","maxLength":40},"source":{"description":"Walk-in, referral, website, phone, social media, trade show ...","type":"string","maxLength":40},"value":{"description":"What it is worth, in the company currency","type":"number","minimum":0,"maximum":1000000000000},"expectedClose":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"owner":{"description":"Who looks after it (default: whoever adds it)","anyOf":[{"type":"string","minLength":1},{"type":"number"}]},"customer":{"description":"An existing customer the deal is with","anyOf":[{"type":"string","minLength":1},{"type":"number"}]},"notes":{"type":"string","maxLength":5000},"stage":{"default":"new","type":"string","enum":["new","contacted","qualified","proposal","won","lost"]},"followUp":{"type":"object","properties":{"subject":{"type":"string","minLength":2,"maxLength":200},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"time":{"type":"string","pattern":"^\\d{1,2}:\\d{2}$"}},"required":["subject","date"]}},"required":["title"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/crm/leads/{lead}":{"get":{"operationId":"crm.lead","summary":"Lead","description":"One lead or deal (LD-1001): who, what it is worth, its stage and owner, the customer it became, and every call, email, meeting, note and follow-up on it.","tags":["Leads and follow-ups"],"x-aurient-kind":"read","x-aurient-permission":"sales.crm.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"lead","in":"path","required":true,"schema":{"anyOf":[{"type":"string","minLength":1},{"type":"number"}]}}]},"patch":{"operationId":"crm.updateLead","summary":"Update a lead","description":"Change a lead: move it to another stage (won, lost with the reason ...), change its value, expected close, owner or contact details.","tags":["Leads and follow-ups"],"x-aurient-kind":"write","x-aurient-permission":"sales.crm.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"title":{"type":"string","minLength":2,"maxLength":160,"description":"What the deal is, e.g. \"Weekly coffee supply for Blue Bay Café\""},"contact":{"description":"The person","type":"string","maxLength":120},"organisation":{"description":"Their business","type":"string","maxLength":160},"email":{"type":"string","maxLength":190,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"phone":{"type":"string","maxLength":40},"source":{"description":"Walk-in, referral, website, phone, social media, trade show ...","type":"string","maxLength":40},"value":{"description":"What it is worth, in the company currency","type":"number","minimum":0,"maximum":1000000000000},"expectedClose":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"owner":{"description":"Who looks after it (default: whoever adds it)","anyOf":[{"type":"string","minLength":1},{"type":"number"}]},"customer":{"description":"An existing customer the deal is with","anyOf":[{"type":"string","minLength":1},{"type":"number"}]},"notes":{"type":"string","maxLength":5000},"stage":{"type":"string","enum":["new","contacted","qualified","proposal","won","lost"]},"lostReason":{"type":"string","maxLength":255}},"required":[]}}}},"parameters":[{"name":"lead","in":"path","required":true,"schema":{"anyOf":[{"type":"string","minLength":1},{"type":"number"}]}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/crm/leads/{lead}/convert":{"post":{"operationId":"crm.convertLead","summary":"Make the lead a customer","description":"Turn a lead into a customer (a new customer from the lead's details, or link it to an existing one) so quotes, orders and invoices can be made for them. Their history comes along.","tags":["Leads and follow-ups"],"x-aurient-kind":"write","x-aurient-permission":["sales.crm.manage"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"customer":{"description":"An existing customer instead of a new one","anyOf":[{"type":"string","minLength":1},{"type":"number"}]},"won":{"default":false,"description":"Also mark the deal won","type":"boolean"}},"required":[]}}}},"parameters":[{"name":"lead","in":"path","required":true,"schema":{"anyOf":[{"type":"string","minLength":1},{"type":"number"}]}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/crm/activities":{"get":{"operationId":"crm.activities","summary":"Calls, notes and follow-ups","description":"Everything logged with a customer or a lead: calls, emails, meetings, notes, follow-ups (open and done) and requests the customer sent from the portal, newest first.","tags":["Leads and follow-ups"],"x-aurient-kind":"read","x-aurient-permission":"sales.crm.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1},{"type":"number"}]}},{"name":"lead","in":"query","required":false,"schema":{"anyOf":[{"type":"string","minLength":1},{"type":"number"}]}},{"name":"limit","in":"query","required":false,"schema":{"default":100,"type":"integer","minimum":1,"maximum":500}}]},"post":{"operationId":"crm.logActivity","summary":"Log a call, note or follow-up","description":"Record a call, email, meeting or note with a customer or lead, or set a follow-up (give a date): it shows on their record and on the follow-ups list of whoever it is for.","tags":["Leads and follow-ups"],"x-aurient-kind":"write","x-aurient-permission":"sales.crm.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"customer":{"anyOf":[{"type":"string","minLength":1},{"type":"number"}]},"lead":{"anyOf":[{"type":"string","minLength":1},{"type":"number"}]},"kind":{"default":"note","type":"string","enum":["call","email","meeting","task","note"]},"subject":{"type":"string","minLength":2,"maxLength":200},"details":{"type":"string","maxLength":5000},"dueDate":{"description":"Makes it a follow-up due that day","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"dueTime":{"type":"string","pattern":"^\\d{1,2}:\\d{2}$"},"assignTo":{"description":"Who should do the follow-up (default: you)","anyOf":[{"type":"string","minLength":1},{"type":"number"}]},"docRef":{"type":"string","maxLength":30}},"required":["subject"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/crm/activities/{id}/done":{"post":{"operationId":"crm.completeActivity","summary":"Mark a follow-up done","description":"Mark a follow-up or a customer's portal request done, with what happened, and optionally set the next follow-up.","tags":["Leads and follow-ups"],"x-aurient-kind":"write","x-aurient-permission":"sales.crm.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"outcome":{"type":"string","maxLength":255},"next":{"type":"object","properties":{"subject":{"type":"string","minLength":2,"maxLength":200},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"time":{"type":"string","pattern":"^\\d{1,2}:\\d{2}$"}},"required":["subject","date"]}},"required":[]}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/crm/follow-ups":{"get":{"operationId":"crm.followUps","summary":"Follow-ups","description":"Follow-ups that are overdue, due today and coming up, and requests customers sent from the portal that nobody has dealt with. \"mine\" (default) or everyone's.","tags":["Leads and follow-ups"],"x-aurient-kind":"read","x-aurient-permission":"sales.crm.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"who","in":"query","required":false,"schema":{"default":"mine","type":"string","enum":["mine","all"]}},{"name":"days","in":"query","required":false,"schema":{"default":7,"type":"integer","minimum":1,"maximum":90}}]}},"/home/describe":{"post":{"operationId":"home.describe","summary":"Bubble subtitles","description":"Live subtitles for home-screen shortcuts.","tags":["Reports"],"x-aurient-kind":"read","x-aurient-permission":null,"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"targets":{"maxItems":60,"type":"array","items":{"type":"string","maxLength":120}}},"required":["targets"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/uom":{"get":{"operationId":"uom.list","summary":"Units of measure","description":"The units of measure the company uses (EA, CASE, KG...) and how many items use each.","tags":["Items"],"x-aurient-kind":"read","x-aurient-permission":null,"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}},"put":{"operationId":"uom.save","summary":"Save unit of measure","description":"Add or change a unit of measure (code, name, kind, decimals allowed). Conversions are set per item.","tags":["Items"],"x-aurient-kind":"write","x-aurient-permission":"inventory.setup.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"code":{"type":"string","pattern":"^[A-Z0-9_-]{1,12}$"},"name":{"type":"string","minLength":1,"maxLength":60},"kind":{"default":"count","type":"string","enum":["count","weight","volume","length","area","time","other"]},"decimals":{"default":0,"description":"Decimal places allowed (0 = whole units only)","type":"integer","minimum":0,"maximum":3},"isActive":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},"required":["code","name"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/item-units":{"get":{"operationId":"itemUnits.list","summary":"Item units","description":"An item's units with their conversion to the base unit, barcode, price and cost per unit (or every item's units, for pick lists).","tags":["Items"],"x-aurient-kind":"read","x-aurient-permission":null,"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"item","in":"query","required":false,"schema":{"description":"Omit for every item (pick lists)","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"description":"Omit for every item (pick lists)"}]}},"/items/{item}/units":{"put":{"operationId":"itemUnits.save","summary":"Add or change an item unit","description":"Set up a unit for an item, e.g. CASE = 12 EA, with an optional barcode, its own price and cost, and dimensions. Lines can then be written in that unit.","tags":["Items"],"x-aurient-kind":"write","x-aurient-permission":"inventory.item.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"unit":{"type":"string","minLength":1,"maxLength":20,"description":"Unit of measure code or name, e.g. CASE. Defaults to the item's purchase or sales unit; quantity and price on the line are per this unit"},"qtyPerBase":{"type":"number","exclusiveMinimum":0,"maximum":10000000,"description":"How many base units one of this unit holds, e.g. 12"},"barcode":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"listPrice":{"anyOf":[{"type":"number","minimum":0,"maximum":1000000000000,"description":"Amount in the document currency"},{"type":"null"}]},"standardCost":{"anyOf":[{"type":"number","minimum":0,"maximum":1000000000000,"description":"Amount in the document currency"},{"type":"null"}]},"weightKg":{"type":"number","minimum":0,"maximum":1000000},"lengthCm":{"type":"number","minimum":0,"maximum":100000},"widthCm":{"type":"number","minimum":0,"maximum":100000},"heightCm":{"type":"number","minimum":0,"maximum":100000},"isActive":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},"required":["unit","qtyPerBase"]}}}},"parameters":[{"name":"item","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/items/{item}/units/{unit}":{"delete":{"operationId":"itemUnits.remove","summary":"Stop using an item unit","description":"Stop using a unit for an item (it stays on old documents). The base unit and the item's default purchase/sales units can't be removed.","tags":["Items"],"x-aurient-kind":"write","x-aurient-permission":"inventory.item.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"item","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"unit","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":20,"description":"Unit of measure code or name, e.g. CASE. Defaults to the item's purchase or sales unit; quantity and price on the line are per this unit"},"description":"Unit of measure code or name, e.g. CASE. Defaults to the item's purchase or sales unit; quantity and price on the line are per this unit"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/barcodes/{code}":{"get":{"operationId":"barcodes.lookup","summary":"Look up a barcode","description":"Which item and unit a scanned barcode is (a case barcode gives the item in CASE).","tags":["Items"],"x-aurient-kind":"read","x-aurient-permission":null,"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":40}}]}},"/items/{item}/convert":{"get":{"operationId":"itemUnits.convert","summary":"Convert a quantity","description":"Convert a quantity of an item between its units, e.g. 3 CASE = 36 EA, or how many PALLET 500 EA is.","tags":["Items"],"x-aurient-kind":"read","x-aurient-permission":null,"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"item","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"qty","in":"query","required":true,"schema":{"type":"number","minimum":0}},{"name":"from","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":20,"description":"Unit of measure code or name, e.g. CASE. Defaults to the item's purchase or sales unit; quantity and price on the line are per this unit"},"description":"Unit of measure code or name, e.g. CASE. Defaults to the item's purchase or sales unit; quantity and price on the line are per this unit"},{"name":"to","in":"query","required":false,"schema":{"description":"Defaults to the base unit","type":"string","minLength":1,"maxLength":20},"description":"Defaults to the base unit"}]}},"/lots":{"get":{"operationId":"lots.list","summary":"Lots and expiry","description":"Stock by lot / batch with expiry dates, days left and status; filter by item, warehouse or how soon they expire. Expired lots are included.","tags":["Items"],"x-aurient-kind":"read","x-aurient-permission":"inventory.stock.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"item","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"expiringWithinDays","in":"query","required":false,"schema":{"description":"Only lots expiring within this many days (and expired ones)","type":"integer","minimum":0,"maximum":3650},"description":"Only lots expiring within this many days (and expired ones)"},{"name":"includeEmpty","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}}]}},"/lots/{lot}":{"get":{"operationId":"lots.get","summary":"Trace a lot","description":"Where a lot came from and where it went (lot traceability / recall): the receipt and supplier, every movement, which customers it was shipped to, and what is left by warehouse and bin.","tags":["Items"],"x-aurient-kind":"read","x-aurient-permission":"inventory.stock.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"lot","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":40,"description":"Lot number"},"description":"Lot number"},{"name":"item","in":"query","required":false,"schema":{"description":"Needed when two items share a lot number","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"description":"Needed when two items share a lot number"}]},"patch":{"operationId":"lots.update","summary":"Change a lot","description":"Correct a lot expiry date, or put a lot on hold: quarantine or blocked lots are never picked for orders or transfers (e.g. a supplier recall), available puts it back.","tags":["Items"],"x-aurient-kind":"write","x-aurient-permission":"inventory.setup.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"item":{"description":"Needed when two items share a lot number","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"expiry":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"status":{"type":"string","enum":["available","quarantine","blocked"]},"notes":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]}},"required":[]}}}},"parameters":[{"name":"lot","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":40,"description":"Lot number"},"description":"Lot number"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/bins":{"get":{"operationId":"bins.list","summary":"Bins","description":"Bins in each warehouse (type, zone, pick order, blocked) with how much stock is in them; withContents lists the items and lots in every bin.","tags":["Stock"],"x-aurient-kind":"read","x-aurient-permission":["inventory.stock.view","inventory.bin.move","inventory.receive","sales.order.ship"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"withContents","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}}]},"put":{"operationId":"bins.save","summary":"Add or change a bin","description":"Create or update a bin in a warehouse: type (storage, pick, receiving, shipping, quarantine), the zone it is in, pick order, or block it.","tags":["Stock"],"x-aurient-kind":"write","x-aurient-permission":"inventory.setup.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"warehouse":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"code":{"type":"string","pattern":"^[A-Z0-9_.-]{1,20}$"},"description":{"type":"string","maxLength":120},"zone":{"description":"Zone code or name in the warehouse (set zones up first)","anyOf":[{"type":"string","maxLength":80},{"type":"null"}]},"binType":{"type":"string","enum":["storage","pick","receiving","shipping","quarantine"]},"pickSequence":{"type":"integer","minimum":0,"maximum":1000000},"blocked":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},"required":["warehouse","code"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/zones":{"get":{"operationId":"zones.list","summary":"Warehouse zones","description":"The zones in each warehouse (Chill, Frozen, Dry...: what kind of stock is kept there), with how many bins are in each and how many items are kept there.","tags":["Stock"],"x-aurient-kind":"read","x-aurient-permission":null,"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"}]},"put":{"operationId":"zones.save","summary":"Add or change a warehouse zone","description":"Add or change a zone of a warehouse: its code and name, what kind of stock is kept there, its walk order, or switch it off.","tags":["Stock"],"x-aurient-kind":"write","x-aurient-permission":"inventory.setup.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"warehouse":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"code":{"type":"string","pattern":"^[A-Z0-9_.-]{1,20}$"},"name":{"type":"string","minLength":1,"maxLength":80},"inventoryType":{"description":"What is kept here, e.g. chilled dairy and meat","anyOf":[{"type":"string","maxLength":160},{"type":"null"}]},"sort":{"type":"integer","minimum":0,"maximum":9999},"active":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},"required":["warehouse","code","name"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/zones/{zone}":{"delete":{"operationId":"zones.delete","summary":"Remove a warehouse zone","description":"Removes a zone that has no bins and no items kept in it (otherwise switch it off, or move them first).","tags":["Stock"],"x-aurient-kind":"write","x-aurient-permission":"inventory.setup.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"zone","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/warehouses/{warehouse}/bins":{"put":{"operationId":"bins.warehouse","summary":"Bins on or off for a warehouse","description":"Switch bin locations on or off for a warehouse and choose its receiving and shipping bins. Switching on puts the stock that is not in a bin into the receiving bin.","tags":["Stock"],"x-aurient-kind":"write","x-aurient-permission":"inventory.setup.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"useBins":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"receiveBin":{"description":"Where receipts land","anyOf":[{"type":"string","minLength":1,"maxLength":20,"description":"Bin code inside the warehouse, e.g. A-01"},{"type":"null"}]},"shipBin":{"anyOf":[{"type":"string","minLength":1,"maxLength":20,"description":"Bin code inside the warehouse, e.g. A-01"},{"type":"null"}]}},"required":["useBins"]}}}},"parameters":[{"name":"warehouse","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/items/{item}/bin":{"put":{"operationId":"bins.itemDefault","summary":"Set where an item lives","description":"Set (or clear) the zone and the usual bin an item lives in, in one warehouse. Receipts put it away there; picking lists, order lines and the dispatch board show it. With only a bin, the item takes that bin's zone.","tags":["Stock"],"x-aurient-kind":"write","x-aurient-permission":"inventory.setup.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"warehouse":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"bin":{"anyOf":[{"type":"string","minLength":1,"maxLength":20,"description":"Bin code inside the warehouse, e.g. A-01"},{"type":"null"}]},"zone":{"description":"Zone code or name in that warehouse (null = follow the usual bin's zone)","anyOf":[{"type":"string","maxLength":80},{"type":"null"}]}},"required":["warehouse"]}}}},"parameters":[{"name":"item","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/bin-moves":{"post":{"operationId":"bins.move","summary":"Move stock between bins","description":"Move stock from one bin to another inside a warehouse (put-away, replenish a pick face, quarantine). No cost or ledger effect. Omit from to put away stock that is not in a bin yet.","tags":["Stock"],"x-aurient-kind":"write","x-aurient-permission":"inventory.bin.move","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"warehouse":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"item":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000},"unit":{"type":"string","minLength":1,"maxLength":20,"description":"Unit of measure code or name, e.g. CASE. Defaults to the item's purchase or sales unit; quantity and price on the line are per this unit"},"from":{"description":"Omit to move stock that is not in a bin yet","type":"string","minLength":1,"maxLength":20},"to":{"type":"string","minLength":1,"maxLength":20,"description":"Bin code inside the warehouse, e.g. A-01"},"lot":{"type":"string","minLength":1,"maxLength":40},"note":{"type":"string","maxLength":255}},"required":["warehouse","item","qty","to"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/item-families":{"get":{"operationId":"families.list","summary":"Products with variants","description":"Products sold in variants (size, colour, flavour...) with how many variants each has, stock and price range.","tags":["Items"],"x-aurient-kind":"read","x-aurient-permission":"inventory.item.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":100}}]},"post":{"operationId":"families.create","summary":"New product with variants","description":"Create a product sold in variants and (by default) one item per combination of attribute values, e.g. Size x Scent. Each variant is a normal item with its own SKU, stock and price.","tags":["Items"],"x-aurient-kind":"write","x-aurient-permission":"inventory.item.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"code":{"type":"string","pattern":"^[A-Z0-9_-]{1,30}$"},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000},"attributes":{"minItems":1,"maxItems":3,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":40},"values":{"minItems":1,"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}}},"required":["name","values"]},"description":"e.g. [{name:\"Size\", values:[\"500ml\",\"750ml\"]}]"},"supplier":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Default supplier for the variants"},"standardCost":{"type":"number","minimum":0,"maximum":1000000000000,"description":"Amount in the document currency"},"listPrice":{"type":"number","minimum":0,"maximum":1000000000000,"description":"Amount in the document currency"},"uom":{"type":"string","maxLength":12},"taxRate":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"generate":{"description":"Create a variant item for every combination now","anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"skuPattern":{"description":"Default {code}-{values}, e.g. DS-750ML-LEMON","type":"string","maxLength":60}},"required":["code","name","attributes","supplier","standardCost","listPrice"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/item-families/{family}":{"get":{"operationId":"families.get","summary":"Product variants","description":"One product family: its attributes and every variant with SKU, values, price and stock per warehouse (the variant matrix).","tags":["Items"],"x-aurient-kind":"read","x-aurient-permission":"inventory.item.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"family","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Family code or id"},"description":"Family code or id"}]}},"/item-families/{family}/variants":{"post":{"operationId":"families.addVariant","summary":"Add a variant","description":"Add one variant to a product family (new attribute values are added to the family). Or link an existing item with set_item_family.","tags":["Items"],"x-aurient-kind":"write","x-aurient-permission":"inventory.item.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","maxLength":40},"description":"{\"Size\":\"1L\"}; new values are added to the family"},"sku":{"type":"string","maxLength":40},"name":{"type":"string","maxLength":200},"standardCost":{"type":"number","minimum":0,"maximum":1000000000000,"description":"Amount in the document currency"},"listPrice":{"type":"number","minimum":0,"maximum":1000000000000,"description":"Amount in the document currency"}},"required":["values"]}}}},"parameters":[{"name":"family","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Family code or id"},"description":"Family code or id"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/items/{item}/family":{"put":{"operationId":"families.setItem","summary":"Link an item to a product family","description":"Make an existing item a variant of a product family (with its attribute values), or unlink it (family null).","tags":["Items"],"x-aurient-kind":"write","x-aurient-permission":"inventory.item.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"family":{"anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"type":"null"}]},"values":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"string","maxLength":40}}},"required":["family"]}}}},"parameters":[{"name":"item","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/items/{item}/components":{"put":{"operationId":"kits.setComponents","summary":"Set kit or assembly components","description":"Make an item a kit (sold as one; shipping it takes its components out of stock) or an assembly (built into stock from components with assemble_items), and set what goes into one unit. kitType none removes it.","tags":["Items"],"x-aurient-kind":"write","x-aurient-permission":"inventory.item.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"kitType":{"type":"string","enum":["none","kit","assembly"],"description":"kit = sold as one, ships its components; assembly = built into stock; none = remove"},"components":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"item":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000,"description":"In the component unit given (default its base unit)"},"unit":{"type":"string","minLength":1,"maxLength":20,"description":"Unit of measure code or name, e.g. CASE. Defaults to the item's purchase or sales unit; quantity and price on the line are per this unit"}},"required":["item","qty"]}}},"required":["kitType","components"]}}}},"parameters":[{"name":"item","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"$ref":"#/components/parameters/IdempotencyKey"}]},"get":{"operationId":"kits.get","summary":"Kit / assembly components","description":"What goes into a kit or assembly, the cost of its components, and how many could be made from stock in each warehouse (and which component runs out first).","tags":["Items"],"x-aurient-kind":"read","x-aurient-permission":"inventory.item.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"item","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"}]}},"/kits":{"get":{"operationId":"kits.list","summary":"Kits and assemblies","description":"Every kit and assembly with its components and how many could be made from stock in each warehouse.","tags":["Items"],"x-aurient-kind":"read","x-aurient-permission":"inventory.item.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/assembly-orders":{"post":{"operationId":"kits.assemble","summary":"Build assemblies","description":"Build an assembly into stock: its components leave stock at average cost and the assembly arrives at exactly that cost (AS- document). Refuses if a component is short.","tags":["Items"],"x-aurient-kind":"write","x-aurient-permission":"inventory.assemble","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"item":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"The assembly to build"},"warehouse":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000},"unit":{"type":"string","minLength":1,"maxLength":20,"description":"Unit of measure code or name, e.g. CASE. Defaults to the item's purchase or sales unit; quantity and price on the line are per this unit"},"assemblyDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"lot":{"type":"string","maxLength":40},"expiry":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"bin":{"type":"string","minLength":1,"maxLength":20,"description":"Bin code inside the warehouse, e.g. A-01"},"notes":{"type":"string","maxLength":2000}},"required":["item","warehouse","qty"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]},"get":{"operationId":"kits.assemblies","summary":"Assembly orders","description":"Assemblies built: what, how many, where, and at what cost.","tags":["Items"],"x-aurient-kind":"read","x-aurient-permission":"inventory.stock.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"item","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}}]}},"/inventory/checks":{"get":{"operationId":"inventory.checks","summary":"Inventory checks","description":"Proves stock is consistent: bins and lots add up to the stock ledger, cached levels match the moves, plus expired and soon-expiring stock, held lots, stock outside bins in bin warehouses, and kits that cannot be made.","tags":["Stock"],"x-aurient-kind":"read","x-aurient-permission":"inventory.stock.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/report-center":{"get":{"operationId":"reports.catalog","summary":"Report catalogue","description":"Every report the user can run (financial statements, receivables & payables, sales, purchasing, inventory, admin) with its id, what it shows and which filters it takes, plus the user's saved reports. Call this to pick the right report id for run_report.","tags":["Reports"],"x-aurient-kind":"read","x-aurient-permission":null,"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"q","in":"query","required":false,"schema":{"description":"Words to look for in report names and descriptions","type":"string","maxLength":100},"description":"Words to look for in report names and descriptions"},{"name":"category","in":"query","required":false,"schema":{"type":"string","maxLength":60}}]}},"/report-center/run/{report}":{"get":{"operationId":"reports.run","summary":"Run a report","description":"Runs any report from list_reports with filters (date preset or from/to, as-of date, comparison period, warehouse, customer, supplier, item, category, grouping) and returns its headline figures (kpis), a one-line summary, the columns and rows with subtotals and totals. Use it for questions like \"aged receivables at month end\", \"P&L this quarter vs last\", \"sales by customer this year\", \"slow-moving stock\". Answer from summary and kpis; quote rows only when asked.","tags":["Reports"],"x-aurient-kind":"read","x-aurient-permission":null,"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"report","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":60,"description":"Report id from list_reports, e.g. aged_receivables, income_statement, sales_by_customer"},"description":"Report id from list_reports, e.g. aged_receivables, income_statement, sales_by_customer"},{"name":"preset","in":"query","required":false,"schema":{"description":"Date range: today, yesterday, this_week, last_week, this_month, last_month, this_quarter, last_quarter, this_year (year to date), last_year, last_7, last_30, last_90, last_365 (last 12 months) or custom with from/to","type":"string","enum":["today","yesterday","this_week","last_week","this_month","last_month","this_quarter","last_quarter","this_year","last_year","last_7","last_30","last_90","last_365","custom"]},"description":"Date range: today, yesterday, this_week, last_week, this_month, last_month, this_quarter, last_quarter, this_year (year to date), last_year, last_7, last_30, last_90, last_365 (last 12 months) or custom with from/to"},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"asOf","in":"query","required":false,"schema":{"description":"For balance, aging and valuation reports: the date to report as of (default today)","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"For balance, aging and valuation reports: the date to report as of (default today)"},{"name":"compare","in":"query","required":false,"schema":{"description":"Add columns for an earlier period","type":"string","enum":["none","previous_period","previous_year"]},"description":"Add columns for an earlier period"},{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"supplier","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"item","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"bank","in":"query","required":false,"schema":{"description":"Bank account name (cash book)","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"description":"Bank account name (cash book)"},{"name":"category","in":"query","required":false,"schema":{"description":"Item category name","type":"string","maxLength":80},"description":"Item category name"},{"name":"status","in":"query","required":false,"schema":{"description":"Report-specific status filter, e.g. \"overdue\", \"over_limit\", \"below_reorder\", \"late\"","type":"string","maxLength":40},"description":"Report-specific status filter, e.g. \"overdue\", \"over_limit\", \"below_reorder\", \"late\""},{"name":"account","in":"query","required":false,"schema":{"description":"G/L account number or name","type":"string","maxLength":80},"description":"G/L account number or name"},{"name":"top","in":"query","required":false,"schema":{"description":"Only the first N rows","type":"integer","minimum":0,"maximum":1000},"description":"Only the first N rows"},{"name":"days","in":"query","required":false,"schema":{"description":"Days window for reports that use one (slow-moving, expiry, lapsed customers, forecasts)","type":"integer","minimum":1,"maximum":3650},"description":"Days window for reports that use one (slow-moving, expiry, lapsed customers, forecasts)"},{"name":"interval","in":"query","required":false,"schema":{"type":"string","enum":["day","week","month"]}},{"name":"groupBy","in":"query","required":false,"schema":{"description":"One of the report's groupBy keys, or \"none\"","type":"string","maxLength":40},"description":"One of the report's groupBy keys, or \"none\""},{"name":"limit","in":"query","required":false,"schema":{"description":"Most rows to return; use 50-100 when answering in chat","type":"integer","minimum":1,"maximum":20000},"description":"Most rows to return; use 50-100 when answering in chat"}]}},"/report-center/presets":{"post":{"operationId":"reports.presets.save","summary":"Save a report","description":"Saves a report with its filters under a name (e.g. \"Aged receivables - Bridgetown\") so it can be opened again in one click, optionally shared with colleagues. Updating an existing saved report needs its id.","tags":["Reports"],"x-aurient-kind":"write","x-aurient-permission":null,"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"description":"Saved report id to update; omit to create","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"report":{"type":"string","minLength":1,"maxLength":60},"name":{"type":"string","minLength":1,"maxLength":120},"params":{"default":{},"description":"Prefer relative presets (this_month, last_month) so the saved report stays current","type":"object","properties":{"preset":{"description":"Date range: today, yesterday, this_week, last_week, this_month, last_month, this_quarter, last_quarter, this_year (year to date), last_year, last_7, last_30, last_90, last_365 (last 12 months) or custom with from/to","type":"string","enum":["today","yesterday","this_week","last_week","this_month","last_month","this_quarter","last_quarter","this_year","last_year","last_7","last_30","last_90","last_365","custom"]},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"asOf":{"description":"For balance, aging and valuation reports: the date to report as of (default today)","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"compare":{"description":"Add columns for an earlier period","type":"string","enum":["none","previous_period","previous_year"]},"warehouse":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"customer":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"supplier":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"item":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"bank":{"description":"Bank account name (cash book)","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"category":{"description":"Item category name","type":"string","maxLength":80},"status":{"description":"Report-specific status filter, e.g. \"overdue\", \"over_limit\", \"below_reorder\", \"late\"","type":"string","maxLength":40},"account":{"description":"G/L account number or name","type":"string","maxLength":80},"top":{"description":"Only the first N rows","type":"integer","minimum":0,"maximum":1000},"days":{"description":"Days window for reports that use one (slow-moving, expiry, lapsed customers, forecasts)","type":"integer","minimum":1,"maximum":3650},"interval":{"type":"string","enum":["day","week","month"]},"groupBy":{"description":"One of the report's groupBy keys, or \"none\"","type":"string","maxLength":40}}},"shared":{"description":"true = everyone who can see the report can use it","anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"pinned":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},"required":["report","name"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/report-center/presets/{id}":{"delete":{"operationId":"reports.presets.delete","summary":"Delete a saved report","description":"Deletes one of the user's saved reports (the report itself stays available).","tags":["Reports"],"x-aurient-kind":"write","x-aurient-permission":null,"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/report-center/schedules":{"get":{"operationId":"reports.schedules.list","summary":"Scheduled reports","description":"The user's scheduled reports: which report, how often and when, file format, recipients, the next run and how the last run went.","tags":["Reports"],"x-aurient-kind":"read","x-aurient-permission":"reports.use","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"reports.schedules.save","summary":"Schedule a report","description":"Sets a report to run on its own - daily, weekly (on a weekday) or monthly (on a day 1-28) at an hour in the company time zone - as PDF, Excel or both, keeping each run's files and emailing them to the recipients when email is set up. Use relative date presets (e.g. last_month for a report on the 1st).","tags":["Reports"],"x-aurient-kind":"write","x-aurient-permission":"reports.use","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"description":"Schedule id to update; omit to create","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"report":{"type":"string","minLength":1,"maxLength":60},"name":{"type":"string","minLength":1,"maxLength":120},"params":{"default":{},"description":"Use relative presets: a monthly report on day 1 normally uses last_month","type":"object","properties":{"preset":{"description":"Date range: today, yesterday, this_week, last_week, this_month, last_month, this_quarter, last_quarter, this_year (year to date), last_year, last_7, last_30, last_90, last_365 (last 12 months) or custom with from/to","type":"string","enum":["today","yesterday","this_week","last_week","this_month","last_month","this_quarter","last_quarter","this_year","last_year","last_7","last_30","last_90","last_365","custom"]},"from":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"to":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"asOf":{"description":"For balance, aging and valuation reports: the date to report as of (default today)","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"compare":{"description":"Add columns for an earlier period","type":"string","enum":["none","previous_period","previous_year"]},"warehouse":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"customer":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"supplier":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"item":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"bank":{"description":"Bank account name (cash book)","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"category":{"description":"Item category name","type":"string","maxLength":80},"status":{"description":"Report-specific status filter, e.g. \"overdue\", \"over_limit\", \"below_reorder\", \"late\"","type":"string","maxLength":40},"account":{"description":"G/L account number or name","type":"string","maxLength":80},"top":{"description":"Only the first N rows","type":"integer","minimum":0,"maximum":1000},"days":{"description":"Days window for reports that use one (slow-moving, expiry, lapsed customers, forecasts)","type":"integer","minimum":1,"maximum":3650},"interval":{"type":"string","enum":["day","week","month"]},"groupBy":{"description":"One of the report's groupBy keys, or \"none\"","type":"string","maxLength":40}}},"frequency":{"type":"string","enum":["daily","weekly","monthly"]},"weekday":{"description":"weekly: 1 = Monday ... 7 = Sunday (default Monday)","type":"integer","minimum":1,"maximum":7},"monthDay":{"description":"monthly: day of the month 1-28 (default 1)","type":"integer","minimum":1,"maximum":28},"hour":{"default":7,"description":"Hour in the company time zone","type":"integer","minimum":0,"maximum":23},"format":{"default":"pdf","type":"string","enum":["pdf","xlsx","both"]},"recipients":{"default":[],"description":"Email addresses to send the files to (needs email set up on the server); files are always kept in the run history","maxItems":20,"type":"array","items":{"type":"string","maxLength":200,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"active":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},"required":["report","name","frequency"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/report-center/schedules/{id}":{"delete":{"operationId":"reports.schedules.delete","summary":"Delete a report schedule","description":"Stops and deletes one of the user's scheduled reports. Past runs and their files stay in the history.","tags":["Reports"],"x-aurient-kind":"write","x-aurient-permission":"reports.use","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/report-center/schedules/{id}/run":{"post":{"operationId":"reports.schedules.runNow","summary":"Run a scheduled report now","description":"Runs one of the user's scheduled reports straight away (files kept in the history and emailed to its recipients), without changing its next run.","tags":["Reports"],"x-aurient-kind":"write","x-aurient-permission":"reports.use","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/report-center/runs":{"get":{"operationId":"reports.runs.list","summary":"Report run history","description":"Recent scheduled report runs for the user: when, which report, the period covered, the one-line summary, whether it was emailed, and the files.","tags":["Reports"],"x-aurient-kind":"read","x-aurient-permission":null,"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"schedule","in":"query","required":false,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}}]}},"/dispatch":{"get":{"operationId":"dispatch.board","summary":"Dispatch board","description":"The day's deliveries for a warehouse (default today, all warehouses): every delivery run with its vehicle, driver, stops and progress, deliveries still waiting for a run (with weight, delivery window and whether the customer has a map location), vehicles and drivers.","tags":["Deliveries"],"x-aurient-kind":"read","x-aurient-permission":"dispatch.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"date","in":"query","required":false,"schema":{"description":"Default today","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"Default today"},{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"}]}},"/dispatch/waiting":{"get":{"operationId":"dispatch.waiting","summary":"Deliveries waiting","description":"Shipments that have left stock but are not delivered and not on a live run: customer, order, days waiting, weight, delivery window, failed attempts and whether the customer is on the map.","tags":["Deliveries"],"x-aurient-kind":"read","x-aurient-permission":"dispatch.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"}]}},"/dispatch/runs/{run}":{"get":{"operationId":"dispatch.run.get","summary":"Delivery run","description":"One delivery run: depot, vehicle, driver, planned km and finish time, and every stop in order with customer, address, map location, delivery window, ETA (and whether it will be late), what is on board, cash to collect and the outcome so far.","tags":["Deliveries"],"x-aurient-kind":"read","x-aurient-permission":["dispatch.view","dispatch.drive"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"run","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Delivery run id or number, e.g. RN-1001"},"description":"Delivery run id or number, e.g. RN-1001"}]},"patch":{"operationId":"dispatch.runs.update","summary":"Change a delivery run","description":"Changes a run's date, vehicle, driver, start time, whether it returns to the depot, notes, or the order of its stops (list every remaining stop id in the new order).","tags":["Deliveries"],"x-aurient-kind":"write","x-aurient-permission":"dispatch.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"vehicle":{"anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"type":"null"}]},"driver":{"anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"type":"null"}]},"startTime":{"type":"string","pattern":"^([01]?\\d|2[0-3]):[0-5]\\d(:[0-5]\\d)?$"},"returnToDepot":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"notes":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"order":{"description":"Stop ids in the order to drive them (manual re-order)","maxItems":300,"type":"array","items":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}}},"required":[]}}}},"parameters":[{"name":"run","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Delivery run id or number, e.g. RN-1001"},"description":"Delivery run id or number, e.g. RN-1001"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/dispatch/runs":{"get":{"operationId":"dispatch.runs.list","summary":"Delivery runs","description":"Delivery runs over a date range (default the last 14 days and next 7), filtered by status, driver or vehicle, with stops delivered, failed and late.","tags":["Deliveries"],"x-aurient-kind":"read","x-aurient-permission":"dispatch.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["planned","out","completed","cancelled"]}},{"name":"driver","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"vehicle","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}}]},"post":{"operationId":"dispatch.runs.create","summary":"Create a delivery run","description":"Creates a delivery run for a date from a warehouse, with a vehicle and driver, and puts shipments on it (or ships sales orders and puts them on it). The stops are put in the best order unless optimise is false.","tags":["Deliveries"],"x-aurient-kind":"write","x-aurient-permission":"dispatch.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"warehouse":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"vehicle":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"driver":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"startTime":{"type":"string","pattern":"^([01]?\\d|2[0-3]):[0-5]\\d(:[0-5]\\d)?$"},"area":{"description":"Route area the run serves (its usual van and driver when none are given)","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"shipments":{"default":[],"description":"Shipment numbers (SH-...) to deliver","maxItems":200,"type":"array","items":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"}},"salesOrders":{"default":[],"description":"Sales orders to deliver: they ship when the run goes out","maxItems":200,"type":"array","items":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"}},"optimise":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"notes":{"type":"string","maxLength":1000}},"required":["warehouse"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/dispatch/my":{"get":{"operationId":"dispatch.my","summary":"My deliveries","description":"For a driver: their delivery runs today (and any still out from earlier) with every stop.","tags":["Deliveries"],"x-aurient-kind":"read","x-aurient-permission":"dispatch.drive","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"date","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}]}},"/dispatch/locations":{"get":{"operationId":"dispatch.locations.list","summary":"Customer delivery locations","description":"Where each customer takes deliveries: address, map coordinates (or missing), delivery window, days, unloading time, contact and instructions, plus their open orders and balance.","tags":["Deliveries"],"x-aurient-kind":"read","x-aurient-permission":["dispatch.view","sales.customer.view"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"missing","in":"query","required":false,"schema":{"description":"Only locations without map coordinates","anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"description":"Only locations without map coordinates"}]},"put":{"operationId":"dispatch.locations.save","summary":"Set a customer delivery location","description":"Adds or changes where a customer takes deliveries: address, map coordinates (or look the address up with geocode: true), delivery window (e.g. 07:00-11:00), days they accept deliveries, unloading minutes, contact and instructions.","tags":["Deliveries"],"x-aurient-kind":"write","x-aurient-permission":"dispatch.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"customer":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"label":{"default":"Main","type":"string","maxLength":80},"address":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]},"city":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"country":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}]},"latitude":{"anyOf":[{"type":"number","minimum":-90,"maximum":90},{"type":"null"}]},"longitude":{"anyOf":[{"type":"number","minimum":-180,"maximum":180},{"type":"null"}]},"geocode":{"description":"Look the address up on the map (when no coordinates are given)","anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"windowStart":{"description":"Earliest delivery time","anyOf":[{"type":"string","pattern":"^([01]?\\d|2[0-3]):[0-5]\\d(:[0-5]\\d)?$"},{"type":"null"}]},"windowEnd":{"description":"Latest delivery time","anyOf":[{"type":"string","pattern":"^([01]?\\d|2[0-3]):[0-5]\\d(:[0-5]\\d)?$"},{"type":"null"}]},"deliveryDays":{"description":"Days they take deliveries, 1 = Monday ... 7 = Sunday","anyOf":[{"maxItems":7,"type":"array","items":{"type":"integer","minimum":1,"maximum":7}},{"type":"null"}]},"serviceMinutes":{"anyOf":[{"type":"integer","minimum":0,"maximum":600},{"type":"null"}]},"contactName":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"contactPhone":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"instructions":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"isDefault":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"active":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},"required":["customer"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/dispatch/plan":{"post":{"operationId":"dispatch.plan","summary":"Plan the day's deliveries","description":"Builds delivery runs for a day from everything waiting at a warehouse. With route areas set up: one run per route area delivered that weekday, with the area's usual van and driver, holding the area's orders due by then (shipped or not), stops put in the best order from the area's place on the map; Unassigned orders and areas not delivered that day are left for you. Without route areas: splits the shipped deliveries between the vehicles by area and capacity.","tags":["Deliveries"],"x-aurient-kind":"write","x-aurient-permission":"dispatch.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"date":{"description":"Delivery day (default today)","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"warehouse":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Depot the runs leave from"},"vehicles":{"description":"Vehicles to use (default: every active vehicle based at that warehouse that has no run that day)","maxItems":30,"type":"array","items":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"}},"customers":{"description":"Only deliveries for these customers","maxItems":200,"type":"array","items":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"}}},"required":["warehouse"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/dispatch/runs/{run}/stops":{"post":{"operationId":"dispatch.runs.add","summary":"Add deliveries to a run","description":"Puts more shipments or sales orders on an existing planned or out-for-delivery run and re-plans the order of the stops. Orders not shipped yet ship when the run goes out.","tags":["Deliveries"],"x-aurient-kind":"write","x-aurient-permission":"dispatch.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"shipments":{"default":[],"maxItems":200,"type":"array","items":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"}},"salesOrders":{"default":[],"maxItems":200,"type":"array","items":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"}},"optimise":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},"required":[]}}}},"parameters":[{"name":"run","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Delivery run id or number, e.g. RN-1001"},"description":"Delivery run id or number, e.g. RN-1001"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/dispatch/stops/{stop}":{"delete":{"operationId":"dispatch.stops.remove","summary":"Take a delivery off a run","description":"Takes a pending stop off its run; the order (or shipment) goes back to waiting for a run.","tags":["Deliveries"],"x-aurient-kind":"write","x-aurient-permission":"dispatch.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"stop","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/dispatch/runs/{run}/optimise":{"post":{"operationId":"dispatch.runs.optimise","summary":"Put stops in the best order","description":"Re-orders a run's remaining stops for the shortest drive that still meets delivery windows, and recalculates ETAs. On a run that is out, it plans from the last completed stop and the time now.","tags":["Deliveries"],"x-aurient-kind":"write","x-aurient-permission":"dispatch.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"run","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Delivery run id or number, e.g. RN-1001"},"description":"Delivery run id or number, e.g. RN-1001"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/dispatch/runs/{run}/cancel":{"post":{"operationId":"dispatch.runs.cancel","summary":"Cancel a delivery run","description":"Cancels a planned run; its deliveries go back to waiting. A run that is out can't be cancelled: complete it instead.","tags":["Deliveries"],"x-aurient-kind":"write","x-aurient-permission":"dispatch.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"run","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Delivery run id or number, e.g. RN-1001"},"description":"Delivery run id or number, e.g. RN-1001"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/dispatch/runs/{run}/start":{"post":{"operationId":"dispatch.runs.start","summary":"Start a delivery run","description":"Marks a run as out for delivery (the van has left). Orders on it that haven't shipped ship now: stock out and cost of goods sold, for what is in stock.","tags":["Deliveries"],"x-aurient-kind":"write","x-aurient-permission":"dispatch.drive","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"run","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Delivery run id or number, e.g. RN-1001"},"description":"Delivery run id or number, e.g. RN-1001"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/dispatch/stops/{stop}/record":{"post":{"operationId":"dispatch.stops.record","summary":"Record a delivery","description":"For one stop: arrived; delivered (who received it, notes, cash collected); part delivered (what the customer kept on each line, with a reason); or couldn't deliver (with the reason). On an invoiced order, what came back becomes a return request for accounts receivable; not invoiced yet, it goes back into stock and onto the order. Couldn't deliver puts the order back to waiting for a run. Cash collected is what the driver reports; accounts receivable applies it to the invoice when the run's cash comes in (Driver cash). The run is done after its last stop.","tags":["Deliveries"],"x-aurient-kind":"write","x-aurient-permission":"dispatch.drive","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"outcome":{"type":"string","enum":["arrived","delivered","part","failed"],"description":"part = delivered, but the customer did not keep everything (give lines)"},"recipient":{"description":"Who signed / received it","type":"string","maxLength":120},"reason":{"description":"Why it failed: closed, refused, no one there, wrong address...","type":"string","maxLength":255},"notes":{"type":"string","maxLength":1000},"cashCollected":{"description":"Money the driver collected at this stop","type":"number","minimum":0,"maximum":1000000000},"method":{"description":"Cash, Cheque, Card or Bank transfer (default Cash)","type":"string","maxLength":40},"reference":{"type":"string","maxLength":80},"latitude":{"type":"number","minimum":-90,"maximum":90},"longitude":{"type":"number","minimum":-180,"maximum":180},"short":{"description":"Delivered: lines the customer did not take in full. What they did not take goes back into stock (and is credited if already invoiced).","type":"array","items":{"type":"object","properties":{"line":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Shipment line"},"delivered":{"type":"number","minimum":0,"maximum":1000000000,"description":"How much the customer took, in the line unit"}},"required":["line","delivered"]}},"shortReason":{"description":"Why it was short: refused, damaged, short-loaded...","type":"string","maxLength":120},"lines":{"description":"Part delivered: what was kept on each line, with a reason","maxItems":200,"type":"array","items":{"type":"object","properties":{"line":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Shipment line"},"kept":{"type":"number","minimum":0,"maximum":1000000000,"description":"How much the customer kept, in the line unit"},"reason":{"description":"Why the rest came back","type":"string","maxLength":120}},"required":["line","kept"]}}},"required":["outcome"]}}}},"parameters":[{"name":"stop","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/dispatch/runs/{run}/complete":{"post":{"operationId":"dispatch.runs.complete","summary":"Finish a delivery run","description":"Ends a run that is out. Any stops not visited are marked skipped and their deliveries go back to waiting.","tags":["Deliveries"],"x-aurient-kind":"write","x-aurient-permission":"dispatch.drive","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"run","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Delivery run id or number, e.g. RN-1001"},"description":"Delivery run id or number, e.g. RN-1001"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/dispatch/geocode":{"post":{"operationId":"dispatch.geocode","summary":"Find customers on the map","description":"Looks up map coordinates from the address for one customer, or for every delivery location still missing them (about one a second, using OpenStreetMap).","tags":["Deliveries"],"x-aurient-kind":"write","x-aurient-permission":"dispatch.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"customer":{"description":"One customer, or every location still missing coordinates","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]}},"required":[]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/dispatch/vehicles":{"put":{"operationId":"dispatch.vehicles.save","summary":"Add or change a vehicle","description":"Adds or changes a delivery vehicle: code, name, registration, home warehouse, payload (kg), load space (m³), most stops a run and cost per km.","tags":["Deliveries"],"x-aurient-kind":"write","x-aurient-permission":"dispatch.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"code":{"type":"string","minLength":1,"maxLength":20},"name":{"type":"string","minLength":1,"maxLength":120},"registration":{"anyOf":[{"type":"string","maxLength":30},{"type":"null"}]},"warehouse":{"anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"type":"null"}]},"maxWeightKg":{"anyOf":[{"type":"number","minimum":0,"maximum":1000000},{"type":"null"}]},"maxVolumeM3":{"anyOf":[{"type":"number","minimum":0,"maximum":10000},{"type":"null"}]},"maxStops":{"anyOf":[{"type":"integer","minimum":1,"maximum":500},{"type":"null"}]},"costPerKm":{"anyOf":[{"type":"number","minimum":0,"maximum":10000},{"type":"null"}]},"active":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},"required":["code","name"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/dispatch/drivers":{"put":{"operationId":"dispatch.drivers.save","summary":"Add or change a driver","description":"Adds or changes a driver: name, phone, licence, usual vehicle, home warehouse, and the user (email) who signs in as this driver to get the driver screen.","tags":["Deliveries"],"x-aurient-kind":"write","x-aurient-permission":"dispatch.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"name":{"type":"string","minLength":1,"maxLength":120},"phone":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"licenceNo":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"user":{"description":"Email of the user who signs in as this driver","anyOf":[{"type":"string","maxLength":200},{"type":"null"}]},"vehicle":{"anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"type":"null"}]},"warehouse":{"anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"type":"null"}]},"active":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},"required":["name"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/dispatch/settings":{"put":{"operationId":"dispatch.settings.save","summary":"Dispatch settings","description":"Sets how runs are timed (average speed, road factor, minutes per stop, start time, return to depot), which payment terms count as cash on delivery, and where each warehouse (depot) is on the map.","tags":["Deliveries"],"x-aurient-kind":"write","x-aurient-permission":"dispatch.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"avgSpeedKmh":{"type":"number","minimum":5,"maximum":150},"roadFactor":{"type":"number","minimum":1,"maximum":3},"serviceMinutes":{"type":"integer","minimum":0,"maximum":240},"dayStart":{"type":"string","pattern":"^([01]?\\d|2[0-3]):[0-5]\\d(:[0-5]\\d)?$"},"returnToDepot":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"codTermsDays":{"type":"integer","minimum":0,"maximum":120},"printShipsAndInvoices":{"description":"For companies whose drivers don't use the phone screen: printing a run's manifest ships it, invoices it and sends it out","anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"requireLoadCheck":{"description":"A run can only go out after its load check (each order ticked loaded or not)","anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"depots":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"warehouse":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"latitude":{"anyOf":[{"type":"number","minimum":-90,"maximum":90},{"type":"null"}]},"longitude":{"anyOf":[{"type":"number","minimum":-180,"maximum":180},{"type":"null"}]}},"required":["warehouse","latitude","longitude"]}}},"required":[]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/dispatch/orders":{"get":{"operationId":"dispatch.orders","summary":"Dispatch board by route area","description":"The dispatch board for a warehouse and delivery dates (default today): per route area (and Unassigned) the orders to ship, waiting for a run, on runs, out for delivery, delivered and failed, stops, weight, cash to collect, late, and what is to pick in each zone; every order with its state, run and driver, missing quantity (not in stock), weight and cash; the runs; the warehouse's zones, vans and drivers.","tags":["Deliveries"],"x-aurient-kind":"read","x-aurient-permission":["dispatch.view","dispatch.manage"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"warehouse","in":"query","required":false,"schema":{"description":"Default the first warehouse","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"description":"Default the first warehouse"},{"name":"from","in":"query","required":false,"schema":{"description":"Delivery date from (default today)","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"Delivery date from (default today)"},{"name":"to","in":"query","required":false,"schema":{"description":"Delivery date to (default from)","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"Delivery date to (default from)"},{"name":"allDates","in":"query","required":false,"schema":{"description":"Ignore the delivery date","anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"description":"Ignore the delivery date"},{"name":"area","in":"query","required":false,"schema":{"description":"Route area code, or UNASSIGNED; omit for every area","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"description":"Route area code, or UNASSIGNED; omit for every area"}]}},"/dispatch/orders/{salesOrder}/lines":{"get":{"operationId":"dispatch.orderLines","summary":"Order lines for dispatch","description":"The lines of a sales order as dispatch sees them: item, description, the zone and bin it is kept in, ordered, still to ship and how much of that is short (not in stock), weight and the picking note.","tags":["Deliveries"],"x-aurient-kind":"read","x-aurient-permission":["dispatch.view","dispatch.manage"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"salesOrder","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"}]}},"/sales-order-lines/{line}/pick-note":{"put":{"operationId":"dispatch.pickNote","summary":"Picking note on an order line","description":"Sets (or clears) the note the picker and driver see on a sales order line: keep cold, weigh at depot, back door...","tags":["Deliveries"],"x-aurient-kind":"write","x-aurient-permission":"dispatch.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"note":{"anyOf":[{"type":"string","maxLength":160},{"type":"null"}]}},"required":["note"]}}}},"parameters":[{"name":"line","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Sales order line"},"description":"Sales order line"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/dispatch/run-orders":{"post":{"operationId":"dispatch.runOrders","summary":"Put orders on a run","description":"Puts the chosen sales orders on a run: an existing planned run, or a new run (for a route area: its usual van and driver, which can be changed). Orders that haven't shipped ship when the run goes out.","tags":["Deliveries"],"x-aurient-kind":"write","x-aurient-permission":"dispatch.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"run":{"description":"Existing run to add to; omit to start a new run","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"salesOrders":{"minItems":1,"maxItems":300,"type":"array","items":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"}},"date":{"description":"New run: delivery day (default today)","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"area":{"description":"New run: route area (its usual van and driver are used)","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"vehicle":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"driver":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"optimise":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},"required":["salesOrders"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/dispatch/runs/{run}/print":{"post":{"operationId":"dispatch.printManifest","summary":"Print manifest and invoices","description":"Prints a run's paperwork. When the company prints instead of using the driver phone screen (dispatch setting), it first ships what isn't shipped (stock out, cost of goods sold), creates and posts the invoices (ledger and receivables), and marks the run out for delivery; the printout is the manifest followed by every invoice. Otherwise it prints the manifest.","tags":["Deliveries"],"x-aurient-kind":"write","x-aurient-permission":"dispatch.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"run","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Delivery run id or number, e.g. RN-1001"},"description":"Delivery run id or number, e.g. RN-1001"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/dispatch/runs/{run}/delivered":{"post":{"operationId":"dispatch.runs.markDelivered","summary":"Mark delivered","description":"When the van is back: mark every stop delivered at once, or each stop Delivered, Part delivered (what was kept per line, with a reason) or Can't deliver (with a reason), with any cash collected. Part delivered and can't deliver on invoiced orders make return requests for accounts receivable; can't deliver puts the order back to waiting for a run; cash is what the driver reports, for accounts receivable to apply (Driver cash). The run is done when every stop is marked.","tags":["Deliveries"],"x-aurient-kind":"write","x-aurient-permission":"dispatch.drive","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"all":{"description":"Mark every stop still open as delivered","anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"stops":{"default":[],"maxItems":300,"type":"array","items":{"type":"object","properties":{"stop":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"outcome":{"type":"string","enum":["delivered","part","failed"]},"reason":{"description":"Can't deliver: why (closed, refused, nobody there...)","type":"string","maxLength":255},"recipient":{"type":"string","maxLength":120},"cashCollected":{"type":"number","minimum":0,"maximum":1000000000},"method":{"type":"string","maxLength":40},"lines":{"description":"Part delivered: what was kept per line","maxItems":200,"type":"array","items":{"type":"object","properties":{"line":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Line id from the run (shipment line)"},"kept":{"type":"number","minimum":0,"maximum":1000000000,"description":"How much the customer kept, in the line unit"},"reason":{"description":"Why the rest came back: didn't want it, damaged, wrong item, short-dated, price dispute...","type":"string","maxLength":120}},"required":["line","kept"]}}},"required":["stop","outcome"]}}},"required":[]}}}},"parameters":[{"name":"run","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Delivery run id or number, e.g. RN-1001"},"description":"Delivery run id or number, e.g. RN-1001"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/recipes":{"get":{"operationId":"production.recipes.list","summary":"Recipes","description":"Recipes / bills of materials: what each makes (or breaks down), batch size, inputs and outputs, and the cost per batch at today's average costs. Filter by an item to see every recipe it is in.","tags":["Production"],"x-aurient-kind":"read","x-aurient-permission":"production.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"item","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":100}},{"name":"includeArchived","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}}]},"put":{"operationId":"production.recipes.save","summary":"Save a recipe","description":"Creates or changes a recipe (bill of materials). production: inputs make a main output (plus any by-products); disassembly: one input is broken down into several outputs (cuts, trim, bones). Quantities are per batch in each item's base unit; inputs can carry a loss %; cost is split between outputs by sales value, weight or fixed shares; labour (minutes x rate) and overhead (per batch and % of materials) are added.","tags":["Production"],"x-aurient-kind":"write","x-aurient-permission":"production.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"code":{"type":"string","minLength":1,"maxLength":30},"name":{"type":"string","minLength":1,"maxLength":160},"kind":{"default":"production","description":"production: several inputs make one main output; disassembly: one input is broken down into several outputs","type":"string","enum":["production","disassembly"]},"primaryItem":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Main output (production) or the item broken down (disassembly)"},"batchQty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000,"description":"One batch, in base units of the primary item"},"warehouse":{"anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"type":"null"}]},"costSplit":{"default":"value","description":"How cost is shared between several outputs: by sales value, by weight, or fixed shares","type":"string","enum":["value","weight","fixed"]},"labourMinutes":{"default":0,"type":"number","minimum":0,"maximum":1000000},"labourRate":{"default":0,"description":"Cost per labour hour","type":"number","minimum":0,"maximum":1000000},"overheadPerBatch":{"default":0,"type":"number","minimum":0,"maximum":1000000000},"overheadPct":{"default":0,"description":"% of material cost","type":"number","minimum":0,"maximum":500},"status":{"default":"active","type":"string","enum":["active","draft","archived"]},"instructions":{"anyOf":[{"type":"string","maxLength":5000},{"type":"null"}]},"lines":{"minItems":2,"maxItems":100,"type":"array","items":{"type":"object","properties":{"role":{"type":"string","enum":["input","output","byproduct","waste"],"description":"input = used up; output = what is made; byproduct = also made and sold (bones, trim); waste = thrown away"},"item":{"description":"Required except for waste that is thrown away","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"description":{"type":"string","maxLength":160},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000,"description":"Per batch, in the item base unit (kg for waste without an item)"},"lossPct":{"description":"Inputs: extra used for handling loss, %","type":"number","minimum":0,"maximum":90},"costSharePct":{"description":"Outputs, when the recipe splits cost by fixed shares","type":"number","minimum":0,"maximum":100}},"required":["role","qty"]}}},"required":["code","name","primaryItem","batchQty","lines"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/recipes/{recipe}":{"get":{"operationId":"production.recipes.get","summary":"Recipe","description":"One recipe: inputs (with loss %), outputs, by-products and waste per batch, labour and overhead, the cost of a batch at today's average costs, each output's share of the cost, unit cost and margin at list price, expected yield, and recent production orders.","tags":["Production"],"x-aurient-kind":"read","x-aurient-permission":"production.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"recipe","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Recipe code or id"},"description":"Recipe code or id"}]}},"/production-orders":{"get":{"operationId":"production.orders.list","summary":"Production orders","description":"Production and disassembly orders: planned, in progress, completed or cancelled, with recipe, batches, cost and yield. Planned orders show whether there is enough of every input.","tags":["Production"],"x-aurient-kind":"read","x-aurient-permission":"production.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["planned","in_progress","completed","cancelled"]}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"item","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}}]},"post":{"operationId":"production.orders.create","summary":"Plan a production order","description":"Plans making (or breaking down) a recipe: a number of batches, or a quantity of the main item, at a warehouse on a date. Works out every input needed (with loss) and the expected outputs, and warns about inputs short in stock.","tags":["Production"],"x-aurient-kind":"write","x-aurient-permission":"production.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"recipe":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"warehouse":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"batches":{"description":"How many batches (default 1)","type":"number","exclusiveMinimum":0,"maximum":1000000},"quantity":{"description":"Or: how much of the primary item to make / break down, in its base unit","type":"number","exclusiveMinimum":0,"maximum":1000000000},"notes":{"type":"string","maxLength":1000}},"required":["recipe"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/production-orders/{order}":{"get":{"operationId":"production.orders.get","summary":"Production order","description":"One production order: recipe, batches, every input (planned, actual, lots used, cost) and output (planned, actual, pieces, lot made, unit cost, share of cost), labour, overhead, yield against expected, and stock available for planned inputs.","tags":["Production"],"x-aurient-kind":"read","x-aurient-permission":"production.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"order","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Production order number, e.g. PR-1001"},"description":"Production order number, e.g. PR-1001"}]}},"/production-orders/{order}/start":{"post":{"operationId":"production.orders.start","summary":"Start a production order","description":"Marks a planned production order as in progress (work has started on the floor).","tags":["Production"],"x-aurient-kind":"write","x-aurient-permission":"production.run","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"order","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Production order number, e.g. PR-1001"},"description":"Production order number, e.g. PR-1001"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/production-orders/{order}/complete":{"post":{"operationId":"production.orders.complete","summary":"Complete a production order","description":"Records what was actually used and made: inputs leave stock (lots first-expiry-first-out unless named), outputs and by-products arrive as new lots with expiry, at their share of materials + labour + overhead; waste is noted; yield is worked out and input lots are linked to output lots for traceability. Omit inputs / outputs to record the planned quantities. Catch-weight outputs need the actual weight and the pieces.","tags":["Production"],"x-aurient-kind":"write","x-aurient-permission":"production.run","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"inputs":{"description":"Omit to use the planned quantities","maxItems":100,"type":"array","items":{"type":"object","properties":{"item":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000,"description":"Actual base units used"},"lots":{"description":"Which lots (default first-expiry-first-out)","minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"lot":{"type":"string","minLength":1,"maxLength":40,"description":"Lot / batch number"},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000,"description":"Quantity from this lot, in the line unit"}},"required":["lot","qty"]}}},"required":["item","qty"]}},"outputs":{"description":"Omit to record the planned (expected) quantities","maxItems":100,"type":"array","items":{"type":"object","properties":{"item":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000,"description":"Actual base units made (the actual weight for catch-weight items)"},"pieces":{"description":"Catch weight: how many pieces","type":"number","exclusiveMinimum":0,"maximum":1000000000},"lot":{"description":"Lot number for what was made (default: the order number)","type":"string","maxLength":40},"expiry":{"description":"Default: today + the item shelf life","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["item","qty"]}},"waste":{"description":"Waste thrown away, kg","type":"number","minimum":0,"maximum":1000000000},"labourMinutes":{"description":"Actual labour minutes (default: the recipe's, times batches)","type":"number","minimum":0,"maximum":10000000},"notes":{"type":"string","maxLength":1000}},"required":[]}}}},"parameters":[{"name":"order","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Production order number, e.g. PR-1001"},"description":"Production order number, e.g. PR-1001"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/production-orders/record":{"post":{"operationId":"production.record","summary":"Record production","description":"Records production in one step, without planning it first: from a recipe (its inputs and outputs, scaled by batches or quantity; give what was really used and made, or leave them out for the recipe quantities), or with no recipe at all (list every input used and every output made). Inputs leave stock, outputs arrive as new lots at their share of the cost, and the lots are linked for traceability, exactly as completing a planned order.","tags":["Production"],"x-aurient-kind":"write","x-aurient-permission":"production.run","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"recipe":{"description":"Recipe to start from (its inputs and outputs, scaled); leave out to type what went in and what came out","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"name":{"description":"Without a recipe: what was made (default: the first output)","type":"string","maxLength":120},"warehouse":{"description":"Default: the recipe's warehouse","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"batches":{"description":"With a recipe: how many batches (default 1)","type":"number","exclusiveMinimum":0,"maximum":1000000},"quantity":{"description":"With a recipe: or how much of the main item, in its base unit","type":"number","exclusiveMinimum":0,"maximum":1000000000},"inputs":{"description":"What was used (actual base units). With a recipe, omit to use the recipe quantities","maxItems":100,"type":"array","items":{"type":"object","properties":{"item":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000,"description":"Actual base units used"},"lots":{"description":"Which lots (default first-expiry-first-out)","minItems":1,"maxItems":50,"type":"array","items":{"type":"object","properties":{"lot":{"type":"string","minLength":1,"maxLength":40,"description":"Lot / batch number"},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000,"description":"Quantity from this lot, in the line unit"}},"required":["lot","qty"]}}},"required":["item","qty"]}},"outputs":{"description":"What was made (actual base units; catch weight: the weight and pieces). With a recipe, omit to record the expected quantities","maxItems":100,"type":"array","items":{"type":"object","properties":{"item":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000,"description":"Actual base units made (the actual weight for catch-weight items)"},"pieces":{"description":"Catch weight: how many pieces","type":"number","exclusiveMinimum":0,"maximum":1000000000},"lot":{"description":"Lot number for what was made (default: the order number)","type":"string","maxLength":40},"expiry":{"description":"Default: today + the item shelf life","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["item","qty"]}},"waste":{"description":"Waste thrown away, kg","type":"number","minimum":0,"maximum":1000000000},"labourMinutes":{"type":"number","minimum":0,"maximum":10000000},"labourRate":{"description":"Cost per labour hour (default: the recipe's, or 0)","type":"number","minimum":0,"maximum":1000000},"overhead":{"description":"Overhead cost to add (default: the recipe's)","type":"number","minimum":0,"maximum":1000000000},"notes":{"type":"string","maxLength":1000}},"required":[]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/production-orders/{order}/cancel":{"post":{"operationId":"production.orders.cancel","summary":"Cancel a production order","description":"Cancels a planned or in-progress production order (nothing has left stock yet).","tags":["Production"],"x-aurient-kind":"write","x-aurient-permission":"production.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"order","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Production order number, e.g. PR-1001"},"description":"Production order number, e.g. PR-1001"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/items/{item}/catch-weight":{"put":{"operationId":"production.catchWeight","summary":"Catch weight on or off","description":"Makes an item catch weight (counted in pieces, stocked and priced by actual weight) or not. The item's base unit must be a weight (KG, LB) and it needs a piece unit (e.g. EA = 2.4 KG nominal) to order in.","tags":["Production"],"x-aurient-kind":"write","x-aurient-permission":"inventory.item.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"catchWeight":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}],"description":"true = counted in pieces, stocked and priced by weight"}},"required":["catchWeight"]}}}},"parameters":[{"name":"item","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/lots/{lot}/genealogy":{"get":{"operationId":"production.genealogy","summary":"Lot genealogy","description":"For a lot, every lot it was made from (back to the supplier receipts) and every lot made from it (forward through production), with the production orders, and which customers received any of the lots made from it. Use for recalls through production.","tags":["Production"],"x-aurient-kind":"read","x-aurient-permission":["production.view","inventory.stock.view"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"lot","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":40}},{"name":"direction","in":"query","required":false,"schema":{"default":"both","type":"string","enum":["both","back","forward"]}}]}},"/pos/registers/{register}/till":{"get":{"operationId":"pos.till","summary":"Till","description":"Everything the till screen needs for a register: the open shift and its takings, settings, parked sales, the loyalty programme.","tags":["Till"],"x-aurient-kind":"read","x-aurient-permission":["pos.sell","pos.manage"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"register","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Register code, e.g. T1"},"description":"Register code, e.g. T1"}]}},"/pos/registers/{register}/catalog":{"get":{"operationId":"pos.catalog","summary":"Till catalogue","description":"Every item the till can sell from a register: units with prices and barcodes, tax rate, stock at the register's warehouse, sold by weight or not.","tags":["Till"],"x-aurient-kind":"read","x-aurient-permission":["pos.sell","pos.manage"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"register","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Register code, e.g. T1"},"description":"Register code, e.g. T1"}]}},"/pos/quote":{"post":{"operationId":"pos.quote","summary":"Price a basket","description":"Works out a till basket exactly as it will be invoiced (and any goods coming back), with points it earns and whether a manager must approve.","tags":["Till"],"x-aurient-kind":"read","x-aurient-permission":["pos.sell","pos.manage"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"register":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"customer":{"description":"Customer code, id or name; omit for the walk-in customer","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"lines":{"default":[],"maxItems":300,"type":"array","items":{"type":"object","properties":{"item":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000,"description":"In the line unit (pieces for catch-weight items; kg for items sold by weight)"},"unit":{"type":"string","minLength":1,"maxLength":20,"description":"Unit of measure code or name, e.g. CASE. Defaults to the item's purchase or sales unit; quantity and price on the line are per this unit"},"unitPrice":{"description":"Before tax, per line unit. Defaults to the price for that unit; a lower price needs pos.manage","type":"number","minimum":0,"maximum":1000000000000},"discountPct":{"type":"number","minimum":0,"maximum":100},"weight":{"description":"Catch-weight items: actual weight in the base unit","type":"number","exclusiveMinimum":0,"maximum":1000000},"description":{"type":"string","maxLength":255},"serials":{"description":"Serial-numbered items: the serial number of each unit sold (scanned); any not given are the oldest in stock","maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}}},"required":["item","qty"]}},"returnOf":{"description":"Receipt (invoice) number the returned goods came from","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"returns":{"maxItems":300,"type":"array","items":{"type":"object","properties":{"invoiceLine":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Line of the original receipt"},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000,"description":"In the receipt line unit"},"restock":{"description":"false = damaged / thrown away: not put back in stock","anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"reason":{"type":"string","maxLength":120}},"required":["invoiceLine","qty"]}},"cartDiscountPct":{"description":"Discount on every line without its own","type":"number","minimum":0,"maximum":100},"notes":{"type":"string","maxLength":500},"discountReason":{"description":"Why the discount was given (a discount reason code or its label); needed above the till's reason limit","type":"string","maxLength":80},"coupons":{"description":"Coupon codes typed or scanned at the till","maxItems":5,"type":"array","items":{"type":"string","maxLength":30}}},"required":["register"],"description":"Work out totals, points and checks without saving"}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/checkout":{"post":{"operationId":"pos.checkout","summary":"Ring up a till sale","description":"Completes a checkout at a till: sells the lines (stock leaves the register's warehouse, the invoice is posted), takes any returned goods back against their receipt (credit note, stock back in unless damaged), and takes payment by cash (with change), card, loyalty points or on the customer's account; or refunds by cash, card or as credit. One call does a sale, a return or an exchange. The till shift must be open.","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.sell","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"register":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"customer":{"description":"Customer code, id or name; omit for the walk-in customer","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"lines":{"default":[],"maxItems":300,"type":"array","items":{"type":"object","properties":{"item":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000,"description":"In the line unit (pieces for catch-weight items; kg for items sold by weight)"},"unit":{"type":"string","minLength":1,"maxLength":20,"description":"Unit of measure code or name, e.g. CASE. Defaults to the item's purchase or sales unit; quantity and price on the line are per this unit"},"unitPrice":{"description":"Before tax, per line unit. Defaults to the price for that unit; a lower price needs pos.manage","type":"number","minimum":0,"maximum":1000000000000},"discountPct":{"type":"number","minimum":0,"maximum":100},"weight":{"description":"Catch-weight items: actual weight in the base unit","type":"number","exclusiveMinimum":0,"maximum":1000000},"description":{"type":"string","maxLength":255},"serials":{"description":"Serial-numbered items: the serial number of each unit sold (scanned); any not given are the oldest in stock","maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}}},"required":["item","qty"]}},"returnOf":{"description":"Receipt (invoice) number the returned goods came from","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"returns":{"maxItems":300,"type":"array","items":{"type":"object","properties":{"invoiceLine":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Line of the original receipt"},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000,"description":"In the receipt line unit"},"restock":{"description":"false = damaged / thrown away: not put back in stock","anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"reason":{"type":"string","maxLength":120}},"required":["invoiceLine","qty"]}},"cartDiscountPct":{"description":"Discount on every line without its own","type":"number","minimum":0,"maximum":100},"payments":{"default":[],"maxItems":10,"type":"array","items":{"type":"object","properties":{"tender":{"type":"string","enum":["cash","card","account","points","credit"],"description":"credit = keep a refund as credit on the customer account"},"amount":{"type":"number","minimum":0,"maximum":1000000000000,"description":"Money value of this tender (for points: the value in money; leave 0 and give points instead)"},"points":{"description":"Points to spend (points tender)","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"tendered":{"description":"Cash handed over (the change is worked out)","type":"number","minimum":0,"maximum":1000000000000},"reference":{"description":"Card approval code / last 4 digits","type":"string","maxLength":80}},"required":["tender","amount"]}},"parked":{"description":"Parked sale this checkout came from (removed when done)","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"notes":{"type":"string","maxLength":500},"approver":{"type":"object","properties":{"pin":{"description":"The manager's 4-digit PIN","type":"string","minLength":4,"maxLength":4},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"password":{"type":"string","minLength":1,"maxLength":200}},"description":"A manager approving on this till types their own PIN (or email and password) - till screen only, never the assistant"},"discountReason":{"description":"Why the discount was given (a discount reason code or its label); needed above the till's reason limit","type":"string","maxLength":80},"coupons":{"description":"Coupon codes typed or scanned at the till","maxItems":5,"type":"array","items":{"type":"string","maxLength":30}},"tip":{"description":"Tip on top of a sale: taken on the card first, the rest from the cash handed over; owed to the cashier until paid out","type":"number","minimum":0,"maximum":1000000000000}},"required":["register"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/registers/{register}/returns/no-receipt":{"post":{"operationId":"pos.return.noReceipt","summary":"Return without a receipt","description":"Takes goods back at a till when the customer has no receipt: each line at today's till price, a required reason, back on the shelf or not, refunded in cash from the drawer or kept as store credit on a named customer (as the till settings allow). A manager approves with their PIN. Till screen only.","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.sell","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"customer":{"description":"Customer code, id or name; needed for store credit. Omit for a walk-in cash refund","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"lines":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"item":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000},"unit":{"type":"string","minLength":1,"maxLength":20,"description":"Unit of measure code or name, e.g. CASE. Defaults to the item's purchase or sales unit; quantity and price on the line are per this unit"},"restock":{"description":"false = not put back on the shelf (damaged, thrown away)","anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},"required":["item","qty"]}},"reason":{"type":"string","minLength":2,"maxLength":120,"description":"Why it is coming back (required)"},"refund":{"type":"string","enum":["cash","credit"],"description":"cash from the drawer, or store credit on the customer account"},"notes":{"type":"string","maxLength":500},"approver":{"type":"object","properties":{"pin":{"description":"The manager's 4-digit PIN","type":"string","minLength":4,"maxLength":4},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"password":{"type":"string","minLength":1,"maxLength":200}},"description":"A manager approving on this till types their own PIN (or email and password) - till screen only, never the assistant"}},"required":["lines","reason","refund"],"description":"Goods brought back without the receipt: priced at today's till price, approved by a manager"}}}},"parameters":[{"name":"register","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Register code, e.g. T1"},"description":"Register code, e.g. T1"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/receipts/{receipt}/returnable":{"get":{"operationId":"pos.returnable","summary":"What can come back","description":"For a receipt (invoice number): each line sold, how much has already been returned and what can still be brought back, the customer and how many days ago it was bought.","tags":["Till"],"x-aurient-kind":"read","x-aurient-permission":["pos.refund","pos.manage"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"receipt","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Receipt (invoice or credit note) number"},"description":"Receipt (invoice or credit note) number"}]}},"/pos/receipts/{receipt}":{"get":{"operationId":"pos.receipt","summary":"Till receipt","description":"A till receipt by its number: what was sold or returned, prices, tax, tenders, change, points earned and spent, cashier and shift.","tags":["Till"],"x-aurient-kind":"read","x-aurient-permission":["pos.sell","pos.manage","pos.view"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"receipt","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Receipt (invoice or credit note) number"},"description":"Receipt (invoice or credit note) number"}]}},"/pos/receipts/{receipt}/print":{"get":{"operationId":"pos.receipt.print","summary":"Print a receipt","description":"The 80 mm receipt slip, ready for the browser to print.","tags":["Till"],"x-aurient-kind":"read","x-aurient-permission":["pos.sell","pos.manage","pos.view"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"receipt","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Receipt (invoice or credit note) number"},"description":"Receipt (invoice or credit note) number"},{"name":"copy","in":"query","required":false,"schema":{"type":"string","enum":["0","1","true","false"]}}]}},"/pos/receipts/{receipt}/email":{"post":{"operationId":"pos.receipt.email","summary":"Email a receipt","description":"Emails a till receipt to the customer (and saves the address on a named customer who has none).","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.sell","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"email":{"type":"string","maxLength":190,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"required":["email"]}}}},"parameters":[{"name":"receipt","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Receipt (invoice or credit note) number"},"description":"Receipt (invoice or credit note) number"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/sales":{"get":{"operationId":"pos.sales.list","summary":"Till sales","description":"Checkouts at the tills: receipt, time, register, cashier, customer, sale / return / exchange, total, how it was paid. Filter by register, shift, customer, dates or kind.","tags":["Till"],"x-aurient-kind":"read","x-aurient-permission":"pos.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"register","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"shift","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["sale","return","exchange"]}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":60}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}}]}},"/pos/customers":{"get":{"operationId":"pos.customers","summary":"Find a customer at the till","description":"Finds customers by name, phone, email, code or loyalty card number, with what they owe, their credit limit and points.","tags":["Till"],"x-aurient-kind":"read","x-aurient-permission":["pos.sell","pos.manage"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":80,"description":"Name, phone, email, code or loyalty card number"},"description":"Name, phone, email, code or loyalty card number"}]},"post":{"operationId":"pos.customers.add","summary":"Add a customer at the till","description":"Adds a cash customer (no credit) from the till and, by default, joins them to the loyalty programme.","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.sell","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":160},"phone":{"type":"string","maxLength":40},"email":{"type":"string","maxLength":190,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"joinLoyalty":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"cardNo":{"type":"string","maxLength":30}},"required":["name"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/registers/{register}/parked":{"post":{"operationId":"pos.park","summary":"Park a sale","description":"Puts the current basket aside to serve the next customer.","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.sell","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":80},"customer":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"cart":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"total":{"default":0,"type":"number","minimum":0,"maximum":1000000000000,"description":"Amount in the document currency"}},"required":["label","cart"]}}}},"parameters":[{"name":"register","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Register code, e.g. T1"},"description":"Register code, e.g. T1"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/parked/{parked}/resume":{"post":{"operationId":"pos.parked.resume","summary":"Pick up a parked sale","description":"Takes a parked basket back to the till (it is removed from the parked list).","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.sell","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"parked","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/parked/{parked}":{"delete":{"operationId":"pos.parked.delete","summary":"Throw away a parked sale","description":"Removes a parked basket without selling it.","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.sell","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"parked","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/registers/{register}/open":{"post":{"operationId":"pos.shift.open","summary":"Open the till","description":"Starts a shift on a register with the cash counted in the drawer. If the count differs from what was left at the last close, say why (difference): cash added from or taken back to the bank, or the drawer is just different (cash over or short).","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.sell","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"float":{"type":"number","minimum":0,"maximum":1000000000000,"description":"Cash counted in the drawer"},"counts":{"type":"object","propertyNames":{"type":"string","maxLength":20},"additionalProperties":{"type":"number","minimum":0,"maximum":1000000},"description":"Notes and coins: denomination -> how many"},"notes":{"type":"string","maxLength":500},"difference":{"description":"When the count differs from what was left at the last close: bank = cash really added from / taken to the bank; over_short = the drawer is just different (cash over or short)","type":"string","enum":["bank","over_short"]}},"required":["float"]}}}},"parameters":[{"name":"register","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Register code, e.g. T1"},"description":"Register code, e.g. T1"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/registers/{register}/cash":{"post":{"operationId":"pos.cash","summary":"Cash in or out of the till","description":"Records cash put into or taken out of an open till other than by a sale: paid out (e.g. a small purchase, to an expense account; manager only), paid in (manager only), or a drop (cash taken to the safe / bank during the day).","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.sell","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"kind":{"type":"string","enum":["paid_in","paid_out","drop"]},"amount":{"type":"number","exclusiveMinimum":0,"maximum":1000000000000},"reason":{"type":"string","minLength":1,"maxLength":255},"approver":{"type":"object","properties":{"pin":{"description":"The manager's 4-digit PIN","type":"string","minLength":4,"maxLength":4},"email":{"type":"string","format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"password":{"type":"string","minLength":1,"maxLength":200}},"description":"A manager approving on this till types their own PIN (or email and password) - till screen only, never the assistant"},"account":{"description":"G/L account for the other side: paid out defaults to 61900 Other expenses, paid in to 42000 Other income, a drop to the main bank account","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]}},"required":["kind","amount","reason"]}}}},"parameters":[{"name":"register","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Register code, e.g. T1"},"description":"Register code, e.g. T1"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/registers/{register}/close":{"post":{"operationId":"pos.shift.close","summary":"Close the till","description":"Ends the shift on a register: the cash counted is compared with what the drawer should hold (difference to cash over and short), the float for the next shift stays in the drawer and the rest is dropped to the bank. Freezes the end-of-day (Z) report.","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.sell","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"counted":{"type":"number","minimum":0,"maximum":1000000000000,"description":"Cash counted in the drawer"},"counts":{"type":"object","propertyNames":{"type":"string","maxLength":20},"additionalProperties":{"type":"number","minimum":0,"maximum":1000000},"description":"Notes and coins: denomination -> how many"},"leaveInTill":{"description":"Float to keep for the next shift (default the register float); the rest is dropped to the bank","type":"number","minimum":0,"maximum":1000000000000},"notes":{"type":"string","maxLength":500}},"required":["counted"]}}}},"parameters":[{"name":"register","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Register code, e.g. T1"},"description":"Register code, e.g. T1"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/shift":{"get":{"operationId":"pos.shift.get","summary":"Till shift (X / Z report)","description":"A till shift's figures: sales, returns and exchanges, discounts, takings by tender (cash, card, account, points, credit), refunds, cash paid in / out and dropped, the cash the drawer should hold, counted and over / short once closed, top items, by cashier and by hour. Give the shift number, or the register for its open (else last) shift.","tags":["Till"],"x-aurient-kind":"read","x-aurient-permission":["pos.sell","pos.manage","pos.view"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"shift","in":"query","required":false,"schema":{"description":"Shift number, e.g. ZR-1003","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"description":"Shift number, e.g. ZR-1003"},{"name":"register","in":"query","required":false,"schema":{"description":"Or the register: its open shift, else its last one","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"description":"Or the register: its open shift, else its last one"}]}},"/pos/shift/print":{"get":{"operationId":"pos.shift.print","summary":"Print the cash-up","description":"The 80 mm cash-up slip for a shift: notes and coins counted, what the drawer should hold, over or short, banked and float, takings by tender, with lines to sign.","tags":["Till"],"x-aurient-kind":"read","x-aurient-permission":["pos.sell","pos.manage","pos.view"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"shift","in":"query","required":false,"schema":{"description":"Shift number, e.g. ZR-1003","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"description":"Shift number, e.g. ZR-1003"},{"name":"register","in":"query","required":false,"schema":{"description":"Or the register: its open shift, else its last one","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"description":"Or the register: its open shift, else its last one"},{"name":"copy","in":"query","required":false,"schema":{"type":"string","enum":["0","1","true","false"]}}]}},"/pos/shifts":{"get":{"operationId":"pos.shifts.list","summary":"Till shifts","description":"Till shifts with who opened and closed them, takings, cash expected against counted and over / short. Filter by register, dates or open / closed.","tags":["Till"],"x-aurient-kind":"read","x-aurient-permission":"pos.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"register","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["open","closed"]}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}}]}},"/pos/registers":{"get":{"operationId":"pos.registers.list","summary":"Tills","description":"The tills (registers): warehouse, float, whether a shift is open, who opened it and today's takings.","tags":["Till"],"x-aurient-kind":"read","x-aurient-permission":["pos.view","pos.sell","pos.manage"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}},"put":{"operationId":"pos.registers.save","summary":"Add or change a till","description":"Creates or changes a till: name, the warehouse it sells from, the float kept in the drawer and the quick buttons. A new till gets its own cash drawer account.","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":20},"name":{"type":"string","minLength":1,"maxLength":80},"warehouse":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"float":{"type":"number","minimum":0,"maximum":1000000000000,"description":"Amount in the document currency"},"quickItems":{"description":"SKUs on the quick buttons","maxItems":60,"type":"array","items":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"}},"active":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"mode":{"description":"restaurant = the till opens on the floor plan of tables","type":"string","enum":["retail","restaurant"]},"askTip":{"description":"Offer tip choices when taking payment; null = restaurant tills yes, counter tills no","type":["boolean","null"]},"receiptPrint":{"description":"After a sale: none = don't print, ask = offer to print (the default), auto = print automatically","type":"string","enum":["none","ask","auto"]}},"required":["code","name","warehouse"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/settings":{"put":{"operationId":"pos.settings.save","summary":"Till settings","description":"Till rules: the most a cashier can discount without a manager's PIN, the discount above which a reason is needed, how refunds of returns without a receipt may go (cash, store credit), how many days after a sale goods can come back, the receipt header and footer, the notes and coins counted, and for restaurants the service charge, tip buttons, kitchen notes, courses and when a kitchen ticket is late.","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"maxDiscountPct":{"type":"number","minimum":0,"maximum":100},"discountReasonPct":{"description":"A discount above this percent needs a reason","type":"number","minimum":0,"maximum":100},"noReceiptCash":{"description":"Returns without a receipt may be refunded in cash","type":"boolean"},"noReceiptCredit":{"description":"Returns without a receipt may go back as store credit","type":"boolean"},"returnDays":{"type":"integer","minimum":0,"maximum":3650},"receiptHeader":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"receiptFooter":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"cashDenoms":{"description":"Notes and coins counted at the till","minItems":1,"maxItems":30,"type":"array","items":{"type":"object","properties":{"v":{"type":"number","exclusiveMinimum":0,"maximum":100000},"k":{"type":"string","enum":["note","coin"]}},"required":["v","k"]}},"serviceChargePct":{"description":"Added to restaurant bills","type":"number","minimum":0,"maximum":50},"tipSuggestions":{"maxItems":6,"type":"array","items":{"type":"number","minimum":0,"maximum":100}},"kitchenNotes":{"description":"Quick notes for orders","maxItems":40,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}},"ticketWarnMinutes":{"type":"integer","minimum":1,"maximum":240},"courses":{"description":"Course names in order","minItems":1,"maxItems":8,"type":"array","items":{"type":"string","minLength":1,"maxLength":30}},"cashRounding":{"description":"Round cash to the nearest 0.05, 0.10, 0.25, 0.50 or 1.00; null = off","type":["number","null"]},"displayTitle":{"description":"Customer screen: the big line between sales","anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"displayMessage":{"description":"Customer screen: a line under it","anyOf":[{"type":"string","maxLength":255},{"type":"null"}]},"displaySeconds":{"description":"Customer screen: seconds each picture shows","type":"integer","minimum":3,"maximum":60},"displaySlides":{"description":"Customer screen: pictures shown in turn (uploaded first)","maxItems":12,"type":"array","items":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}}},"required":[]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/card-settlements":{"post":{"operationId":"pos.cards.settle","summary":"Card takings paid out","description":"Records the card company paying the till's card takings into the bank, less their fees: Dr bank, Dr bank charges (fees), Cr card settlements.","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"amount":{"type":"number","exclusiveMinimum":0,"maximum":1000000000000,"description":"What the card company paid into the bank"},"fees":{"default":0,"description":"Card fees they kept","type":"number","minimum":0,"maximum":1000000000000},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"bankAccount":{"description":"Default: the main bank account","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"reference":{"type":"string","maxLength":80}},"required":["amount"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/today":{"get":{"operationId":"pos.today","summary":"Takings today","description":"Today's takings across all tills: by register and tender, returns, cash expected in each open drawer, card takings waiting to be settled.","tags":["Till"],"x-aurient-kind":"read","x-aurient-permission":["pos.sell","pos.manage","pos.view"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pos/registers/{register}/layout":{"put":{"operationId":"pos.layout.save","summary":"Save the till layout","description":"Saves the till screen layout (pages of item buttons, tile size, basket side, what shows) for you, for this till, or for every till (a manager for the last two).","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.sell","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"scope":{"type":"string","enum":["user","register","company"],"description":"user = just me; register = everyone on this till; company = every till"},"config":{"type":"object","properties":{"pages":{"default":[],"maxItems":30,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40},"name":{"type":"string","minLength":1,"maxLength":40},"color":{"type":"string","maxLength":20},"items":{"default":[],"description":"SKUs on this page, in order","maxItems":200,"type":"array","items":{"type":"string","maxLength":40}},"category":{"description":"Or every item in this category","type":"string","maxLength":80}},"required":["id","name"]}},"startPage":{"type":"string","maxLength":40},"tileSize":{"default":"m","type":"string","enum":["s","m","l"]},"basket":{"default":"right","type":"string","enum":["right","left"]},"showSearch":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"showCategories":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"showStock":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"showSku":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"hide":{"default":[],"maxItems":10,"type":"array","items":{"type":"string","enum":["discount","park","return","parked"]}},"colors":{"default":{},"description":"Tile colour by SKU","type":"object","propertyNames":{"type":"string","maxLength":40},"additionalProperties":{"type":"string","maxLength":20}}}}},"required":["scope","config"]}}}},"parameters":[{"name":"register","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Register code, e.g. T1"},"description":"Register code, e.g. T1"},{"$ref":"#/components/parameters/IdempotencyKey"}]},"delete":{"operationId":"pos.layout.reset","summary":"Reset the till layout","description":"Removes a saved till layout so the next one down applies (yours, then the till's, then the company's, then the built-in one).","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.sell","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"register","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Register code, e.g. T1"},"description":"Register code, e.g. T1"},{"name":"scope","in":"query","required":true,"schema":{"type":"string","enum":["user","register","company"]}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/loyalty/program":{"get":{"operationId":"loyalty.program.get","summary":"Loyalty programme","description":"The loyalty programme: points per 1.00 spent, what a point is worth, minimum to spend, welcome points, expiry, tiers (12-month spend and earn multiplier), promotions, and how many members and points are out there (and what those points are worth).","tags":["Loyalty"],"x-aurient-kind":"read","x-aurient-permission":["loyalty.view","pos.sell"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}},"put":{"operationId":"loyalty.program.save","summary":"Set up the loyalty programme","description":"Creates or changes the loyalty programme: points per 1.00 spent (before tax), the value of a point when spent, the fewest points that can be spent, welcome points, expiry in months, tiers (e.g. Silver from 1,000 spend in 12 months earns 1.5x) and promotions (e.g. double points on an item or on Tuesdays). Tiers and promotions given replace the existing ones.","tags":["Loyalty"],"x-aurient-kind":"write","x-aurient-permission":"loyalty.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"active":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"pointsPerUnit":{"type":"number","minimum":0,"maximum":1000,"description":"Points per 1.00 spent before tax"},"pointValue":{"type":"number","minimum":0,"maximum":1000,"description":"Money value of one point when spent"},"minRedeem":{"default":100,"type":"integer","minimum":0,"maximum":10000000},"welcomePoints":{"default":0,"type":"integer","minimum":0,"maximum":10000000},"expiryMonths":{"anyOf":[{"type":"integer","minimum":1,"maximum":240},{"type":"null"}]},"terms":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}]},"tiers":{"maxItems":10,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":40},"minSpend":{"type":"number","minimum":0,"maximum":1000000000000,"description":"Amount in the document currency"},"multiplier":{"type":"number","minimum":0,"maximum":20}},"required":["name","minSpend","multiplier"]}},"promotions":{"maxItems":50,"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"multiplier":{"type":"number","minimum":0,"maximum":20},"item":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"weekday":{"type":"integer","minimum":1,"maximum":7},"startsOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"endsOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"active":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},"required":["name","multiplier"]}}},"required":["name","pointsPerUnit","pointValue"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/loyalty/members":{"get":{"operationId":"loyalty.members.list","summary":"Loyalty members","description":"Loyalty members with card number, points balance, what the points are worth, last visit and points earned in the last 12 months. Search by name, card, phone or email.","tags":["Loyalty"],"x-aurient-kind":"read","x-aurient-permission":"loyalty.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":80}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}}]},"post":{"operationId":"loyalty.members.enrol","summary":"Join the loyalty programme","description":"Joins a customer to the loyalty programme with a card number (generated if not given); welcome points are added.","tags":["Loyalty"],"x-aurient-kind":"write","x-aurient-permission":"pos.sell","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"customer":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"cardNo":{"type":"string","maxLength":30}},"required":["customer"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/loyalty/members/{member}":{"get":{"operationId":"loyalty.members.get","summary":"Loyalty member","description":"One member: card, points balance and value, tier (by 12-month spend) and how far to the next, points expiring soon, and their points history.","tags":["Loyalty"],"x-aurient-kind":"read","x-aurient-permission":["loyalty.view","pos.sell"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"member","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Card number, customer code or name"},"description":"Card number, customer code or name"}]}},"/loyalty/members/{member}/adjust":{"post":{"operationId":"loyalty.members.adjust","summary":"Adjust points","description":"Adds or takes away points for a member with a reason (goodwill, a correction, a missed scan).","tags":["Loyalty"],"x-aurient-kind":"write","x-aurient-permission":"loyalty.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"points":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"note":{"type":"string","minLength":1,"maxLength":255}},"required":["points","note"]}}}},"parameters":[{"name":"member","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Card number, customer code or name"},"description":"Card number, customer code or name"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/loyalty/expire":{"post":{"operationId":"loyalty.expire","summary":"Expire old points","description":"Takes away points past their expiry that were never spent. Runs every night on its own; this runs it now.","tags":["Loyalty"],"x-aurient-kind":"write","x-aurient-permission":"loyalty.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/floor":{"get":{"operationId":"pos.floor","summary":"Tables","description":"The floor plan right now: every table with its open tab (guests, waiter, how long, total, and whether it is waiting on the kitchen, has food ready, or has asked for the bill), bar tabs, and food ready to take out.","tags":["Till"],"x-aurient-kind":"read","x-aurient-permission":"pos.tables","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"register","in":"query","required":false,"schema":{"description":"Till (for its floors first)","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"description":"Till (for its floors first)"}]}},"/pos/tabs/{tab}":{"get":{"operationId":"pos.tab.get","summary":"Table tab","description":"A table's tab: every line by seat and course with where it is (not sent, held, with the kitchen, ready, served), bills and payments, and what is still owed.","tags":["Till"],"x-aurient-kind":"read","x-aurient-permission":"pos.tables","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"tab","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Tab number (TB-1001) or the name of its table"},"description":"Tab number (TB-1001) or the name of its table"}]},"patch":{"operationId":"pos.tab.change","summary":"Change a tab","description":"Moves a tab to another free table, or changes its guests, name, customer (for loyalty points or their account), waiter, service charge (taking it off needs a manager) or discount.","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.tables","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"table":{"description":"Move the tab to this (free) table; null = make it a bar tab","anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"type":"null"}]},"guests":{"type":"integer","minimum":1,"maximum":99},"name":{"type":"string","maxLength":80},"customer":{"anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"type":"null"}]},"waiter":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"serviceChargePct":{"type":"number","minimum":0,"maximum":50},"discountPct":{"type":"number","minimum":0,"maximum":100},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]}},"required":[]}}}},"parameters":[{"name":"tab","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Tab number (TB-1001) or the name of its table"},"description":"Tab number (TB-1001) or the name of its table"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/tabs":{"get":{"operationId":"pos.tabs.list","summary":"Table tabs","description":"Tabs (open, paid or void) with table, waiter, guests, when and how much. Filter by status, waiter and dates.","tags":["Till"],"x-aurient-kind":"read","x-aurient-permission":"pos.tables","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["open","closed","void"]}},{"name":"waiter","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":60}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}}]},"post":{"operationId":"pos.tab.open","summary":"Seat a table","description":"Opens a tab for a table (or a bar tab with no table) with the number of guests; the waiter is you unless named.","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.tables","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"register":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"table":{"description":"Table name; omit for a bar / counter tab","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"name":{"type":"string","maxLength":80},"guests":{"default":2,"type":"integer","minimum":1,"maximum":99},"customer":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"waiter":{"description":"Default: you","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]}},"required":["register"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/tabs/{tab}/lines":{"post":{"operationId":"pos.tab.add","summary":"Add to a tab","description":"Rings items onto a table's tab by seat and course with notes for the kitchen. They go to the kitchen when the tab is sent (or straight away with send).","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.tables","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"lines":{"minItems":1,"maxItems":100,"type":"array","items":{"type":"object","properties":{"item":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000},"unit":{"type":"string","minLength":1,"maxLength":20,"description":"Unit of measure code or name, e.g. CASE. Defaults to the item's purchase or sales unit; quantity and price on the line are per this unit"},"seat":{"description":"Seat number; 0 or none = shared","type":"integer","minimum":0,"maximum":99},"course":{"default":1,"type":"integer","minimum":1,"maximum":9},"notes":{"description":"For the kitchen","type":"string","maxLength":255},"unitPrice":{"type":"number","minimum":0,"maximum":1000000000000,"description":"Amount in the document currency"},"discountPct":{"type":"number","minimum":0,"maximum":100}},"required":["item","qty"]}},"send":{"description":"Send to the kitchen straight away","anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},"required":["lines"]}}}},"parameters":[{"name":"tab","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Tab number (TB-1001) or the name of its table"},"description":"Tab number (TB-1001) or the name of its table"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/tabs/{tab}/lines/{line}":{"patch":{"operationId":"pos.tab.line","summary":"Change a tab line","description":"Changes the quantity, seat, course, notes, price or discount of a line not yet sent (price and big discounts need a manager).","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.tables","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"qty":{"type":"number","exclusiveMinimum":0,"maximum":1000000000},"seat":{"type":"integer","minimum":0,"maximum":99},"course":{"type":"integer","minimum":1,"maximum":9},"notes":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]},"unitPrice":{"type":"number","minimum":0,"maximum":1000000000000,"description":"Amount in the document currency"},"discountPct":{"type":"number","minimum":0,"maximum":100}},"required":[]}}}},"parameters":[{"name":"tab","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Tab number (TB-1001) or the name of its table"},"description":"Tab number (TB-1001) or the name of its table"},{"name":"line","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/tabs/{tab}/lines/{line}/void":{"post":{"operationId":"pos.tab.line.void","summary":"Take an item off a tab","description":"Takes a line off a tab. Lines not sent just go; a sent line is voided with a reason and shows struck through on the kitchen screen (a manager once the kitchen has started it).","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.tables","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"default":"Removed","type":"string","minLength":1,"maxLength":255}},"required":[]}}}},"parameters":[{"name":"tab","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Tab number (TB-1001) or the name of its table"},"description":"Tab number (TB-1001) or the name of its table"},{"name":"line","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/tabs/{tab}/send":{"post":{"operationId":"pos.tab.send","summary":"Send to the kitchen","description":"Sends everything new on a tab to the kitchen and bar: one ticket per station and course. Courses listed in hold wait until they are fired.","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.tables","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"hold":{"default":[],"description":"Courses to hold until they are fired","maxItems":9,"type":"array","items":{"type":"integer","minimum":1,"maximum":9}}},"required":[]}}}},"parameters":[{"name":"tab","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Tab number (TB-1001) or the name of its table"},"description":"Tab number (TB-1001) or the name of its table"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/tabs/{tab}/fire":{"post":{"operationId":"pos.tab.fire","summary":"Fire a course","description":"Sends a held course (e.g. the mains once starters are cleared) to the kitchen.","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.tables","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"course":{"type":"integer","minimum":1,"maximum":9}},"required":["course"]}}}},"parameters":[{"name":"tab","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Tab number (TB-1001) or the name of its table"},"description":"Tab number (TB-1001) or the name of its table"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/tabs/{tab}/served":{"post":{"operationId":"pos.tab.served","summary":"Mark served","description":"Marks everything that was ready on a tab as taken to the table.","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.tables","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"tab","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Tab number (TB-1001) or the name of its table"},"description":"Tab number (TB-1001) or the name of its table"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/tabs/{tab}/merge":{"post":{"operationId":"pos.tab.merge","summary":"Merge tabs","description":"Puts everything from one tab onto another (tables pushed together); the first tab closes.","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.tables","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"into":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"The tab (or table) that takes everything"}},"required":["into"]}}}},"parameters":[{"name":"tab","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Tab number (TB-1001) or the name of its table"},"description":"Tab number (TB-1001) or the name of its table"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/tabs/{tab}/move":{"post":{"operationId":"pos.tab.move","summary":"Move items to another tab","description":"Moves lines from one tab to another tab or table.","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.tables","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"lines":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"to":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Tab number or table name"},"seat":{"type":"integer","minimum":0,"maximum":99}},"required":["lines","to"]}}}},"parameters":[{"name":"tab","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Tab number (TB-1001) or the name of its table"},"description":"Tab number (TB-1001) or the name of its table"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/tabs/{tab}/void":{"post":{"operationId":"pos.tab.void","summary":"Void a tab","description":"Cancels a tab with nothing billed (guests left, opened by mistake). A manager is needed once food or drink has gone out.","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.tables","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":1,"maxLength":255}},"required":["reason"]}}}},"parameters":[{"name":"tab","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Tab number (TB-1001) or the name of its table"},"description":"Tab number (TB-1001) or the name of its table"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/tabs/{tab}/quote":{"post":{"operationId":"pos.tab.quote","summary":"Price a bill","description":"Works out a bill for a tab (everything, a seat or chosen lines) exactly as it will be invoiced, with the service charge, points it earns and approvals needed.","tags":["Till"],"x-aurient-kind":"read","x-aurient-permission":"pos.tables","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"register":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"mode":{"default":"all","description":"all = everything not yet billed; seat = one seat (and none of the shared lines); lines = chosen lines","type":"string","enum":["all","seat","lines"]},"seat":{"type":"integer","minimum":0,"maximum":99},"lines":{"maxItems":300,"type":"array","items":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"bill":{"description":"An open (part-paid) bill instead","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"required":["register"]}}}},"parameters":[{"name":"tab","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Tab number (TB-1001) or the name of its table"},"description":"Tab number (TB-1001) or the name of its table"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/tabs/{tab}/bill":{"post":{"operationId":"pos.tab.bill","summary":"Print the bill","description":"The 80 mm bill to take to the table (not a receipt): what was ordered, service charge, tax, total, split per person and tip guide.","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.tables","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"mode":{"default":"all","description":"all = everything not yet billed; seat = one seat (and none of the shared lines); lines = chosen lines","type":"string","enum":["all","seat","lines"]},"seat":{"type":"integer","minimum":0,"maximum":99},"lines":{"maxItems":300,"type":"array","items":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"shares":{"type":"integer","minimum":2,"maximum":30}},"required":[]}}}},"parameters":[{"name":"tab","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Tab number (TB-1001) or the name of its table"},"description":"Tab number (TB-1001) or the name of its table"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/tabs/{tab}/pay":{"post":{"operationId":"pos.tab.pay","summary":"Pay a bill","description":"Takes payment for a tab: everything, one seat, chosen items, or a share of one bill (split evenly or an amount), with a tip on top. The bill is a till checkout (invoice and payments); the tab closes when everything is paid.","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.tables","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"register":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"mode":{"default":"all","description":"all = everything not yet billed; seat = one seat (and none of the shared lines); lines = chosen lines","type":"string","enum":["all","seat","lines"]},"seat":{"type":"integer","minimum":0,"maximum":99},"lines":{"maxItems":300,"type":"array","items":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"bill":{"description":"Pay (part of) a bill already started, e.g. the next share","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"shares":{"description":"Splitting one bill evenly this many ways","type":"integer","minimum":2,"maximum":30},"amount":{"description":"Pay only this much of the bill now (a share); default all of it","type":"number","exclusiveMinimum":0,"maximum":1000000000000},"payments":{"default":[],"maxItems":10,"type":"array","items":{"type":"object","properties":{"tender":{"type":"string","enum":["cash","card","account","points","credit"],"description":"credit = keep a refund as credit on the customer account"},"amount":{"type":"number","minimum":0,"maximum":1000000000000,"description":"Money value of this tender (for points: the value in money; leave 0 and give points instead)"},"points":{"description":"Points to spend (points tender)","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"tendered":{"description":"Cash handed over (the change is worked out)","type":"number","minimum":0,"maximum":1000000000000},"reference":{"description":"Card approval code / last 4 digits","type":"string","maxLength":80}},"required":["tender","amount"]}},"tip":{"default":0,"description":"Tip on top, for the waiter","type":"number","minimum":0,"maximum":1000000000000}},"required":["register"]}}}},"parameters":[{"name":"tab","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Tab number (TB-1001) or the name of its table"},"description":"Tab number (TB-1001) or the name of its table"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/kitchen":{"get":{"operationId":"pos.kitchen","summary":"Kitchen tickets","description":"Tickets waiting at the kitchen and bar (new, cooking, ready) with table, waiter, course, items with notes, and how long they have waited; plus ones served in the last 20 minutes.","tags":["Till"],"x-aurient-kind":"read","x-aurient-permission":["pos.kitchen","pos.tables"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"station","in":"query","required":false,"schema":{"description":"Station code; omit for all","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"description":"Station code; omit for all"}]}},"/pos/kitchen/tickets/{ticket}":{"post":{"operationId":"pos.kitchen.bump","summary":"Update a kitchen ticket","description":"Moves a kitchen ticket along: cooking, ready (the waiter sees it), served, or back to new.","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.kitchen","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"status":{"type":"string","enum":["new","cooking","ready","served"]}},"required":["status"]}}}},"parameters":[{"name":"ticket","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/tips":{"get":{"operationId":"pos.tips","summary":"Tips","description":"Tips by member of staff (waiter or cashier): taken by card and in cash, paid out, and still owed.","tags":["Till"],"x-aurient-kind":"read","x-aurient-permission":"pos.tables","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}]}},"/pos/registers/{register}/tips":{"post":{"operationId":"pos.tips.payout","summary":"Pay out tips","description":"Pays tips owed to a member of staff in cash from an open till (Dr tips owed, Cr the drawer).","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"waiter":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Who is paid"},"amount":{"type":"number","exclusiveMinimum":0,"maximum":1000000000000},"note":{"type":"string","maxLength":255}},"required":["waiter","amount"]}}}},"parameters":[{"name":"register","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Register code, e.g. T1"},"description":"Register code, e.g. T1"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/floors":{"put":{"operationId":"pos.floor.save","summary":"Save a floor plan","description":"Adds or changes a dining area and its tables (name, seats, shape and position on the plan). Tables left out are taken out of use.","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"name":{"type":"string","minLength":1,"maxLength":60},"register":{"anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"type":"null"}]},"cols":{"type":"integer","minimum":6,"maximum":60},"rows":{"type":"integer","minimum":4,"maximum":40},"sortOrder":{"type":"integer","minimum":-999,"maximum":999},"active":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"tables":{"maxItems":300,"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"name":{"type":"string","minLength":1,"maxLength":20},"seats":{"default":4,"type":"integer","minimum":1,"maximum":60},"shape":{"default":"square","type":"string","enum":["square","round","rect","bar"]},"x":{"default":0,"type":"integer","minimum":0,"maximum":59},"y":{"default":0,"type":"integer","minimum":0,"maximum":39},"w":{"default":3,"type":"integer","minimum":1,"maximum":20},"h":{"default":3,"type":"integer","minimum":1,"maximum":20},"active":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},"required":["name"]}}},"required":["name"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/stations":{"get":{"operationId":"pos.stations","summary":"Kitchen stations","description":"Kitchen and bar stations with the item categories each prepares.","tags":["Till"],"x-aurient-kind":"read","x-aurient-permission":["pos.kitchen","pos.tables"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}},"put":{"operationId":"pos.station.save","summary":"Save a kitchen station","description":"Adds or changes a kitchen or bar station and which item categories it prepares. One station can take everything else.","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":20},"name":{"type":"string","minLength":1,"maxLength":60},"categories":{"default":[],"description":"Item categories prepared here","maxItems":100,"type":"array","items":{"type":"string","maxLength":80}},"isDefault":{"description":"Gets anything no other station takes","anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"active":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},"required":["code","name"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/imports/templates":{"get":{"operationId":"imports.templates","summary":"Import and export","description":"The import templates (set-up, opening balances, ongoing) with when each was last used, imports waiting for review, and the opening balance cut-over date and lock.","tags":["Import"],"x-aurient-kind":"read","x-aurient-permission":"import.run","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/imports":{"get":{"operationId":"imports.batches","summary":"Imports","description":"Uploaded import files: waiting for review, applied or cancelled, with who uploaded and applied them and what they changed.","tags":["Import"],"x-aurient-kind":"read","x-aurient-permission":"import.run","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["review","applied","cancelled"]}},{"name":"template","in":"query","required":false,"schema":{"type":"string","maxLength":40}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}}]}},"/imports/{batch}":{"get":{"operationId":"imports.batch","summary":"Review an import","description":"One uploaded import file: every row with what it would do (new, change with old and new values per field, unchanged, or the problems found), the decisions taken, and problems with the file as a whole. Use it to explain problems or summarise what an import changes; approving is done by a person on the review screen.","tags":["Import"],"x-aurient-kind":"read","x-aurient-permission":"import.run","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"batch","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Import number, e.g. IMP-1004"},"description":"Import number, e.g. IMP-1004"},{"name":"sheet","in":"query","required":false,"schema":{"type":"string","maxLength":40}},{"name":"action","in":"query","required":false,"schema":{"description":"todo = new and changed rows","type":"string","enum":["todo","create","update","same","error"]},"description":"todo = new and changed rows"},{"name":"decision","in":"query","required":false,"schema":{"type":"string","enum":["pending","approved","partial","rejected"]}},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":80}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}}]}},"/imports/{batch}/decide":{"post":{"operationId":"imports.decide","summary":"Approve or reject import rows","description":"Approve or reject rows of an import waiting for review: chosen rows, every new or changed row (of a sheet), or some fields of one changed row.","tags":["Import"],"x-aurient-kind":"write","x-aurient-permission":"import.run","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"decision":{"type":"string","enum":["approve","reject","reset"],"description":"approve = apply it; reject = leave it out; reset = undecided again"},"rows":{"description":"These rows; omit with \"where\" for every matching row","maxItems":5000,"type":"array","items":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"where":{"description":"Every new and/or changed row (of a sheet)","type":"object","properties":{"sheet":{"type":"string","maxLength":40},"action":{"type":"string","enum":["create","update"]}}},"fields":{"description":"One changed row: approve just these fields (the others are left as they are)","maxItems":100,"type":"array","items":{"type":"string","maxLength":40}}},"required":["decision"]}}}},"parameters":[{"name":"batch","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Import number, e.g. IMP-1004"},"description":"Import number, e.g. IMP-1004"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/imports/{batch}/apply":{"post":{"operationId":"imports.apply","summary":"Apply an import","description":"Applies the approved rows of an import in one go. If any row fails, nothing is changed and the row is named.","tags":["Import"],"x-aurient-kind":"write","x-aurient-permission":"import.run","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"batch","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Import number, e.g. IMP-1004"},"description":"Import number, e.g. IMP-1004"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/imports/{batch}/cancel":{"post":{"operationId":"imports.cancel","summary":"Cancel an import","description":"Throws away an import waiting for review. Nothing in it is applied; the file and its rows stay in the history.","tags":["Import"],"x-aurient-kind":"write","x-aurient-permission":"import.run","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"batch","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Import number, e.g. IMP-1004"},"description":"Import number, e.g. IMP-1004"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/imports/settings":{"put":{"operationId":"imports.settings.save","summary":"Set the cut-over date","description":"The date the opening balances are as at. It cannot change once opening balances have been imported, or once they are locked.","tags":["Import"],"x-aurient-kind":"write","x-aurient-permission":"import.run","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"cutoverDate":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}],"description":"The date the opening balances are as at"}},"required":["cutoverDate"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/imports/opening/lock":{"post":{"operationId":"imports.opening.lock","summary":"Lock the opening balances","description":"Closes the opening balance templates for good once everything is in. Later corrections are journal entries or stock counts.","tags":["Import"],"x-aurient-kind":"write","x-aurient-permission":"import.run","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"confirm":{"type":"boolean","const":true,"description":"Locking cannot be undone"}},"required":["confirm"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/print/options":{"get":{"operationId":"print.options","summary":"What can be printed","description":"The printed documents a record offers: an invoice, a sales order (order confirmation, picking list), a delivery run (manifest), a customer (statement of account), a warehouse (count sheet)…","tags":["Email and printing"],"x-aurient-kind":"read","x-aurient-permission":null,"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"ref","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":60,"description":"A document number (INV-8701, SO-5531, PO-1042, RN-1004...), a customer or supplier code (for a statement) or a warehouse code (count sheet)"},"description":"A document number (INV-8701, SO-5531, PO-1042, RN-1004...), a customer or supplier code (for a statement) or a warehouse code (count sheet)"}]}},"/print/link":{"get":{"operationId":"print.link","summary":"Print a document","description":"A link to the Letter-size PDF of a document, ready to print or send: invoice, quote, order confirmation, picking list, delivery note, payment receipt, statement of account (customer or supplier, for a period), purchase order, goods received note, return, bill, remittance advice, transfer note, stock adjustment, count sheet, production order, journal voucher, expense, delivery manifest (optionally with every delivery note). Give the user the link.","tags":["Email and printing"],"x-aurient-kind":"read","x-aurient-permission":null,"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"kind","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":30,"description":"invoice, quote, order, picking, delivery, receipt, statement, supplier_statement, po, grn, return, bill, remittance, transfer, adjustment, countsheet, production, journal, expense, manifest, manifest_notes"},"description":"invoice, quote, order, picking, delivery, receipt, statement, supplier_statement, po, grn, return, bill, remittance, transfer, adjustment, countsheet, production, journal, expense, manifest, manifest_notes"},{"name":"ref","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":60}},{"name":"from","in":"query","required":false,"schema":{"description":"Statements: period start","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"Statements: period start"},{"name":"to","in":"query","required":false,"schema":{"description":"Statements: period end (default today)","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":"Statements: period end (default today)"}]}},"/print/centre":{"get":{"operationId":"print.centre","summary":"Print centre","description":"Documents of one printed kind in a period, with when each was last printed, for printing in bulk.","tags":["Email and printing"],"x-aurient-kind":"read","x-aurient-permission":"print.batch","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"kind","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":30}},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"unprinted","in":"query","required":false,"schema":{"description":"Only ones never printed","anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"description":"Only ones never printed"},{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":80}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}}]}},"/print/settings":{"get":{"operationId":"print.settings.get","summary":"Letterhead","description":"The letterhead and terms on printed documents.","tags":["Email and printing"],"x-aurient-kind":"read","x-aurient-permission":null,"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}},"put":{"operationId":"print.settings.save","summary":"Change the letterhead","description":"Address, phone, email, website, colour, terms and bank details printed on documents.","tags":["Email and printing"],"x-aurient-kind":"write","x-aurient-permission":"admin.settings.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"email":{"anyOf":[{"type":"string","maxLength":190},{"type":"null"}]},"website":{"anyOf":[{"type":"string","maxLength":190},{"type":"null"}]},"accent":{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$"},"invoiceTerms":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"quoteTerms":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"poTerms":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"statementNote":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"bankDetails":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"footer":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"deliveryPrices":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"currencyCode":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]},"removeLogo":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},"required":[]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/print/designs/{kind}":{"get":{"operationId":"print.design.get","summary":"Print design","description":"How one kind of printed document is laid out: its parts and lines, and the saved design.","tags":["Email and printing"],"x-aurient-kind":"read","x-aurient-permission":"admin.settings.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"kind","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":30,"description":"invoice, picking, pos (till receipt) …"},"description":"invoice, picking, pos (till receipt) …"},{"name":"ref","in":"query","required":false,"schema":{"description":"A document to show in the preview; the latest one when left out","type":"string","maxLength":60},"description":"A document to show in the preview; the latest one when left out"}]},"put":{"operationId":"print.design.save","summary":"Save a print design","description":"Saves how one kind of printed document is laid out; everything printed from then on uses it.","tags":["Email and printing"],"x-aurient-kind":"write","x-aurient-permission":"admin.settings.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"design":{"type":"object","properties":{"orient":{"default":"portrait","type":"string","enum":["portrait","landscape"]},"paper":{"type":"string","enum":["58","80","letter","a4","legal"]},"font":{"default":"sans","type":"string","enum":["sans","serif","mono"]},"size":{"default":"normal","type":"string","enum":["small","normal","large"]},"logo":{"default":"left","type":"string","enum":["left","centre","right"]},"accent":{"anyOf":[{"type":"string","pattern":"^#[0-9A-Fa-f]{6}$"},{"type":"null"}]},"order":{"default":[],"maxItems":80,"type":"array","items":{"type":"string","maxLength":60}},"hidden":{"default":{},"type":"object","propertyNames":{"type":"string","maxLength":80},"additionalProperties":{"type":"boolean"}},"off":{"default":{},"type":"object","propertyNames":{"type":"string","maxLength":80},"additionalProperties":{"type":"boolean"}},"names":{"default":{},"type":"object","propertyNames":{"type":"string","maxLength":80},"additionalProperties":{"type":"string","maxLength":80}},"widths":{"default":{},"type":"object","propertyNames":{"type":"string","maxLength":80},"additionalProperties":{"type":"number","minimum":10,"maximum":100}},"heights":{"default":{},"type":"object","propertyNames":{"type":"string","maxLength":80},"additionalProperties":{"type":"number","minimum":0,"maximum":1000}},"offsets":{"default":{},"type":"object","propertyNames":{"type":"string","maxLength":80},"additionalProperties":{"type":"number","minimum":0,"maximum":90}},"place":{"default":{},"type":"object","propertyNames":{"type":"string","maxLength":80},"additionalProperties":{"type":"string","maxLength":60}},"words":{"default":{},"type":"object","properties":{"title":{"type":"string","maxLength":80},"terms":{"type":"string","maxLength":4000},"foot":{"type":"string","maxLength":300}}},"blocks":{"default":[],"maxItems":12,"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^[a-z0-9]{1,12}$"},"title":{"type":"string","maxLength":80},"text":{"type":"string","maxLength":2000}},"required":["id","title","text"]}}}}},"required":["design"]}}}},"parameters":[{"name":"kind","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":30}},{"$ref":"#/components/parameters/IdempotencyKey"}]},"delete":{"operationId":"print.design.reset","summary":"Go back to the standard layout","description":"Removes the saved design for one kind of printed document, so it prints in the standard layout again.","tags":["Email and printing"],"x-aurient-kind":"write","x-aurient-permission":"admin.settings.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"kind","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":30}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/business":{"get":{"operationId":"business.get","summary":"Business profile","description":"The business's names, tax number, company code, address and contact details, logo and where it prints, and the till receipt header and footer, and how tax shows on document lines.","tags":["Settings"],"x-aurient-kind":"read","x-aurient-permission":"admin.settings.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}},"put":{"operationId":"business.save","summary":"Change the business profile","description":"Changes the business's names, tax number, address, contact details, where the logo prints, and the till receipt header and footer.","tags":["Settings"],"x-aurient-kind":"write","x-aurient-permission":"admin.settings.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":2,"maxLength":120},"dateFormat":{"type":"string","enum":["MMM d, yyyy","d MMM yyyy","dd/MM/yyyy","MM/dd/yyyy","yyyy-MM-dd"]},"timeFormat":{"type":"string","enum":["12h","24h"]},"weekStart":{"anyOf":[{"type":"number","const":0},{"type":"number","const":1},{"type":"number","const":6}]},"timezone":{"type":"string","maxLength":64},"currency":{"type":"string","minLength":3,"maxLength":3},"fiscalYearStart":{"type":"integer","minimum":1,"maximum":12},"legalName":{"anyOf":[{"type":"string","maxLength":190},{"type":"null"}]},"taxNumber":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]},"address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"phone":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"email":{"anyOf":[{"anyOf":[{"type":"string","maxLength":190,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},{"type":"string","const":""}]},{"type":"null"}]},"website":{"anyOf":[{"type":"string","maxLength":190},{"type":"null"}]},"logoOnDocuments":{"type":"boolean"},"logoOnReceipts":{"type":"boolean"},"receiptHeader":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"receiptFooter":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"taxDisplay":{"description":"Tax on each line of printed documents and receipts: the rate (15%), the amount, or both","type":"string","enum":["rate","amount","both"]}},"required":[]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/email/draft":{"get":{"operationId":"email.draft","summary":"Draft an email","description":"What an email for a document would say before sending it: who it goes to (from the customer or supplier record), the subject, the message and the PDF it attaches. Works for invoices, quotes, order confirmations, delivery notes, receipts, statements (customer or supplier code, for a period), purchase orders, returns and remittances.","tags":["Email and printing"],"x-aurient-kind":"read","x-aurient-permission":"email.send","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"ref","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":60,"description":"Document number (INV-8801, PO-1042, QT-310 ...) or a customer / supplier code for a statement"},"description":"Document number (INV-8801, PO-1042, QT-310 ...) or a customer / supplier code for a statement"},{"name":"kind","in":"query","required":false,"schema":{"description":"What to send when a record offers several: invoice, quote, order, delivery, receipt, statement, po, return, remittance, supplier_statement","type":"string","maxLength":30},"description":"What to send when a record offers several: invoice, quote, order, delivery, receipt, statement, po, return, remittance, supplier_statement"},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}]}},"/email/send":{"post":{"operationId":"email.send","summary":"Send an email","description":"Email a document to its customer or supplier with the PDF attached (invoice, quote, order confirmation, delivery note, receipt, statement for a period, purchase order, return, remittance), or a plain message to any addresses. Leave out to/subject/message to use the address on file and the usual wording; draft_email shows what that would be. The email waits in the outbox and goes out within moments.","tags":["Email and printing"],"x-aurient-kind":"write","x-aurient-permission":"email.send","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ref":{"description":"Document number or customer / supplier code; leave out for a plain message","type":"string","minLength":1,"maxLength":60},"kind":{"description":"invoice, quote, order, delivery, receipt, statement, po, return, remittance, supplier_statement","type":"string","maxLength":30},"to":{"description":"Recipients; leave out to use the email on the customer or supplier record","maxItems":20,"type":"array","items":{"type":"string","maxLength":190}},"cc":{"maxItems":20,"type":"array","items":{"type":"string","maxLength":190}},"subject":{"description":"Leave out for the usual subject","type":"string","maxLength":250},"message":{"description":"The email text; leave out for the usual wording","type":"string","maxLength":20000},"attach":{"default":true,"description":"Attach the document as a PDF","type":"boolean"},"periodFrom":{"description":"Statements: start of the period","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"periodTo":{"description":"Statements: end of the period","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":[]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/email/messages":{"get":{"operationId":"email.list","summary":"Sent emails","description":"The email outbox: what was sent, what is waiting and what failed (with the reason), newest first. Admins see everyone's; others see their own.","tags":["Email and printing"],"x-aurient-kind":"read","x-aurient-permission":"email.send","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"status","in":"query","required":false,"schema":{"type":"string","enum":["queued","sending","sent","failed","cancelled"]}},{"name":"q","in":"query","required":false,"schema":{"description":"Words in the subject, an address or a document number","type":"string","maxLength":100},"description":"Words in the subject, an address or a document number"},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":200}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}}]}},"/email/messages/{id}/retry":{"post":{"operationId":"email.retry","summary":"Send an email again","description":"Try a failed email again (after fixing what was wrong, e.g. the server email setup).","tags":["Email and printing"],"x-aurient-kind":"write","x-aurient-permission":"email.send","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/email/messages/{id}/cancel":{"post":{"operationId":"email.cancel","summary":"Stop an email","description":"Stop an email that is still waiting in the outbox.","tags":["Email and printing"],"x-aurient-kind":"write","x-aurient-permission":"email.send","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/email/settings":{"get":{"operationId":"email.settings","summary":"Email settings","description":"How emails go out: the name they come from, where replies go, the signature, which documents are emailed automatically, and the wording for each kind. Also whether the server is set up to send.","tags":["Email and printing"],"x-aurient-kind":"read","x-aurient-permission":"email.send","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}},"put":{"operationId":"email.settings.save","summary":"Change email settings","description":"Change the name emails come from, the reply-to address, the signature, copying the sender, which documents are emailed automatically (purchase orders when sent, invoices when created, receipts, remittances) and the wording per kind.","tags":["Email and printing"],"x-aurient-kind":"write","x-aurient-permission":"admin.settings.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"fromName":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"replyTo":{"anyOf":[{"type":"string","maxLength":190},{"type":"null"}]},"copySender":{"type":"boolean"},"signature":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"autoPo":{"type":"boolean"},"autoInvoice":{"type":"boolean"},"autoReceipt":{"type":"boolean"},"autoRemittance":{"type":"boolean"},"templates":{"type":"object","propertyNames":{"type":"string","maxLength":30},"additionalProperties":{"type":"object","properties":{"subject":{"type":"string","maxLength":250},"body":{"type":"string","maxLength":5000}}}}},"required":[]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/email/test":{"post":{"operationId":"email.test","summary":"Send a test email","description":"Sends a short test email to yourself to check that email works.","tags":["Email and printing"],"x-aurient-kind":"write","x-aurient-permission":"email.send","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/offline-sales":{"post":{"operationId":"pos.offlineSale","summary":"Send a till sale taken offline","description":"Records a till sale that was rung up with no internet, at the prices the till charged. Sent by the till itself; the same sale sent twice is recorded once.","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.sell","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"register":{"type":"string","minLength":1,"maxLength":20},"ref":{"type":"string","minLength":8,"maxLength":64,"description":"The till's own id for the sale (sending it again records it once)"},"receipt":{"type":"string","minLength":1,"maxLength":30,"description":"The temporary receipt number printed offline, e.g. T1-OFF-0042"},"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|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$","description":"When it was rung up (ISO time)"},"cashier":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Who rang it up (user id)"},"customer":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"lines":{"minItems":1,"maxItems":300,"type":"array","items":{"type":"object","properties":{"item":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"qty":{"type":"number","exclusiveMinimum":0},"unit":{"type":"string","maxLength":12},"unitPrice":{"type":"number","minimum":0},"discountPct":{"default":0,"type":"number","minimum":0,"maximum":100},"description":{"type":"string","maxLength":255},"weight":{"type":"number","exclusiveMinimum":0},"serials":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":40}}},"required":["item","qty","unitPrice"]}},"promotions":{"default":[],"maxItems":50,"type":"array","items":{"type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"saving":{"type":"number","minimum":0},"units":{"type":"number","minimum":0}},"required":["id","saving","units"]}},"payments":{"minItems":1,"maxItems":10,"type":"array","items":{"type":"object","properties":{"tender":{"type":"string","enum":["cash","card"]},"amount":{"type":"number","minimum":0},"tendered":{"type":"number","minimum":0},"reference":{"type":"string","maxLength":60}},"required":["tender","amount"]}},"total":{"type":"number","minimum":0,"description":"What the till charged"}},"required":["register","ref","receipt","at","cashier","lines","payments","total"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/order-guide":{"get":{"operationId":"guide.order","summary":"Order guide","description":"For a customer: the items they usually buy (times, last date, last quantity and price, their price today, stock) with the ones due again first. For a supplier: the items we buy from them with on hand, on order, reorder point, sold in 30 days and a suggested quantity.","tags":["Sales"],"x-aurient-kind":"read","x-aurient-permission":["sales.view","purchasing.view"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"customer","in":"query","required":false,"schema":{"type":"string"}},{"name":"supplier","in":"query","required":false,"schema":{"type":"string"}},{"name":"warehouse","in":"query","required":false,"schema":{"type":"string"}}]}},"/customers/{customer}/prices":{"get":{"operationId":"guide.customerPrices","summary":"A customer's prices","description":"The price list entries that apply to a customer (their own list and quantity breaks for everyone), so a form can fill in their price.","tags":["Sales"],"x-aurient-kind":"read","x-aurient-permission":"sales.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"customer","in":"path","required":true,"schema":{"type":"string","minLength":1}}]}},"/customer-portal/settings":{"get":{"operationId":"portal.settings","summary":"Customer portal","description":"Whether the customer portal is on, its welcome message, what customers see there, who gets their requests, and everyone who has access (by customer, with when they last signed in).","tags":["Customer portal"],"x-aurient-kind":"read","x-aurient-permission":"sales.portal.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}},"put":{"operationId":"portal.settings.save","summary":"Set up the customer portal","description":"Turn the customer portal on or off, set its welcome message and what customers see, and who gets requests from customers without a salesperson.","tags":["Customer portal"],"x-aurient-kind":"write","x-aurient-permission":"sales.portal.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"enabled":{"type":"boolean"},"welcome":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"showOrders":{"type":"boolean"},"showQuotes":{"type":"boolean"},"notifyUser":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"null"}]}},"required":[]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/customers/{customer}/portal":{"get":{"operationId":"portal.customer","summary":"A customer's portal access","description":"Who at a customer can sign in to the customer portal, when they last did, and their open requests.","tags":["Customer portal"],"x-aurient-kind":"read","x-aurient-permission":"sales.customer.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"customer","in":"path","required":true,"schema":{"anyOf":[{"type":"string","minLength":1},{"type":"number"}]}}]}},"/customers/{customer}/portal/invite":{"post":{"operationId":"portal.invite","summary":"Invite to the customer portal","description":"Give someone at a customer access to the customer portal: they are emailed a link (good for a week) and can then see the customer's invoices, statement, orders and quotes, pay online and send requests. Defaults to the email on the customer's record. Inviting again sends a new link.","tags":["Customer portal"],"x-aurient-kind":"write","x-aurient-permission":"sales.portal.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"email":{"type":"string","maxLength":190,"format":"email","pattern":"^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"},"name":{"type":"string","maxLength":120}},"required":[]}}}},"parameters":[{"name":"customer","in":"path","required":true,"schema":{"anyOf":[{"type":"string","minLength":1},{"type":"number"}]}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/customer-portal/users/{id}":{"post":{"operationId":"portal.access","summary":"Turn portal access on or off","description":"Turn one person's customer portal access off (they are signed out straight away) or back on.","tags":["Customer portal"],"x-aurient-kind":"write","x-aurient-permission":"sales.portal.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"active":{"type":"boolean"}},"required":["active"]}}}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/items/{item}/blocks":{"get":{"operationId":"items.blocks","summary":"Item blocks","description":"What an item is blocked for (sales, purchasing, the till, production, transfers or everything), where, why and until when, plus the open orders it's on.","tags":["Items"],"x-aurient-kind":"read","x-aurient-permission":["inventory.item.view","inventory.stock.view"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"item","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"}]},"post":{"operationId":"items.block","summary":"Block an item","description":"Stop an item being used for sales, purchasing, the till, production (as an ingredient or made), transfers, or everything; everywhere or at one warehouse; with a reason and an optional last day. Open orders stay but nothing on them ships or is received while blocked.","tags":["Items"],"x-aurient-kind":"write","x-aurient-permission":"inventory.item.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"use":{"type":"string","enum":["all","sales","purchasing","pos","production_use","production_output","transfers"],"description":"all, sales, purchasing, pos (the till), production_use, production_output or transfers"},"warehouse":{"description":"Only at this warehouse / store; leave out for everywhere","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"reason":{"type":"string","minLength":2,"maxLength":200},"until":{"description":"Last day the block applies","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["use","reason"]}}}},"parameters":[{"name":"item","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/items/{item}/blocks/{id}":{"delete":{"operationId":"items.unblock","summary":"Lift an item block","description":"Lift one block on an item, so it can be used for that again.","tags":["Items"],"x-aurient-kind":"write","x-aurient-permission":"inventory.item.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"item","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/sales/reps":{"get":{"operationId":"sales.reps","summary":"Sales reps","description":"The people a sale can belong to (everyone active in the company), with how many customers have each as their main rep.","tags":["Sales"],"x-aurient-kind":"read","x-aurient-permission":["sales.view","sales.customer.view","admin.users.view","targets.view"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/sales/rep":{"post":{"operationId":"sales.setRep","summary":"Change who a sale belongs to","description":"Give a quote, sales order or invoice to another sales rep. An order takes its invoices and credit notes with it; an invoice takes its credit notes.","tags":["Sales"],"x-aurient-kind":"write","x-aurient-permission":"sales.rep.change","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"ref":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Quote, sales order, invoice or credit note number, e.g. SO-5531"},"rep":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"The person it belongs to: name, email or id"}},"required":["ref","rep"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/customer-segments":{"get":{"operationId":"segments.list","summary":"Customer segments","description":"The customer segments (Supermarkets, Restaurants…) with how many customers are in each.","tags":["Customers"],"x-aurient-kind":"read","x-aurient-permission":["sales.view","sales.customer.view"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"segments.save","summary":"Add or rename a customer segment","description":"Add a customer segment, rename one, or stop offering it (customers already in it keep it).","tags":["Customers"],"x-aurient-kind":"write","x-aurient-permission":"sales.customer.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"name":{"type":"string","minLength":1,"maxLength":80},"active":{"type":"boolean"}},"required":["name"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/invoices/{invoice}/creditable":{"get":{"operationId":"sales.creditable","summary":"What can be credited on an invoice","description":"For one posted invoice: each line with what was sold, what has already been credited or returned (office and till), and what can still be credited; plus the credit notes already given and what the customer still owes on it.","tags":["Sales"],"x-aurient-kind":"read","x-aurient-permission":"sales.invoice.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"invoice","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"}]}},"/customers/{customer}/invoices-to-credit":{"get":{"operationId":"sales.invoicesToCredit","summary":"A customer’s invoices that can be credited","description":"A customer’s posted invoices, newest first, with what each still has left to credit.","tags":["Sales"],"x-aurient-kind":"read","x-aurient-permission":"sales.invoice.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"customer","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"}]}},"/invoices/{invoice}/credit":{"post":{"operationId":"sales.creditInvoice","summary":"Credit note / return on an invoice","description":"Give a credit note on a customer’s posted invoice: goods coming back (into stock, or written off if damaged), goods not wanted, a price reduction on a line, or a credit not tied to a line. It posts to the ledger, puts returned goods back into stock at their cost, and is set against what they owe on the invoice; the rest is refunded or stays on their account.","tags":["Sales"],"x-aurient-kind":"write","x-aurient-permission":"sales.credit.create","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":2,"maxLength":200,"description":"Why: damaged, wrong item, not ordered, price agreed…"},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"lines":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"line":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"The invoice line id (from get_invoice_to_credit)"},"qty":{"description":"Quantity credited, in the invoice line’s unit (goods back or not wanted)","type":"number","exclusiveMinimum":0},"restock":{"description":"Goods came back and can be sold again (default yes for stock items). No: written off","type":"boolean"},"priceOff":{"description":"Instead of quantity: a price reduction, the amount off before tax for this line in all","type":"number","exclusiveMinimum":0}},"required":["line"]}},"extra":{"description":"Credits not tied to a line (goodwill, a fee taken back)","maxItems":20,"type":"array","items":{"type":"object","properties":{"description":{"type":"string","minLength":2,"maxLength":200},"amount":{"type":"number","exclusiveMinimum":0,"description":"Before tax"},"tax":{"description":"Tax code, if the credit carries tax","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]}},"required":["description","amount"]}},"warehouse":{"description":"Where returned goods go back into stock; default the warehouse it shipped from","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"settle":{"description":"apply (default): off what they owe on this invoice, the rest stays as credit on their account; refund: off what they owe, the rest paid back; keep: all left as credit on their account","type":"string","enum":["apply","refund","keep"]},"refundMethod":{"description":"How the refund is paid (a payment method, e.g. Cash, Bank transfer, Cheque)","type":"string","minLength":1,"maxLength":60},"bankAccount":{"description":"Bank or cash account the refund is paid from","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"refundReference":{"type":"string","maxLength":60},"returnRequest":{"description":"The return request (RR-...) this credit note settles: its goods are not moved again, and the request becomes Credited","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"notes":{"type":"string","maxLength":500}},"required":["reason"]}}}},"parameters":[{"name":"invoice","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/credit-notes/{creditNote}/refund":{"post":{"operationId":"sales.refundCredit","summary":"Refund a credit note","description":"Pay money back to a customer from what a credit note left on their account (cash, cheque, bank transfer…). Posts Dr receivables, Cr the bank or cash account.","tags":["Sales"],"x-aurient-kind":"write","x-aurient-permission":"sales.credit.refund","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"amount":{"description":"Default: all that is left on it","type":"number","exclusiveMinimum":0},"method":{"type":"string","minLength":1,"maxLength":60},"bankAccount":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"reference":{"type":"string","maxLength":60},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":[]}}}},"parameters":[{"name":"creditNote","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/customers/{customer}/credits":{"get":{"operationId":"sales.customerCredits","summary":"A customer’s unused credit","description":"Credit notes with money still left on them for a customer (to set against an invoice or refund), and their open invoices.","tags":["Sales"],"x-aurient-kind":"read","x-aurient-permission":"sales.invoice.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"customer","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"}]}},"/route-areas":{"get":{"operationId":"routeAreas.list","summary":"Route areas","description":"Route areas: code, name, warehouse, usual van and driver, delivery days, the general area on the map (centre and size in km) and how many customers are in each, plus how many customers are Unassigned.","tags":["Deliveries"],"x-aurient-kind":"read","x-aurient-permission":"dispatch.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"withCustomers","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}}]},"put":{"operationId":"routeAreas.save","summary":"Add or change a route area","description":"Adds or changes a route area: code, name, the warehouse it is delivered from, usual van and driver (runs can change them), delivery days, and its general area on the map (a centre and a size in km) used by Plan the day and the assistant.","tags":["Deliveries"],"x-aurient-kind":"write","x-aurient-permission":"dispatch.areas.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"id":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"code":{"type":"string","pattern":"^[A-Z0-9_-]{1,20}$"},"name":{"type":"string","minLength":1,"maxLength":80},"warehouse":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Depot the area is delivered from"},"vehicle":{"description":"Usual van","anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"type":"null"}]},"driver":{"description":"Usual driver","anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"type":"null"}]},"deliveryDays":{"anyOf":[{"maxItems":7,"type":"array","items":{"type":"integer","minimum":1,"maximum":7},"description":"1 = Monday ... 7 = Sunday"},{"type":"null"}]},"centreLat":{"anyOf":[{"type":"number","minimum":-90,"maximum":90},{"type":"null"}]},"centreLng":{"anyOf":[{"type":"number","minimum":-180,"maximum":180},{"type":"null"}]},"radiusKm":{"description":"Size of the general area on the map","anyOf":[{"type":"number","minimum":0.2,"maximum":200},{"type":"null"}]},"notes":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"active":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},"required":["code","name","warehouse"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/route-areas/{area}":{"get":{"operationId":"routeAreas.get","summary":"Route area","description":"One route area with its customers (and whether each is linked on the customer or on a delivery location), and the customers that are Unassigned.","tags":["Deliveries"],"x-aurient-kind":"read","x-aurient-permission":"dispatch.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"area","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Route area id or code"},"description":"Route area id or code"}]},"delete":{"operationId":"routeAreas.delete","summary":"Remove a route area","description":"Removes a route area. Its customers, locations and open orders become Unassigned. An area that runs were planned in is switched off instead, so past runs keep it.","tags":["Deliveries"],"x-aurient-kind":"write","x-aurient-permission":"dispatch.areas.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"area","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Route area id or code"},"description":"Route area id or code"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/route-areas/customers":{"post":{"operationId":"routeAreas.customers","summary":"Put customers on a route area","description":"Adds customers to a route area, or takes them off (area null: they become Unassigned). Taking a customer off also clears any of their delivery locations that were set to that area.","tags":["Deliveries"],"x-aurient-kind":"write","x-aurient-permission":["dispatch.areas.manage","sales.customer.manage"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"area":{"anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"type":"null"}],"description":"Route area, or null to make them Unassigned"},"customers":{"minItems":1,"maxItems":500,"type":"array","items":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"}}},"required":["area","customers"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/dispatch/locations/{location}/route-area":{"put":{"operationId":"routeAreas.location","summary":"Route area of a delivery location","description":"Sets the route area of one delivery location (it wins over the customer's area), or clears it so the location follows the customer.","tags":["Deliveries"],"x-aurient-kind":"write","x-aurient-permission":["dispatch.areas.manage","sales.customer.manage"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"area":{"anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"type":"null"}]}},"required":["area"]}}}},"parameters":[{"name":"location","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/route-areas/move-orders":{"post":{"operationId":"routeAreas.moveOrders","summary":"Move orders to a route area","description":"Moves sales orders to another route area for those orders only (the customer stays where they are), or puts them back on the customer's area (area null). Orders already on a live run must come off the run first.","tags":["Deliveries"],"x-aurient-kind":"write","x-aurient-permission":"dispatch.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"area":{"anyOf":[{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"type":"null"}],"description":"Route area for these orders only, or null to follow the customer again"},"salesOrders":{"minItems":1,"maxItems":300,"type":"array","items":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"}}},"required":["area","salesOrders"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/dispatch/runs/{run}/check-in":{"get":{"operationId":"dispatch.runs.checkInData","summary":"Check in a run","description":"What checking in a run that is back needs: each stop as the driver recorded it (or still open), its lines and invoices, and the goods that should be back on the van (from return requests) still to be counted in.","tags":["Deliveries"],"x-aurient-kind":"read","x-aurient-permission":"dispatch.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"run","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Delivery run id or number, e.g. RN-1001"},"description":"Delivery run id or number, e.g. RN-1001"}]},"post":{"operationId":"dispatch.runs.checkIn","summary":"Check in a run","description":"When the van is back: marks any stops still open (delivered, part delivered or couldn't deliver), records goods that came back on stops marked delivered, then counts what is physically on the van: good goods go back into stock now, damaged ones are written off. Anything that should be back and isn't needs a note and stays on its return request (goods not back). Credit notes are left for accounts receivable (Return requests); the driver's cash for Driver cash.","tags":["Deliveries"],"x-aurient-kind":"write","x-aurient-permission":"dispatch.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"stops":{"default":[],"description":"How each stop still open went (every open stop must be given)","maxItems":300,"type":"array","items":{"type":"object","properties":{"stop":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"outcome":{"type":"string","enum":["delivered","part","failed"]},"reason":{"description":"Can't deliver: why (closed, refused, nobody there...)","type":"string","maxLength":255},"recipient":{"type":"string","maxLength":120},"cashCollected":{"type":"number","minimum":0,"maximum":1000000000},"method":{"type":"string","maxLength":40},"lines":{"description":"Part delivered: what was kept per line","maxItems":200,"type":"array","items":{"type":"object","properties":{"line":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Line id from the run (shipment line)"},"kept":{"type":"number","minimum":0,"maximum":1000000000,"description":"How much the customer kept, in the line unit"},"reason":{"description":"Why the rest came back: didn't want it, damaged, wrong item, short-dated, price dispute...","type":"string","maxLength":120}},"required":["line","kept"]}}},"required":["stop","outcome"]}},"cameBack":{"default":[],"description":"Stops marked delivered where goods came back after all: what the customer kept per line","maxItems":300,"type":"array","items":{"type":"object","properties":{"stop":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"lines":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"object","properties":{"line":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Line id from the run (shipment line)"},"kept":{"type":"number","minimum":0,"maximum":1000000000,"description":"How much the customer kept, in the line unit"},"reason":{"description":"Why the rest came back: didn't want it, damaged, wrong item, short-dated, price dispute...","type":"string","maxLength":120}},"required":["line","kept"]}}},"required":["stop","lines"]}},"goods":{"description":"What is physically on the van. Leave out to take everything as back in good order; given, anything not listed (or short) is not on the van","maxItems":600,"type":"array","items":{"type":"object","properties":{"shipmentLine":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Shipment line of goods that should be back on the van"},"good":{"default":0,"description":"Back in good order: goes back into stock now","type":"number","minimum":0,"maximum":1000000000},"damaged":{"default":0,"description":"Back damaged: written off","type":"number","minimum":0,"maximum":1000000000}},"required":["shipmentLine"]}},"note":{"description":"What happened to goods that should be back and are not on the van (required when any are missing)","type":"string","maxLength":255}},"required":[]}}}},"parameters":[{"name":"run","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Delivery run id or number, e.g. RN-1001"},"description":"Delivery run id or number, e.g. RN-1001"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/dispatch/runs/{run}/load":{"get":{"operationId":"dispatch.runs.loadData","summary":"Load check","description":"For loading the van: every order on a planned run with its lines (what is to go on the van) and what the load check has recorded so far.","tags":["Deliveries"],"x-aurient-kind":"read","x-aurient-permission":"dispatch.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"run","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Delivery run id or number, e.g. RN-1001"},"description":"Delivery run id or number, e.g. RN-1001"}]},"put":{"operationId":"dispatch.runs.loadCheck","summary":"Load check","description":"Records what went on the van before a planned run leaves: each order loaded or not, and lines loaded short. When the run goes out only what was loaded ships (the rest stays on the order); orders not loaded go back to waiting for a run.","tags":["Deliveries"],"x-aurient-kind":"write","x-aurient-permission":"dispatch.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"stops":{"minItems":1,"maxItems":300,"type":"array","items":{"type":"object","properties":{"stop":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"loaded":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}],"description":"On the van; false = not loaded (taken off the run when it goes out)"},"lines":{"description":"Lines loaded short (not shipped yet orders only); the rest stays on the order","maxItems":200,"type":"array","items":{"type":"object","properties":{"line":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991,"description":"Sales order line"},"qty":{"type":"number","minimum":0,"maximum":1000000000,"description":"How much went on the van, in the line unit"}},"required":["line","qty"]}}},"required":["stop","loaded"]}}},"required":["stops"]}}}},"parameters":[{"name":"run","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Delivery run id or number, e.g. RN-1001"},"description":"Delivery run id or number, e.g. RN-1001"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/dispatch/cash":{"get":{"operationId":"dispatch.cash.list","summary":"Driver cash","description":"Runs whose drivers collected cash, waiting for accounts receivable to count it and apply it to the invoices: cash due, what the driver reported, the driver; plus runs settled recently.","tags":["Deliveries"],"x-aurient-kind":"read","x-aurient-permission":"sales.payment.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"days","in":"query","required":false,"schema":{"default":14,"description":"Settled runs from the last this many days are listed too","type":"integer","minimum":1,"maximum":90},"description":"Settled runs from the last this many days are listed too"}]}},"/dispatch/runs/{run}/cash":{"get":{"operationId":"dispatch.cash.get","summary":"Driver cash for a run","description":"One run's cash: each stop with its invoice and what is still owed, the cash due, what the driver reported, and (once settled) what came in and the payment made.","tags":["Deliveries"],"x-aurient-kind":"read","x-aurient-permission":"sales.payment.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"run","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Delivery run id or number, e.g. RN-1001"},"description":"Delivery run id or number, e.g. RN-1001"}]},"post":{"operationId":"dispatch.cash.apply","summary":"Apply driver cash","description":"Accounts receivable counts the cash a driver brought back for a finished run and applies it in one go: a customer payment per stop on its invoice (anything over the invoice stays on the customer's account), into the chosen bank or cash account. The difference from what the driver reported is kept in the audit trail. Once per run.","tags":["Deliveries"],"x-aurient-kind":"write","x-aurient-permission":"finance.payment.receive","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"lines":{"maxItems":300,"type":"array","items":{"type":"object","properties":{"stop":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"amount":{"type":"number","minimum":0,"maximum":1000000000,"description":"Cash that actually came back for this stop"}},"required":["stop","amount"]}},"bankAccount":{"description":"Where the cash goes (default: the default bank account)","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"method":{"description":"Default Cash","type":"string","maxLength":40},"paymentDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"note":{"type":"string","maxLength":255}},"required":["lines"]}}}},"parameters":[{"name":"run","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Delivery run id or number, e.g. RN-1001"},"description":"Delivery run id or number, e.g. RN-1001"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/dispatch/route-runs":{"post":{"operationId":"dispatch.routeRuns.create","summary":"Create a run from a route","description":"Makes a delivery run from a route (route area) for a day, usually one route, more when the van does several in one trip: the route's usual van and driver unless others are given, and the route's orders due by that day. Orders on the route not chosen are left off this run and wait for the next one. They ship (and, when printing ships and invoices, are invoiced) when the run goes out.","tags":["Deliveries"],"x-aurient-kind":"write","x-aurient-permission":"dispatch.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"areas":{"minItems":1,"maxItems":10,"type":"array","items":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"The route(s) (route areas) the run carries; the first is the main route. Usually one"},"date":{"description":"Delivery day (default today)","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"vehicle":{"description":"Default: the main route's usual van","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"driver":{"description":"Default: the main route's usual driver","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"salesOrders":{"description":"The orders on those routes to put on the run; default every order on them due by that day. Orders on the routes not listed are left off this run (they wait for the next one)","maxItems":300,"type":"array","items":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"}},"optimise":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}]}},"required":["areas"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/dispatch/runs/{run}/routes":{"post":{"operationId":"dispatch.runs.addRoute","summary":"Add a route to a run","description":"Puts another route (route area) on a planned run, for a van that does more than one route in a trip, with that route's orders due by the run's day (or the ones chosen; the rest are left off for the next run).","tags":["Deliveries"],"x-aurient-kind":"write","x-aurient-permission":"dispatch.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"area":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Route area to add to the run"},"salesOrders":{"description":"Default: every order on that route due by the run's day","maxItems":300,"type":"array","items":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"}}},"required":["area"]}}}},"parameters":[{"name":"run","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Delivery run id or number, e.g. RN-1001"},"description":"Delivery run id or number, e.g. RN-1001"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/dispatch/orders/leave-off":{"post":{"operationId":"dispatch.orders.leaveOff","summary":"Leave orders off a run","description":"Takes orders off their planned run on purpose (they stay on their route and wait for its next run), or puts them back on their route's planned run.","tags":["Deliveries"],"x-aurient-kind":"write","x-aurient-permission":"dispatch.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"salesOrders":{"minItems":1,"maxItems":300,"type":"array","items":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"}},"leaveOff":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["0","1","true","false"]}],"description":"true: take them off their planned run (they wait for the next run of their route); false: put them back on their route's planned run"}},"required":["salesOrders","leaveOff"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/help/guides":{"get":{"operationId":"help.guides","summary":"Help guides","description":"Aurient's own step-by-step help guides (with the exact buttons to press). Use for how-to questions (\"how do I…\", \"where do I…\") and answer from the guide that fits, naming its title so the person can open it under Help. Search with words from the question, or ask for one guide by its slug.","tags":["Settings"],"x-aurient-kind":"read","x-aurient-permission":null,"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","maxLength":200}},{"name":"slug","in":"query","required":false,"schema":{"type":"string","maxLength":60}}]}},"/bank-reconciliation":{"get":{"operationId":"bankrec.overview","summary":"Bank reconciliation","description":"Each bank account: its cash book balance, when it was last reconciled and to what balance, the reconciliation in progress, and how many cash book entries are not reconciled yet.","tags":["Money"],"x-aurient-kind":"read","x-aurient-permission":"finance.bank.reconcile","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/bank-reconciliation/{bank}":{"get":{"operationId":"bankrec.get","summary":"Bank reconciliation for one account","description":"One bank account's reconciliation: the statement in progress (or the given one) with its lines and matches, the cash book entries not reconciled yet, the difference left, and earlier statements.","tags":["Money"],"x-aurient-kind":"read","x-aurient-permission":"finance.bank.reconcile","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"bank","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"statement","in":"query","required":false,"schema":{"type":"string","maxLength":20}}]}},"/bank-reconciliation/{bank}/statements":{"post":{"operationId":"bankrec.start","summary":"Start a bank reconciliation","description":"Starts reconciling a bank statement: its end date and the ending balance printed on it. The opening balance is where the last reconciliation finished (type it only for the first one).","tags":["Money"],"x-aurient-kind":"write","x-aurient-permission":"finance.bank.reconcile","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"statementDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"closingBalance":{"type":"number"},"statementNo":{"type":"string","maxLength":40},"openingBalance":{"description":"Only for the first reconciliation of an account: the opening balance on the statement","type":"number"},"startDate":{"description":"Only for the first reconciliation: the statement's first day. Cash book entries before it are treated as already on the bank (they made up the opening balance)","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["statementDate","closingBalance"]}}}},"parameters":[{"name":"bank","in":"path","required":true,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/bank-statements/{statement}":{"patch":{"operationId":"bankrec.update","summary":"Change a statement in progress","description":"Changes the end date, ending balance or number of a statement being reconciled.","tags":["Money"],"x-aurient-kind":"write","x-aurient-permission":"finance.bank.reconcile","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"statementDate":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"closingBalance":{"type":"number"},"statementNo":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}]}},"required":[]}}}},"parameters":[{"name":"statement","in":"path","required":true,"schema":{"type":"string","maxLength":20}},{"$ref":"#/components/parameters/IdempotencyKey"}]},"delete":{"operationId":"bankrec.discard","summary":"Discard a reconciliation in progress","description":"Throws away a reconciliation that isn't finished: its statement lines and matches. Entries made from lines stay in the books.","tags":["Money"],"x-aurient-kind":"write","x-aurient-permission":"finance.bank.reconcile","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"statement","in":"path","required":true,"schema":{"type":"string","maxLength":20}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/bank-statements/{statement}/import":{"post":{"operationId":"bankrec.import","summary":"Import statement lines","description":"Adds lines from the bank's CSV or OFX file to a statement being reconciled. CSV columns are guessed from the header, or given; the mapping is remembered for the bank. Importing the same file twice adds nothing. preview = read it without saving.","tags":["Money"],"x-aurient-kind":"write","x-aurient-permission":"finance.bank.reconcile","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"text":{"type":"string","minLength":1,"maxLength":5000000},"map":{"type":"object","properties":{"date":{"type":"integer","minimum":0,"maximum":9007199254740991},"description":{"type":"integer","minimum":0,"maximum":9007199254740991},"amount":{"description":"One signed amount column (money in positive)","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"moneyIn":{"description":"Or separate columns: money in (credits, deposits)","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"moneyOut":{"description":"... and money out (debits, withdrawals)","anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"reference":{"anyOf":[{"type":"integer","minimum":0,"maximum":9007199254740991},{"type":"null"}]},"dateFormat":{"type":"string","maxLength":20},"header":{"default":true,"type":"boolean"},"flip":{"default":false,"description":"The bank shows money out as positive","type":"boolean"}},"required":["date","description"]},"preview":{"default":false,"type":"boolean"}},"required":["text"]}}}},"parameters":[{"name":"statement","in":"path","required":true,"schema":{"type":"string","maxLength":20}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/bank-statements/{statement}/lines":{"post":{"operationId":"bankrec.addLine","summary":"Add a statement line","description":"Types in a line from the bank statement (money in positive, money out negative).","tags":["Money"],"x-aurient-kind":"write","x-aurient-permission":"finance.bank.reconcile","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"description":{"type":"string","minLength":1,"maxLength":255},"reference":{"type":"string","maxLength":80},"amount":{"type":"number"}},"required":["date","description","amount"]}}}},"parameters":[{"name":"statement","in":"path","required":true,"schema":{"type":"string","maxLength":20}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/bank-statements/{statement}/lines/{line}":{"delete":{"operationId":"bankrec.deleteLine","summary":"Remove a statement line","description":"Removes a line from a statement being reconciled (and its match).","tags":["Money"],"x-aurient-kind":"write","x-aurient-permission":"finance.bank.reconcile","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"statement","in":"path","required":true,"schema":{"type":"string","maxLength":20}},{"name":"line","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/bank-statements/{statement}/auto-match":{"post":{"operationId":"bankrec.autoMatch","summary":"Match automatically","description":"Matches statement lines to cash book entries of the same amount within 3 days; when several fit, the one whose document number or reference appears on the line wins, then the closest date. Lines it isn't sure about are left for you.","tags":["Money"],"x-aurient-kind":"write","x-aurient-permission":"finance.bank.reconcile","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"statement","in":"path","required":true,"schema":{"type":"string","maxLength":20}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/bank-statements/{statement}/match":{"post":{"operationId":"bankrec.match","summary":"Match lines to entries","description":"Matches one or more statement lines to one or more cash book entries. The totals must agree.","tags":["Money"],"x-aurient-kind":"write","x-aurient-permission":"finance.bank.reconcile","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"lines":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},"entries":{"minItems":1,"maxItems":200,"type":"array","items":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}}},"required":["lines","entries"]}}}},"parameters":[{"name":"statement","in":"path","required":true,"schema":{"type":"string","maxLength":20}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/bank-statements/{statement}/match/{group}":{"delete":{"operationId":"bankrec.unmatch","summary":"Unmatch","description":"Undoes one match on a statement still in progress (a line, or an entry, and everything matched with it).","tags":["Money"],"x-aurient-kind":"write","x-aurient-permission":"finance.bank.reconcile","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"statement","in":"path","required":true,"schema":{"type":"string","maxLength":20}},{"name":"group","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/bank-statements/{statement}/lines/{line}/book":{"post":{"operationId":"bankrec.createEntry","summary":"Book a statement line","description":"For a statement line with nothing in the books: posts it and matches it. fee = bank charges (default account: bank charges), interest = interest earned or paid, other = any G/L account, customer = a payment received from a customer (applied to their oldest invoices), supplier = a payment to a supplier.","tags":["Money"],"x-aurient-kind":"write","x-aurient-permission":"finance.bank.reconcile","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"kind":{"type":"string","enum":["fee","interest","other","customer","supplier"]},"account":{"description":"G/L account for fee, interest or other","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"customer":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"supplier":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":{"type":"string","maxLength":255}},"required":["kind"]}}}},"parameters":[{"name":"statement","in":"path","required":true,"schema":{"type":"string","maxLength":20}},{"name":"line","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/bank-statements/{statement}/finish":{"post":{"operationId":"bankrec.finish","summary":"Finish the reconciliation","description":"Finishes a reconciliation: only when every statement line is matched and the opening balance plus the lines equals the ending balance. Matched entries are reconciled and can't be matched again.","tags":["Money"],"x-aurient-kind":"write","x-aurient-permission":"finance.bank.reconcile","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"statement","in":"path","required":true,"schema":{"type":"string","maxLength":20}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/bank-statements/{statement}/reopen":{"post":{"operationId":"bankrec.reopen","summary":"Reopen the last reconciliation","description":"Reopens the most recent finished reconciliation of a bank account so it can be corrected. Needs a reason; it is kept with the statement and in the audit trail.","tags":["Money"],"x-aurient-kind":"write","x-aurient-permission":"finance.bank.reconcile","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":255}},"required":["reason"]}}}},"parameters":[{"name":"statement","in":"path","required":true,"schema":{"type":"string","maxLength":20}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/process-flow/{ref}":{"get":{"operationId":"processFlow.get","summary":"Process Flow","description":"The Process Flow of a sales or purchasing document (quote, order, shipment, invoice, credit note, payment, purchase order, receipt, bill, supplier payment, supplier return, expense, or a till receipt number): every step from start to finish, done or still to come (picking, delivery, invoicing, payment, bank reconciliation; or arriving, receipts, freight and duty, bills, payments), credit notes and returns, with each document's number and status, then the journal entries and what the whole process did to the general ledger.","tags":["Reports"],"x-aurient-kind":"read","x-aurient-permission":"flow.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"ref","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":40}}]}},"/pos/kitchens":{"get":{"operationId":"pos.kitchens.list","summary":"Kitchens","description":"The counter-service kitchens: the store each is in, the tills that send it orders, what it makes (products and categories), whether food is handed over at the till or collected when ready, and its kitchen screen.","tags":["Till"],"x-aurient-kind":"read","x-aurient-permission":["pos.manage","pos.kitchen"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}},"put":{"operationId":"pos.kitchens.save","summary":"Save a kitchen","description":"Adds or changes a counter-service kitchen: its store, the tills that feed it, what it makes (products and/or whole categories), and the hand-over (\"wait\": pay, then wait for your order; \"collect\": handed over at the till when paid). Its orders show on the kitchen screen.","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"code":{"type":"string","minLength":1,"maxLength":12,"pattern":"^[A-Za-z0-9-]+$"},"name":{"type":"string","minLength":1,"maxLength":80},"warehouse":{"type":["string","number"]},"registers":{"minItems":1,"type":"array","items":{"type":"string","minLength":1}},"items":{"default":[],"type":"array","items":{"type":"string","minLength":1}},"categories":{"default":[],"type":"array","items":{"type":"string","minLength":1}},"handover":{"default":"wait","type":"string","enum":["wait","collect"]},"active":{"default":true,"type":"boolean"}},"required":["code","name","warehouse","registers"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/pos/kitchen/tickets/{ticket}/close":{"post":{"operationId":"pos.kitchen.close","summary":"Close a kitchen order without serving it","description":"A manager closes a counter-service kitchen order that will not be served (the customer left, a mistake), with the reason. The food never left stock; refund or credit the customer at the till as usual.","tags":["Till"],"x-aurient-kind":"write","x-aurient-permission":"pos.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":200}},"required":["reason"]}}}},"parameters":[{"name":"ticket","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/customer-payments/{payment}/reverse":{"post":{"operationId":"finance.payment.reverse","summary":"Reverse a customer payment","description":"Reverses a posted customer payment that was recorded by mistake (wrong customer, wrong amount, bounced): the ledger entry is reversed, the invoices it paid reopen, and the payment stays on file as Reversed with the reason. Dated the payment's own date unless that period is closed (then post it today).","tags":["Money"],"x-aurient-kind":"write","x-aurient-permission":"sales.payments.reverse","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"reason":{"type":"string","minLength":3,"maxLength":255},"date":{"description":"When the reversal posts. Defaults to the payment's own date; use today when that period is closed.","type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["reason"]}}}},"parameters":[{"name":"payment","in":"path","required":true,"schema":{"type":["string","number"]}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/customer-payments/{payment}/move":{"post":{"operationId":"finance.payment.move","summary":"Move a payment between invoices","description":"Unapply or reapply a customer payment: take an amount off one invoice and put it on another of theirs, onto their account (unapplied), or from their account onto an invoice. The money received and the ledger don't change; only which invoices it pays.","tags":["Money"],"x-aurient-kind":"write","x-aurient-permission":"sales.payments.reverse","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"from":{"description":"The invoice to take it off; leave out to use what is on the customer's account","type":"string","minLength":1},"to":{"description":"The invoice to put it on; leave out to leave it on the customer's account","type":"string","minLength":1},"amount":{"type":"number","exclusiveMinimum":0,"maximum":1000000000}},"required":["amount"]}}}},"parameters":[{"name":"payment","in":"path","required":true,"schema":{"type":["string","number"]}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/customers/{customer}/on-account":{"get":{"operationId":"finance.customer.onAccount","summary":"Money on a customer's account","description":"What a customer has on account (payments not set against any invoice, and credit notes not used yet), oldest first: what a refund from account can pay back.","tags":["Money"],"x-aurient-kind":"read","x-aurient-permission":["sales.credit.refund","sales.payment.view"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"customer","in":"path","required":true,"schema":{"type":["string","number"]}}]}},"/customers/{customer}/refunds":{"post":{"operationId":"finance.customer.refund","summary":"Refund money on a customer's account","description":"Pays a customer back money that is on their account (overpayments, payments not set against an invoice, unused credit notes): up to what is on account. Posts against receivables, not sales. Method: cash, bank, card, or a record of a PayPal refund.","tags":["Money"],"x-aurient-kind":"write","x-aurient-permission":"sales.credit.refund","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"amount":{"type":"number","exclusiveMinimum":0,"maximum":1000000000},"method":{"type":"string","enum":["cash","bank","card","paypal"],"description":"paypal = a record of a refund already made in PayPal"},"bankAccount":{"description":"The cash, bank or PayPal account the money left from (default: the main bank account)","type":["string","number"]},"reason":{"type":"string","minLength":3,"maxLength":255},"reference":{"type":"string","maxLength":80},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["amount","method","reason"]}}}},"parameters":[{"name":"customer","in":"path","required":true,"schema":{"type":["string","number"]}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/credit-notes":{"post":{"operationId":"sales.credit.standalone","summary":"Credit note (not against an invoice)","description":"Gives a customer a credit note that isn't tied to an invoice (a goodwill credit, a rebate, a price agreed after the fact): lines or one amount, with tax and a reason. The credit then comes off what they owe (oldest invoices first), is refunded, or stays on their account. No stock moves.","tags":["Sales"],"x-aurient-kind":"write","x-aurient-permission":"sales.credit.refund","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"customer":{"type":["string","number"]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"reason":{"type":"string","minLength":3,"maxLength":255},"lines":{"default":[],"maxItems":100,"type":"array","items":{"type":"object","properties":{"item":{"type":["string","number"]},"description":{"type":"string","maxLength":255},"qty":{"default":1,"type":"number","exclusiveMinimum":0},"unitPrice":{"type":"number","minimum":0},"tax":{"type":["string","number"]}},"required":["unitPrice"]}},"amount":{"description":"A single amount (before tax) instead of lines","type":"number","exclusiveMinimum":0},"tax":{"description":"Tax on the single amount","type":["string","number"]},"use":{"default":"owed","description":"owed = off what they owe (oldest invoices first); refund = paid back; account = left on their account","type":"string","enum":["owed","refund","account"]},"method":{"type":"string","enum":["cash","bank","card","paypal"]},"bankAccount":{"type":["string","number"]}},"required":["customer","reason"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/labels/layouts":{"get":{"operationId":"labels.layouts","summary":"Label layouts","description":"The label sheets and rolls labels can be printed on: the common sticker sheets built in, and the company's own; and the item categories to choose from.","tags":["Items"],"x-aurient-kind":"read","x-aurient-permission":"inventory.item.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"labels.layout.save","summary":"Save a label layout","description":"Saves a label sheet or roll of the company's own: page size, rows and columns, label size, margins and gaps (in millimetres).","tags":["Items"],"x-aurient-kind":"write","x-aurient-permission":"inventory.item.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":80},"kind":{"default":"sheet","type":"string","enum":["sheet","roll"]},"pageW":{"type":"number","minimum":0,"maximum":1000},"pageH":{"type":"number","minimum":0,"maximum":1000},"cols":{"type":"integer","minimum":1,"maximum":20},"rows":{"type":"integer","minimum":1,"maximum":60},"labelW":{"type":"number","minimum":0,"maximum":1000},"labelH":{"type":"number","minimum":0,"maximum":1000},"marginTop":{"default":0,"type":"number","minimum":0,"maximum":1000},"marginLeft":{"default":0,"type":"number","minimum":0,"maximum":1000},"gapX":{"default":0,"type":"number","minimum":0,"maximum":1000},"gapY":{"default":0,"type":"number","minimum":0,"maximum":1000},"id":{"type":"string","maxLength":20},"content":{"type":"object","properties":{"name":{"default":true,"type":"boolean"},"price":{"default":true,"type":"boolean"},"barcode":{"default":true,"type":"boolean"},"sku":{"default":true,"type":"boolean"},"unit":{"default":false,"type":"boolean"},"business":{"default":false,"type":"boolean"},"priceSize":{"default":"normal","type":"string","enum":["small","normal","big"]}}}},"required":["name","pageW","pageH","cols","rows","labelW","labelH"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/labels/layouts/{layout}":{"delete":{"operationId":"labels.layout.delete","summary":"Remove a label layout","description":"Removes one of the company's own label layouts.","tags":["Items"],"x-aurient-kind":"write","x-aurient-permission":"inventory.item.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"layout","in":"path","required":true,"schema":{"type":"string","maxLength":20}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/labels/items":{"post":{"operationId":"labels.items","summary":"Items for labels","description":"Items to print labels for, with their shelf price and barcode: chosen items, a whole category, everything on a goods receipt (one label per unit received), or items whose price changed since a date.","tags":["Items"],"x-aurient-kind":"read","x-aurient-permission":"inventory.item.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"maxItems":500,"type":"array","items":{"type":"object","properties":{"item":{"type":["string","number"]},"unit":{"type":"string","maxLength":20},"copies":{"default":1,"type":"integer","minimum":0,"maximum":999}},"required":["item"]}},"category":{"type":"string","maxLength":80},"receipt":{"type":"string","maxLength":30},"changedSince":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":[]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/serials/next":{"get":{"operationId":"serials.next","summary":"Number them for me","description":"Serial numbers not used yet for a serial-numbered item (SKU-0001, SKU-0002...), for units that arrive without their own.","tags":["Items"],"x-aurient-kind":"read","x-aurient-permission":"inventory.item.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"item","in":"query","required":true,"schema":{"type":["string","number"]}},{"name":"count","in":"query","required":true,"schema":{"type":"integer","minimum":1,"maximum":500}}]}},"/serials":{"get":{"operationId":"serials.find","summary":"Find serial numbers","description":"Serial numbers matching some characters (or all of one item), with the item and whether each is in stock (and where) or gone (sold, returned to the supplier, written off).","tags":["Items"],"x-aurient-kind":"read","x-aurient-permission":"inventory.item.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"q","in":"query","required":false,"schema":{"description":"Part of a serial number","type":"string","maxLength":40},"description":"Part of a serial number"},{"name":"item","in":"query","required":false,"schema":{"type":["string","number"]}},{"name":"inStock","in":"query","required":false,"schema":{"type":"boolean"}}]}},"/serials/{serial}":{"get":{"operationId":"serials.get","summary":"Look up a serial number","description":"One serial number: the item, where it is now (store and bin) or who bought it and when, the warranty end date, and its whole history (ordered, received, sold, delivered, returned) with the documents.","tags":["Items"],"x-aurient-kind":"read","x-aurient-permission":"inventory.item.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"serial","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":40}},{"name":"item","in":"query","required":false,"schema":{"description":"Needed only when two items share a serial number","type":["string","number"]},"description":"Needed only when two items share a serial number"}]}},"/commissions/settings":{"get":{"operationId":"commissions.settings","summary":"Commission set-up","description":"How sales commission is worked out: when it is earned (paid or invoiced), on what (the sale or the profit), the usual rate, each rep's rate and the rates for categories and items, whether credit notes take it back and whether till sales count.","tags":["Commissions"],"x-aurient-kind":"read","x-aurient-permission":"sales.commissions.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}},"put":{"operationId":"commissions.saveSettings","summary":"Save commission set-up","description":"Change how commission is worked out (when earned, on what, the usual rate, credit notes, till sales, the expense account).","tags":["Commissions"],"x-aurient-kind":"write","x-aurient-permission":"sales.commissions.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"earnOn":{"type":"string","enum":["paid","invoiced"]},"basis":{"type":"string","enum":["sale","profit"]},"defaultRate":{"type":"number","minimum":0,"maximum":100},"clawBack":{"type":"boolean"},"tillCounts":{"type":"boolean"},"expenseAccount":{"type":["string","number","null"]}},"required":[]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/commissions/rates":{"post":{"operationId":"commissions.saveRate","summary":"Set a commission rate","description":"A rep's own rate, or a rate for a category or an item (for one rep or everyone). Saving the same combination again changes it.","tags":["Commissions"],"x-aurient-kind":"write","x-aurient-permission":"sales.commissions.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"rep":{"description":"The rep (name, email or id); leave out for everyone","type":["string","number"]},"category":{"description":"Only items in this category (by name)","type":"string","maxLength":80},"item":{"description":"Only this item (SKU)","type":["string","number"]},"rate":{"type":"number","minimum":0,"maximum":100,"description":"Percent"}},"required":["rate"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/commissions/rates/{id}":{"delete":{"operationId":"commissions.deleteRate","summary":"Remove a commission rate","description":"Removes one commission rate; that rep, category or item then goes back to the next rate that fits.","tags":["Commissions"],"x-aurient-kind":"write","x-aurient-permission":"sales.commissions.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/commissions/month":{"get":{"operationId":"commissions.month","summary":"Commissions for a month","description":"Each rep's commission for a month: what it was worked out on, what they earned, what credit notes took back, what to pay, and whether the month was paid. Someone without commission management sees only their own.","tags":["Commissions"],"x-aurient-kind":"read","x-aurient-permission":null,"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"month","in":"query","required":false,"schema":{"description":"YYYY-MM; this month when left out","type":"string","pattern":"^\\d{4}-\\d{2}$"},"description":"YYYY-MM; this month when left out"}]}},"/commissions/statement":{"get":{"operationId":"commissions.statement","summary":"A rep's commission statement","description":"Every invoice, payment and credit note behind a rep's commission for a month, with the rate used. A rep may always see their own.","tags":["Commissions"],"x-aurient-kind":"read","x-aurient-permission":null,"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"month","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"}},{"name":"rep","in":"query","required":false,"schema":{"description":"Leave out for your own","type":["string","number"]},"description":"Leave out for your own"}]}},"/commissions/pay":{"post":{"operationId":"commissions.pay","summary":"Mark a month's commission paid","description":"Records a month's commission as paid: Dr the commission expense account, Cr the bank, and locks the month (the statements stay as they are).","tags":["Commissions"],"x-aurient-kind":"write","x-aurient-permission":"sales.commissions.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"month":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"bankAccount":{"type":["string","number"]},"expenseAccount":{"type":["string","number"]},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},"required":["month"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/currencies":{"get":{"operationId":"currencies.list","summary":"Currencies","description":"The base currency, the currencies switched on (fixed or latest rate, how old it is, who uses them) and every currency that could be switched on.","tags":["Money"],"x-aurient-kind":"read","x-aurient-permission":null,"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/currencies/{currency}":{"put":{"operationId":"currencies.save","summary":"Set up a currency","description":"Switch a currency on or off for customers, suppliers and bank accounts; give it a fixed (pegged) rate or clear it; say whether its rate is fetched every morning.","tags":["Money"],"x-aurient-kind":"write","x-aurient-permission":"finance.currency.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"active":{"type":"boolean"},"fixedRate":{"description":"1 unit = this many of the base currency, always (pegged). null = use dated rates","anyOf":[{"type":"number","exclusiveMinimum":0,"maximum":1000000000},{"type":"null"}]},"autoFetch":{"description":"Fetch the rate every morning","type":"boolean"}},"required":[]}}}},"parameters":[{"name":"currency","in":"path","required":true,"schema":{"type":"string","minLength":3,"maxLength":3}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/currencies/{currency}/rates":{"get":{"operationId":"currencies.rates","summary":"Exchange rates","description":"The dated exchange rates kept for a currency, newest first (1 unit in the base currency), with who added each and where it came from.","tags":["Money"],"x-aurient-kind":"read","x-aurient-permission":null,"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"currency","in":"path","required":true,"schema":{"type":"string","minLength":3,"maxLength":3}},{"name":"limit","in":"query","required":false,"schema":{"default":60,"type":"integer","minimum":1,"maximum":500}}]}},"/exchange-rates":{"post":{"operationId":"currencies.addRates","summary":"Add exchange rates","description":"Add (or replace) exchange rates: for each, the currency, the date it applies from and 1 unit in the base currency. Typed one at a time or imported from a spreadsheet.","tags":["Money"],"x-aurient-kind":"write","x-aurient-permission":"finance.currency.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"rates":{"minItems":1,"maxItems":2000,"type":"array","items":{"type":"object","properties":{"currency":{"type":"string","minLength":3,"maxLength":3},"date":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"rate":{"type":"number","exclusiveMinimum":0,"maximum":1000000000}},"required":["currency","date","rate"]}},"source":{"description":"Where they came from, e.g. \"Central bank\" (defaults to typed or imported)","type":"string","maxLength":40}},"required":["rates"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/exchange-rates/{rate}":{"delete":{"operationId":"currencies.deleteRate","summary":"Remove an exchange rate","description":"Remove one dated exchange rate (documents already made keep the rate they copied).","tags":["Money"],"x-aurient-kind":"write","x-aurient-permission":"finance.currency.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"rate","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/exchange-rates/fetch":{"post":{"operationId":"currencies.fetch","summary":"Fetch today's exchange rates","description":"Fetch today's rates for the switched-on currencies (those without a fixed rate) from the rates service.","tags":["Money"],"x-aurient-kind":"write","x-aurient-permission":"finance.currency.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":false,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"currencies":{"maxItems":50,"type":"array","items":{"type":"string","minLength":3,"maxLength":3}}},"required":[]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/currencies/revaluation":{"get":{"operationId":"currencies.revaluationPreview","summary":"Foreign balances at month end","description":"What revaluing would post on a date: per currency, open receivables, payables and foreign bank balances as booked and at that date's rate, and the difference.","tags":["Money"],"x-aurient-kind":"read","x-aurient-permission":"finance.currency.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"asOf","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}}]}},"/currencies/revalue":{"post":{"operationId":"currencies.revalue","summary":"Revalue foreign balances","description":"Month end: restate open foreign-currency receivables, payables and bank balances at the rate on the date. Posts the difference as an unrealised exchange gain or loss, and reverses itself the next day.","tags":["Money"],"x-aurient-kind":"write","x-aurient-permission":"finance.currency.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"asOf":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Usually the last day of the month"}},"required":["asOf"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/reports/snapshot":{"get":{"operationId":"reports.snapshot","summary":"Business snapshot","description":"Headline health check: sales and gross margin (last 30 days vs the 30 before), cash in/out, what customers owe and what is overdue, what we owe and what is due this week, stock value, items below reorder, late purchase orders, orders waiting to ship or be invoiced.","tags":["Reports"],"x-aurient-kind":"read","x-aurient-permission":"finance.reports.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/reports/reorder":{"get":{"operationId":"reports.reorder","summary":"Below reorder point","description":"Items below their reorder point per warehouse, with shortfall, days of cover, suggested order quantity and any open purchase orders already coming.","tags":["Reports"],"x-aurient-kind":"read","x-aurient-permission":["purchasing.po.view","inventory.stock.view"],"responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"supplier","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"item","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}}]}},"/reports/open-purchase-orders":{"get":{"operationId":"reports.openPurchaseOrders","summary":"Open purchase orders","description":"Purchase orders sent or partly received: what is coming, from whom, when, how late, and the value still to arrive.","tags":["Reports"],"x-aurient-kind":"read","x-aurient-permission":"purchasing.po.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"supplier","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"item","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"lateOnly","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"string","enum":["true","false"]}]}}]}},"/reports/late-deliveries":{"get":{"operationId":"reports.lateDeliveries","summary":"Late deliveries","description":"Open purchase orders past their expected date, most late first, with supplier and value outstanding.","tags":["Reports"],"x-aurient-kind":"read","x-aurient-permission":"purchasing.po.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"supplier","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"item","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}}]}},"/reports/unpaid-invoices":{"get":{"operationId":"reports.unpaidInvoices","summary":"Unpaid invoices","description":"Accounts receivable: every invoice with money still owed, days overdue and aging bucket (current, 1-30, 31-60, 61-90, 90+), plus totals per bucket.","tags":["Reports"],"x-aurient-kind":"read","x-aurient-permission":"sales.invoice.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"supplier","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"item","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}}]}},"/reports/bills-to-pay":{"get":{"operationId":"reports.billsToPay","summary":"Bills to pay","description":"Accounts payable: supplier bills not fully paid, soonest due first, plus overdue and due-this-week totals. Unused supplier credits are listed too.","tags":["Reports"],"x-aurient-kind":"read","x-aurient-permission":"purchasing.bill.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"supplier","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"item","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}}]}},"/reports/stock":{"get":{"operationId":"reports.stock","summary":"Stock by warehouse","description":"Stock position per item per warehouse: on hand, reserved, available, on order, in transit, sold 30 days, days of cover, average cost and value.","tags":["Reports"],"x-aurient-kind":"read","x-aurient-permission":"inventory.stock.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"supplier","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"item","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}}]}},"/reports/transfers-in-transit":{"get":{"operationId":"reports.transfersInTransit","summary":"Transfers in transit","description":"Stock on the way between warehouses and how long it has been travelling.","tags":["Reports"],"x-aurient-kind":"read","x-aurient-permission":"inventory.transfer.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"supplier","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"item","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}}]}},"/reports/orders-to-ship":{"get":{"operationId":"reports.ordersToShip","summary":"Orders to ship","description":"Open sales orders waiting to be shipped, oldest first, and whether there is enough stock to ship each one completely.","tags":["Reports"],"x-aurient-kind":"read","x-aurient-permission":"sales.order.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"supplier","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"item","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}}]}},"/reports/to-invoice":{"get":{"operationId":"reports.toInvoice","summary":"Shipped, not invoiced","description":"Sales orders that have shipped but are not fully invoiced yet - money we have not billed for.","tags":["Reports"],"x-aurient-kind":"read","x-aurient-permission":"sales.shipment.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"supplier","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"item","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}}]}},"/reports/quotes":{"get":{"operationId":"reports.quotes","summary":"Quotes","description":"Quotes in a period with status (Open, Expired, Won, Lost), win rate and value.","tags":["Reports"],"x-aurient-kind":"read","x-aurient-permission":"sales.quote.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"supplier","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"item","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}}]}},"/reports/sales":{"get":{"operationId":"reports.salesPerformance","summary":"Sales performance","description":"Revenue, cost of goods, gross margin and units for the last N days, grouped by day, item, customer or warehouse. Use for trends, top customers, top items and margin questions.","tags":["Reports"],"x-aurient-kind":"read","x-aurient-permission":"sales.performance.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"days","in":"query","required":false,"schema":{"default":30,"type":"integer","minimum":1,"maximum":730}},{"name":"groupBy","in":"query","required":false,"schema":{"default":"day","type":"string","enum":["day","item","customer","warehouse"]}},{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"}]}},"/reports/expenses":{"get":{"operationId":"reports.expenses","summary":"Expenses","description":"Overheads in a period (default last 30 days) with totals by category.","tags":["Reports"],"x-aurient-kind":"read","x-aurient-permission":"finance.expense.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"supplier","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"item","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}}]}},"/reports/cash-ledger":{"get":{"operationId":"reports.cashLedger","summary":"Cash ledger","description":"One bank account's cash book for a period, from the ledger: payments in and out, expenses, till floats, drops and banking, card settlements and journals, with a running balance. Defaults to the main bank account.","tags":["Reports"],"x-aurient-kind":"read","x-aurient-permission":"finance.cash.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"supplier","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"item","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"bank","in":"query","required":false,"schema":{"description":"Bank account name (default: the main one)","anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}]},"description":"Bank account name (default: the main one)"}]}},"/reports/stock-moves":{"get":{"operationId":"reports.stockMoves","summary":"Stock movements","description":"The stock ledger: every receipt, sale, transfer, return, adjustment and count, filtered by item, warehouse and dates.","tags":["Reports"],"x-aurient-kind":"read","x-aurient-permission":"inventory.stock.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"supplier","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"item","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"filters","in":"query","required":false,"schema":{"description":"Column searches as JSON, e.g. [{\"k\":\"customer_name\",\"q\":\"best\"},{\"k\":\"total\",\"from\":10,\"to\":500},{\"k\":\"invoice_date\",\"from\":\"2026-01-01\",\"to\":\"2026-01-31\"},{\"k\":\"status_label\",\"in\":[\"Paid\",\"Unpaid\"]}]","type":"string","maxLength":4000},"description":"Column searches as JSON, e.g. [{\"k\":\"customer_name\",\"q\":\"best\"},{\"k\":\"total\",\"from\":10,\"to\":500},{\"k\":\"invoice_date\",\"from\":\"2026-01-01\",\"to\":\"2026-01-31\"},{\"k\":\"status_label\",\"in\":[\"Paid\",\"Unpaid\"]}]"},{"name":"sort","in":"query","required":false,"schema":{"description":"A field to sort by; put - in front for largest / newest / Z first, e.g. -total","type":"string","maxLength":60},"description":"A field to sort by; put - in front for largest / newest / Z first, e.g. -total"},{"name":"q","in":"query","required":false,"schema":{"description":"Part of an item code or name, or a document number","type":"string","maxLength":80},"description":"Part of an item code or name, or a document number"}]}},"/activity":{"get":{"operationId":"reports.activity","summary":"Activity log","description":"Who did what and when (people and approved AI actions), newest first.","tags":["Reports"],"x-aurient-kind":"read","x-aurient-permission":"admin.audit.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"warehouse","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"supplier","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"customer","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"item","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},{"type":"string","minLength":1,"maxLength":200}],"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},"description":"Numeric id, or a human reference: code (\"S2\", \"C1\"), SKU (\"CF-1042\"), document number (\"PO-1042\") or exact name"},{"name":"from","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"to","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"}},{"name":"limit","in":"query","required":false,"schema":{"default":50,"type":"integer","minimum":1,"maximum":500}},{"name":"offset","in":"query","required":false,"schema":{"default":0,"type":"integer","minimum":0,"maximum":9007199254740991}},{"name":"entityType","in":"query","required":false,"schema":{"type":"string","maxLength":32}},{"name":"entityId","in":"query","required":false,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}}]}},"/promotions":{"get":{"operationId":"pricing.promotions","summary":"Promotions","description":"Promotions at the till: what each one does, when it runs, whether it is on now, and how often it was used and what it saved in the last 30 days.","tags":["Prices and promotions"],"x-aurient-kind":"read","x-aurient-permission":"sales.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"includeEnded","in":"query","required":false,"schema":{"type":"boolean"}}]},"post":{"operationId":"pricing.savePromotion","summary":"Save a promotion","description":"Add or change a promotion at the till: percent_off, amount_off (each), fixed_price, buy_get (buy N get M free or at a % off), multibuy (N for $X, mix and match across the items), spend_get (spend $X, get % or $ off). Optional: dates, days (0 = Monday), hours, members only, a price list (customer group), a coupon code, a limit per sale.","tags":["Prices and promotions"],"x-aurient-kind":"write","x-aurient-permission":"sales.pricing.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"promotion":{"description":"Id to change; omit to add a new one","type":"integer","exclusiveMinimum":0,"maximum":9007199254740991},"name":{"type":"string","minLength":2,"maxLength":80},"kind":{"type":"string","enum":["percent_off","amount_off","fixed_price","buy_get","multibuy","spend_get"]},"scope":{"default":"items","type":"string","enum":["items","all"]},"items":{"default":[],"description":"SKUs it covers","maxItems":500,"type":"array","items":{"type":"string","minLength":1}},"categories":{"default":[],"description":"Item categories it covers","maxItems":50,"type":"array","items":{"type":"string","minLength":1}},"pct":{"type":"number","exclusiveMinimum":0,"maximum":100},"amount":{"type":"number","exclusiveMinimum":0},"price":{"type":"number","minimum":0},"buyQty":{"type":"integer","minimum":1,"maximum":100},"getQty":{"type":"integer","minimum":1,"maximum":100},"getPct":{"type":"number","exclusiveMinimum":0,"maximum":100},"bundleQty":{"type":"integer","minimum":2,"maximum":100},"bundlePrice":{"type":"number","exclusiveMinimum":0},"minSpend":{"type":"number","exclusiveMinimum":0},"startsOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"endsOn":{"anyOf":[{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},{"type":"null"}]},"days":{"description":"0 = Monday ... 6 = Sunday; empty = every day","maxItems":7,"type":"array","items":{"type":"integer","minimum":0,"maximum":6}},"startTime":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"endTime":{"anyOf":[{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},{"type":"null"}]},"membersOnly":{"type":"boolean"},"priceList":{"description":"Only for customers on this price list (code)","type":["string","null"]},"coupon":{"anyOf":[{"type":"string","pattern":"^[A-Z0-9-]{3,30}$"},{"type":"null"}]},"maxPerSale":{"anyOf":[{"type":"integer","minimum":1,"maximum":1000},{"type":"null"}]},"active":{"default":true,"type":"boolean"},"notes":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]}},"required":["name","kind"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/promotions/{promotion}":{"get":{"operationId":"pricing.promotion","summary":"Promotion","description":"One promotion with everything it covers.","tags":["Prices and promotions"],"x-aurient-kind":"read","x-aurient-permission":"sales.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"promotion","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}}]}},"/promotions/{promotion}/active":{"post":{"operationId":"pricing.switchPromotion","summary":"Turn a promotion on or off","description":"Turn a promotion on or off at the till.","tags":["Prices and promotions"],"x-aurient-kind":"write","x-aurient-permission":"sales.pricing.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"active":{"type":"boolean"}},"required":["active"]}}}},"parameters":[{"name":"promotion","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/price-lists":{"get":{"operationId":"pricing.lists","summary":"Price lists","description":"Price lists: for a group of customers (wholesale, staff) or quantity breaks for everyone; how many prices and customers each has.","tags":["Prices and promotions"],"x-aurient-kind":"read","x-aurient-permission":"sales.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"pricing.saveList","summary":"Save a price list","description":"Add or change a price list: its prices (item, unit, from how many, price) replace the old ones; customers given this list get its prices. everyone = quantity breaks for every customer.","tags":["Prices and promotions"],"x-aurient-kind":"write","x-aurient-permission":"sales.pricing.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"code":{"type":"string","pattern":"^[A-Z0-9-]{2,20}$"},"name":{"type":"string","minLength":2,"maxLength":80},"everyone":{"default":false,"type":"boolean"},"active":{"default":true,"type":"boolean"},"notes":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}]},"entries":{"default":[],"maxItems":5000,"type":"array","items":{"type":"object","properties":{"item":{"type":"string","minLength":1},"unit":{"type":"string"},"minQty":{"default":1,"type":"number","exclusiveMinimum":0},"price":{"type":"number","minimum":0}},"required":["item","price"]}},"customers":{"description":"Customer codes on this list (replaces who is on it)","maxItems":5000,"type":"array","items":{"type":"string","minLength":1}}},"required":["code","name"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/price-lists/{list}":{"get":{"operationId":"pricing.list","summary":"Price list","description":"One price list: its prices (item, unit, from how many, price, and the normal price) and its customers.","tags":["Prices and promotions"],"x-aurient-kind":"read","x-aurient-permission":"sales.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"list","in":"path","required":true,"schema":{"type":"string","minLength":1}}]}},"/price-changes":{"get":{"operationId":"pricing.changes","summary":"Scheduled price changes","description":"New prices waiting for their date, and the ones applied in the last 90 days.","tags":["Prices and promotions"],"x-aurient-kind":"read","x-aurient-permission":"sales.view","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"operationId":"pricing.schedule","summary":"Schedule a price change","description":"A new price for an item from a date (its own price, one of its units, or on a price list). A date of today or earlier changes it now.","tags":["Prices and promotions"],"x-aurient-kind":"write","x-aurient-permission":"sales.pricing.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"item":{"type":"string","minLength":1},"unit":{"type":"string"},"priceList":{"type":"string"},"newPrice":{"type":"number","minimum":0},"startsOn":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$"},"note":{"type":"string","maxLength":255}},"required":["item","newPrice","startsOn"]}}}},"parameters":[{"$ref":"#/components/parameters/IdempotencyKey"}]}},"/price-changes/{change}/cancel":{"post":{"operationId":"pricing.cancelChange","summary":"Cancel a scheduled price change","description":"Cancel a price change that has not happened yet.","tags":["Prices and promotions"],"x-aurient-kind":"write","x-aurient-permission":"sales.pricing.manage","responses":{"200":{"description":"Done. The answer is the same as the app gets.","content":{"application/json":{"schema":{"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthenticated"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"$ref":"#/components/responses/Conflict"},"422":{"$ref":"#/components/responses/Invalid"},"429":{"$ref":"#/components/responses/RateLimited"}},"parameters":[{"name":"change","in":"path","required":true,"schema":{"type":"integer","exclusiveMinimum":0,"maximum":9007199254740991}},{"$ref":"#/components/parameters/IdempotencyKey"}]}}},"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","description":"Authorization: Bearer ak_live_… (or ak_test_… for the practice company)"}},"parameters":{"IdempotencyKey":{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","maxLength":100},"description":"Send the same value again (within 24 hours) and you get the first answer back instead of it being done twice."}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{},"requestId":{"type":"string"}},"required":["code","message"]}}}},"responses":{"Unauthenticated":{"description":"No key, a wrong key, or a key that is turned off","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"Not something a key can do, or not in the company's plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"No such record","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Conflict":{"description":"Not possible right now (for example, already shipped)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Invalid":{"description":"Something in the request needs fixing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many calls this minute: wait the seconds in Retry-After","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"x-webhook-events":[{"name":"quote.created","group":"Orders and deliveries","label":"A quote was made","object":"quote"},{"name":"quote.lost","group":"Orders and deliveries","label":"A quote was marked lost","object":"quote"},{"name":"sales_order.created","group":"Orders and deliveries","label":"A sales order was made","object":"sales_order"},{"name":"sales_order.changed","group":"Orders and deliveries","label":"A sales order was changed or closed short","object":"sales_order"},{"name":"sales_order.cancelled","group":"Orders and deliveries","label":"A sales order was cancelled","object":"sales_order"},{"name":"sales_order.shipped","group":"Orders and deliveries","label":"Goods were shipped (a shipment)","object":"shipment"},{"name":"delivery.delivered","group":"Orders and deliveries","label":"A delivery reached the customer","object":"shipment"},{"name":"delivery.failed","group":"Orders and deliveries","label":"A delivery could not be made","object":"shipment"},{"name":"delivery_run.started","group":"Orders and deliveries","label":"A delivery run left","object":"delivery_run"},{"name":"delivery_run.completed","group":"Orders and deliveries","label":"A delivery run was finished","object":"delivery_run"},{"name":"return_request.created","group":"Orders and deliveries","label":"A customer asked to return goods","object":"return_request"},{"name":"return_request.decided","group":"Orders and deliveries","label":"A return request was credited, declined or the goods came back","object":"return_request"},{"name":"invoice.posted","group":"Invoices and money","label":"An invoice was issued","object":"invoice"},{"name":"invoice.voided","group":"Invoices and money","label":"An invoice was voided","object":"invoice"},{"name":"credit_note.created","group":"Invoices and money","label":"A credit note was made","object":"credit_note"},{"name":"payment.received","group":"Invoices and money","label":"A customer payment was recorded","object":"customer_payment"},{"name":"payment.reversed","group":"Invoices and money","label":"A customer payment was reversed or moved","object":"customer_payment"},{"name":"refund.made","group":"Invoices and money","label":"Money was refunded to a customer","object":"customer_refund"},{"name":"till.sale","group":"Invoices and money","label":"A sale at the till (or a table paid)","object":"till_sale"},{"name":"till.return","group":"Invoices and money","label":"A return or exchange at the till","object":"till_sale"},{"name":"till.shift_closed","group":"Invoices and money","label":"A till shift was closed (Z report)","object":"till_shift"},{"name":"expense.recorded","group":"Invoices and money","label":"An expense was recorded","object":"expense"},{"name":"journal.posted","group":"Invoices and money","label":"A journal entry was posted or reversed","object":"journal_entry"},{"name":"stock.changed","group":"Stock and items","label":"An item's stock in a warehouse went up or down (one message per item and warehouse)","object":"stock"},{"name":"stock.below_reorder","group":"Stock and items","label":"An item fell below its reorder point in a warehouse","object":"stock"},{"name":"stock.adjusted","group":"Stock and items","label":"A stock adjustment or count was posted","object":"stock_adjustment"},{"name":"transfer.sent","group":"Stock and items","label":"A transfer left a warehouse","object":"transfer"},{"name":"transfer.received","group":"Stock and items","label":"A transfer arrived","object":"transfer"},{"name":"item.created","group":"Stock and items","label":"An item was added","object":"item"},{"name":"item.changed","group":"Stock and items","label":"An item was changed (blocked, unblocked, units, components …)","object":"item"},{"name":"item.price_changed","group":"Stock and items","label":"An item's selling price changed","object":"item"},{"name":"price_list.changed","group":"Stock and items","label":"A price list or promotion was made or changed","object":"price_list"},{"name":"customer.created","group":"Customers and purchasing","label":"A customer was added","object":"customer"},{"name":"customer.changed","group":"Customers and purchasing","label":"A customer was changed","object":"customer"},{"name":"supplier.created","group":"Customers and purchasing","label":"A supplier was added","object":"supplier"},{"name":"supplier.changed","group":"Customers and purchasing","label":"A supplier was changed","object":"supplier"},{"name":"purchase_order.created","group":"Customers and purchasing","label":"A purchase order was made","object":"purchase_order"},{"name":"purchase_order.changed","group":"Customers and purchasing","label":"A purchase order was changed","object":"purchase_order"},{"name":"purchase_order.sent","group":"Customers and purchasing","label":"A purchase order was sent to the supplier","object":"purchase_order"},{"name":"purchase_order.cancelled","group":"Customers and purchasing","label":"A purchase order was cancelled","object":"purchase_order"},{"name":"purchase_order.received","group":"Customers and purchasing","label":"Goods were received (a receipt)","object":"goods_receipt"},{"name":"bill.posted","group":"Customers and purchasing","label":"A supplier bill was posted","object":"bill"},{"name":"supplier_payment.made","group":"Customers and purchasing","label":"A supplier was paid","object":"supplier_payment"},{"name":"supplier_return.created","group":"Customers and purchasing","label":"Goods were returned to a supplier","object":"supplier_return"},{"name":"production.started","group":"Production and CRM","label":"A production order started","object":"production_order"},{"name":"production.completed","group":"Production and CRM","label":"A production order was finished","object":"production_order"},{"name":"lead.created","group":"Production and CRM","label":"A lead was added to the pipeline","object":"lead"},{"name":"lead.converted","group":"Production and CRM","label":"A lead became a customer","object":"lead"},{"name":"ping","group":"Testing","label":"Sent by \"Send a test\" (always, whatever is picked)","object":"ping"}]}