> For the complete documentation index, see [llms.txt](https://docs.flowretail.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flowretail.com/docs/developers/api-documentation/accounting-reports/get-one-z-report-for-a-till.md).

# Get one Z report for a till

Gets one Z report, stored or generated. The same shape either way; `source` says which.

Required permissions: TILL\_OPERATION

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"AccountingReports","description":"AccountingReports"}],"servers":[{"description":"Flow Retail Production","url":"https://api.flowretail.com/v2"},{"description":"Flow Retail Stage","url":"https://api.stage.flowretail.com/v2"}],"security":[{"accessToken":[]},{"authToken":[]},{"integrationToken":[]}],"components":{"securitySchemes":{"accessToken":{"description":"Access token recevied after user login with a deviceToken","scheme":"bearer","type":"http"},"authToken":{"description":"Token received from the auth service","scheme":"bearer","type":"http"},"integrationToken":{"scheme":"bearer","type":"http"}},"schemas":{"ZReportDetailSchema":{"title":"ZReportDetailSchema","description":"One Z report with all its figures. All amounts are in øre. receiptCopies, training and otherReductions are absent for GENERATED reports. For totalSales, returnAmount and returnCount, a GENERATED report counts each receipt as a sale or a return by the sign of its net total, while a STORED report counts each line. Every field except receiptCopies, training, otherReductions and the per-line issuer is always present. A figure the report does not have is 0 for GENERATED reports (goodsCount, servicesCount, changeAmount and the three grand totals are not calculated for them), and what is not a figure is null. `lineCorrections`, `mainGroupSales`, `discountCount`, `paymentsByOperator`, `abortedSales` and `cashMovements` are always present and never null. incompleteSales is always present: for GENERATED reports it is calculated from non-completed cash sales, for STORED reports it is stored. `abortedSales` is the number of receipts that were deleted after all their payments were cancelled and the sum of their totals in øre, counted by when the receipt was deleted, so a receipt deleted while the till is closed is on no report; it is 0 for GENERATED reports and for stored reports written before the field existed. `cashMovements` are the payments out of and into the till registered during the sessions the report covers, by type `CASH_OUT` (cash taken out, a positive registered amount) and `CASH_IN` (cash put in, a negative registered amount), each with the number and the amount in øre, always positive (for `CASH_IN` the sum of the absolute values); the bank deposit entered when a session is counted is not included; a registration that is made after the Z of its session was made is on no report; it is empty for GENERATED reports and for stored reports written before the field existed. For a LIVE report, `sequenceNumber`, `date` and `producedBy` are null, and `incompleteSales` is what is in progress now.","allOf":[{"$ref":"#/components/schemas/ZReportSummarySchema"},{"type":"object","required":["contentVersion","countryCode","companyName","organizationNumber","registerDesignation","grandTotalSeededFrom","vat","payments","mainGroups","mainGroupSales","discountCount","paymentsByOperator","priceLookups","lineCorrections","goodsCount","servicesCount","drawerOpenings","discounts","incompleteSales","abortedSales","cashMovements","changeAmount","messages"],"properties":{"contentVersion":{"type":"integer","nullable":true,"description":"How the report was written. A stored report carries the version it was written with, the live X report the current version (2). 1: `mainGroups`, `vat` and `payments` are net of returns, and `mainGroupSales`, `discountCount` and `paymentsByOperator` are empty or 0. 2: those three are sales only (returns are in `returnAmount` and `returnCount`) and the three new fields are filled. Null for GENERATED reports."},"countryCode":{"type":"string","nullable":true},"companyName":{"type":"string"},"organizationNumber":{"type":"string","nullable":true},"registerDesignation":{"type":"string","nullable":true},"grandTotalSeededFrom":{"type":"string","nullable":true,"enum":["HISTORY",null]},"vat":{"type":"array","description":"VAT per rate. Sales only; returns are in returnAmount and returnCount, from contentVersion 2 (earlier versions net returns into them).","items":{"$ref":"#/components/schemas/ZReportVatLineSchema"}},"payments":{"type":"array","description":"Payments per method and issuer. Sales only; returns are in returnAmount and returnCount, from contentVersion 2 (earlier versions net returns into them).","items":{"$ref":"#/components/schemas/ZReportPaymentLineSchema"}},"mainGroups":{"type":"array","description":"Sales per main group. Sales only; returns are in returnAmount and returnCount, from contentVersion 2 (earlier versions net returns into them).","items":{"$ref":"#/components/schemas/ZReportCountAmountNameSchema"}},"mainGroupSales":{"type":"array","description":"Sales per main group: the number of receipts with a sale line in the group, and the sales amount in øre. A receipt over two groups counts once in each. Empty for GENERATED reports and for stored reports written before contentVersion 2.","items":{"$ref":"#/components/schemas/ZReportCountAmountNameSchema"}},"discountCount":{"type":"integer","description":"Number of sold lines that carry a discount; `discounts` is the amount. 0 for GENERATED reports and for stored reports written before contentVersion 2."},"paymentsByOperator":{"type":"array","description":"Payments per operator (the user code of the settlement), payment method and issuer; same settlements and rule as `payments`. Empty for GENERATED reports and for stored reports written before contentVersion 2.","items":{"$ref":"#/components/schemas/ZReportOperatorPaymentLineSchema"}},"priceLookups":{"type":"array","description":"Always empty for stored reports today.","items":{"$ref":"#/components/schemas/ZReportCountAmountNameSchema"}},"lineCorrections":{"type":"array","description":"Line corrections by type, each with count and amount in øre. Types: DELETED, QUANTITY, PRICE, QUANTITY_AND_PRICE, and UNSPECIFIED for events from before the type existed. Always present; empty when there are none. Not calculated for GENERATED reports, which are always empty here (the old report has its own `lineCorrections` count in `ZReportResponseSchema`; that schema is unchanged).","items":{"$ref":"#/components/schemas/ZReportCountAmountNameSchema"}},"goodsCount":{"type":"integer"},"servicesCount":{"type":"integer"},"drawerOpenings":{"type":"integer"},"receiptCopies":{"$ref":"#/components/schemas/ZReportCountAmountSchema"},"training":{"$ref":"#/components/schemas/ZReportCountAmountSchema"},"discounts":{"type":"integer"},"otherReductions":{"$ref":"#/components/schemas/ZReportCountAmountSchema"},"incompleteSales":{"$ref":"#/components/schemas/ZReportCountAmountSchema"},"abortedSales":{"$ref":"#/components/schemas/ZReportCountAmountSchema"},"cashMovements":{"type":"array","items":{"$ref":"#/components/schemas/ZReportCountAmountNameSchema"}},"changeAmount":{"type":"integer"},"messages":{"type":"array","items":{"$ref":"#/components/schemas/ZReportMessageSchema"}}}}]},"ZReportSummarySchema":{"title":"ZReportSummarySchema","type":"object","description":"One Z report in a list, or the Z report a close made. A GENERATED list row has only id, tillUid, source and date set; the figures on it (counts and amounts) are 0, which for GENERATED means not calculated here, not that nothing was sold. Open the report to see them. sequenceNumber, the times and producedBy are null for it.","required":["id","tillUid","source","sequenceNumber","date","periodFrom","periodTo","producedAt","producedBy","receiptCount","totalSales","returnCount","returnAmount","grandTotalSales","grandTotalReturn","grandTotalNet"],"properties":{"id":{"type":"string","description":"Pass this to the Z report get operation. The sequence number for STORED, the date (YYYY-MM-DD) for GENERATED. For LIVE it is `x`, which only names the response of the xreport operation and is not an id the Z report get operation accepts. Treat it as opaque."},"tillUid":{"type":"string","description":"The till this Z report belongs to. Sequence numbers are per till, so this identifies the report together with `id`."},"source":{"$ref":"#/components/schemas/ZReportSourceENUM"},"sequenceNumber":{"type":"integer","nullable":true,"description":"Per till, without gaps. Null for GENERATED."},"date":{"type":"string","format":"date","nullable":true,"description":"The date a GENERATED report covers. Null for STORED."},"periodFrom":{"type":"string","format":"date-time","nullable":true},"periodTo":{"type":"string","format":"date-time","nullable":true},"producedAt":{"type":"string","format":"date-time","nullable":true},"producedBy":{"type":"string","nullable":true,"enum":["TILL_CLOSE","STORE_CASH_RECONCILIATION",null]},"receiptCount":{"type":"integer"},"totalSales":{"type":"integer"},"returnCount":{"type":"integer"},"returnAmount":{"type":"integer"},"grandTotalSales":{"type":"integer"},"grandTotalReturn":{"type":"integer"},"grandTotalNet":{"type":"integer"}}},"ZReportSourceENUM":{"type":"string","enum":["STORED","GENERATED","LIVE"],"description":"STORED is a Z report made when a till was closed after stored Z reports were switched on.\nGENERATED is calculated on request for a date before that, or when stored Z reports are off.\nLIVE is an X report: everything the till has sold since its last stored Z report, calculated on request and never stored."},"ZReportVatLineSchema":{"title":"ZReportVatLineSchema","type":"object","required":["rate","name","amount","vat"],"properties":{"rate":{"type":"integer","nullable":true,"description":"Hundredths of a percent, 2500 = 25 %. Null for GENERATED."},"name":{"type":"string","nullable":true,"description":"The VAT code name. Set for GENERATED only."},"amount":{"type":"integer","description":"The sales amount including VAT for this rate, in øre."},"vat":{"type":"integer","nullable":true,"description":"The VAT amount in øre."}}},"ZReportPaymentLineSchema":{"title":"ZReportPaymentLineSchema","type":"object","required":["method","count","amount"],"properties":{"method":{"type":"string"},"issuer":{"type":"string"},"count":{"type":"integer"},"amount":{"type":"integer","description":"Amount in øre."}}},"ZReportCountAmountNameSchema":{"properties":{"amount":{"type":"integer"},"count":{"type":"integer"},"name":{"type":"string"}},"required":["name","count","amount"],"title":"ZReportCountAmountNameSchema","type":"object"},"ZReportOperatorPaymentLineSchema":{"title":"ZReportOperatorPaymentLineSchema","type":"object","required":["operator","method","count","amount"],"properties":{"operator":{"type":"string","description":"User code of the user on the settlement; empty when the user has none."},"method":{"type":"string"},"issuer":{"type":"string"},"count":{"type":"integer"},"amount":{"type":"integer","description":"Amount in øre."}}},"ZReportCountAmountSchema":{"properties":{"amount":{"type":"integer"},"count":{"type":"integer"}},"required":["count","amount"],"title":"ZReportCountAmountSchema","type":"object"},"ZReportMessageSchema":{"title":"ZReportMessageSchema","type":"object","required":["code","severity","text","orders"],"properties":{"code":{"type":"string"},"severity":{"type":"string","enum":["INFO","WARNING"]},"text":{"type":"string"},"orders":{"type":"array","items":{"$ref":"#/components/schemas/ZReportMessageOrderSchema"}}}},"ZReportMessageOrderSchema":{"title":"ZReportMessageOrderSchema","type":"object","required":["orderUid","orderNumber"],"properties":{"orderUid":{"type":"string"},"orderNumber":{"type":"string"}}}},"responses":{"GenericErrorResponse":{"content":{"application/json":{"schema":{"properties":{"code":{"type":"string","description":"Error code. The codes a POS app acts on are listed in DeviceErrorCodeENUM."},"message":{"type":"string","description":"Error message in the locale you specify in the Accept-Language header or specified on the user"},"logId":{"type":"string","description":"Log identification. Can be used when reporting errors to Flow Solutions"}},"type":"object"}}},"description":"Linking failed. Ther error message will have information about what failed."}}},"paths":{"/tenants/{tenantUid}/stores/{storeUid}/tills/{tillUid}/zreports/{zreportId}":{"get":{"description":"Gets one Z report, stored or generated. The same shape either way; `source` says which.\n\nRequired permissions: TILL_OPERATION","operationId":"get-tenants-stores-tills-zreports-by-id","responses":{"200":{"description":"The Z report.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZReportDetailSchema"}}}},"400":{"$ref":"#/components/responses/GenericErrorResponse"},"404":{"$ref":"#/components/responses/GenericErrorResponse"}},"summary":"Get one Z report for a till","tags":["AccountingReports"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flowretail.com/docs/developers/api-documentation/accounting-reports/get-one-z-report-for-a-till.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
