> 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/reports/reasons-usage-report.md).

# Reasons usage report

Get a report of reason usage across orders for a specified time period.

```
  This report provides analytics on how reasons are being used including:
  - Discount reasons on order items
  - Return reasons on order items  
  
  The report includes usage counts and associated monetary amounts.
  
  Required permissions: REPORTING
```

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Reasons","description":"Reasons"},{"name":"Reports","description":"Reports"}],"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"}},"responses":{"ReasonsReportResponse":{"description":"Reasons report response with aggregated discount and return reason data","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReasonsReportResponseSchema"}}}}},"schemas":{"ReasonsReportResponseSchema":{"title":"ReasonsReportResponseSchema","type":"object","description":"Response schema for reasons usage report with aggregated discount and return reason data","required":["discountReasons","returnReasons"],"properties":{"discountReasons":{"type":"array","description":"Aggregated statistics for discount reasons used during the report period","items":{"$ref":"#/components/schemas/DiscountReasonStatisticSchema"}},"returnReasons":{"type":"array","description":"Aggregated statistics for return reasons used during the report period","items":{"$ref":"#/components/schemas/ReturnReasonStatisticSchema"}}}},"DiscountReasonStatisticSchema":{"title":"DiscountReasonStatisticSchema","type":"object","description":"Aggregated statistics for a discount reason code","required":["reasonCode","reasonDescription","totalAmount","percentageOfTotal","totalOccurrences"],"properties":{"reasonCode":{"type":"string","description":"The unique code identifying the discount reason"},"reasonDescription":{"type":"string","description":"The description of the discount reason"},"totalAmount":{"type":"integer","description":"Total discount amount (in minor units, e.g. cents) for this reason","minimum":0},"percentageOfTotal":{"type":"number","format":"double","description":"Percentage of total discount amount represented by this reason","minimum":0,"maximum":100},"totalOccurrences":{"type":"integer","description":"Number of times this discount reason was used","minimum":0}}},"ReturnReasonStatisticSchema":{"title":"ReturnReasonStatisticSchema","type":"object","description":"Aggregated statistics for a return reason code","required":["reasonCode","reasonDescription","totalAmount","percentageOfTotal","totalOccurrences"],"properties":{"reasonCode":{"type":"string","description":"The unique code identifying the return reason"},"reasonDescription":{"type":"string","description":"The description of the return reason"},"totalAmount":{"type":"integer","description":"Total return amount (in minor units, e.g. cents) for this reason","minimum":0},"percentageOfTotal":{"type":"number","format":"double","description":"Percentage of total return amount represented by this reason","minimum":0,"maximum":100},"totalOccurrences":{"type":"integer","description":"Number of times this return reason was used","minimum":0}}},"ReasonsReportRequestSchema":{"title":"ReasonsReportRequestSchema","type":"object","description":"Request schema for reasons usage report","required":["fromDateTime","toDateTime"],"properties":{"fromDateTime":{"type":"string","format":"date-time","description":"Start date and time for the report period"},"toDateTime":{"type":"string","format":"date-time","description":"End date and time for the report period"},"storeUid":{"$ref":"#/components/schemas/OptionalUID"}}},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"}},"requestBodies":{"ReasonsReportRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReasonsReportRequestSchema"}}}}}},"paths":{"/tenants/{tenantUid}/reports/reasons":{"post":{"summary":"Reasons usage report","tags":["Reports","Reasons"],"responses":{"200":{"$ref":"#/components/responses/ReasonsReportResponse"}},"operationId":"post-tenants-reports-reasons","description":"Get a report of reason usage across orders for a specified time period.\n      \n      This report provides analytics on how reasons are being used including:\n      - Discount reasons on order items\n      - Return reasons on order items  \n      \n      The report includes usage counts and associated monetary amounts.\n      \n      Required permissions: REPORTING","requestBody":{"$ref":"#/components/requestBodies/ReasonsReportRequest"}}}}}
```


---

# 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/reports/reasons-usage-report.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.
