# Reasons

Reasons

## List reasons

> List all reasons.

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Reasons","description":"Reasons"}],"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":"Accesstoken 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"}},"parameters":{"reasonTypeQuery":{"description":"Reference to a reason Type.","in":"query","name":"reasonType","required":false,"schema":{"$ref":"#/components/schemas/ReasonTypeENUM"}},"pageNumberQuery":{"description":"Reference to a specific page in a result set.","in":"query","name":"pageNumber","required":false,"schema":{"type":"integer"}},"pageSizeQuery":{"description":"The number of items per page in a result set.","in":"query","name":"pageSize","required":false,"schema":{"type":"integer"}},"sortByQuery":{"description":"Defines which field the resource list is sorted by.","in":"query","name":"sortBy","required":false,"schema":{"type":"string"}},"sortDirectionQuery":{"description":"Reference to a sort direction","explode":false,"in":"query","name":"sortDirection","schema":{"$ref":"#/components/schemas/SortDirectionENUM"},"style":"form"}},"schemas":{"ReasonTypeENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| DISCOUNT | Reason for discounts|\n| RETURN | Reason for returns|\n| RMA | Reason for return to supplier|","enum":["DISCOUNT","RETURN","RMA"],"title":"ReasonTypeENUM","type":"string"},"SortDirectionENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| ASC | Sort in ascending order|\n| DESC | Sort in descending order|\n","enum":["ASC","DESC"],"title":"SortDirectionENUM","type":"string"},"ReasonResponseSchema":{"properties":{"code":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"description":{"type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"reasonUid":{"$ref":"#/components/schemas/UID"},"type":{"$ref":"#/components/schemas/ReasonTypeENUM"}},"required":["reasonUid","type","code","description"],"title":"ReasonResponseSchema","type":"object"},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"Paging":{"description":"totalCount The total number of items in the result set.\n\npageSize The number of items per page.\n\npageNumber The current page in the result set.","properties":{"pageNumber":{"type":"integer"},"pageSize":{"type":"integer"},"totalCount":{"type":"integer"}},"required":["totalCount","pageSize","pageNumber"],"title":"Paging","type":"object"}},"responses":{"ReasonListResponse":{"content":{"application/json":{"schema":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ReasonResponseSchema"},"type":"array"},"paging":{"$ref":"#/components/schemas/Paging"}},"required":["items","paging"],"type":"object"}}},"description":"Reason list response"}}},"paths":{"/tenants/{tenantUid}/reasons":{"get":{"description":"List all reasons.","operationId":"get-tenants-reasons","parameters":[{"$ref":"#/components/parameters/reasonTypeQuery"},{"$ref":"#/components/parameters/pageNumberQuery"},{"$ref":"#/components/parameters/pageSizeQuery"},{"$ref":"#/components/parameters/sortByQuery"},{"$ref":"#/components/parameters/sortDirectionQuery"}],"responses":{"200":{"$ref":"#/components/responses/ReasonListResponse"}},"summary":"List reasons","tags":["Reasons"]}}}}
```

## Create new reason

> Create new reason

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Reasons","description":"Reasons"}],"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":"Accesstoken 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"}},"requestBodies":{"ReasonCreateRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReasonCreateRequestSchema"}}}}},"schemas":{"ReasonCreateRequestSchema":{"type":"object","properties":{"code":{"type":"string"},"description":{"type":"string"},"type":{"$ref":"#/components/schemas/ReasonTypeENUM"},"reasonUid":{"$ref":"#/components/schemas/UID"}},"required":["code","description","type"],"title":"ReasonCreateRequestSchema"},"ReasonTypeENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| DISCOUNT | Reason for discounts|\n| RETURN | Reason for returns|\n| RMA | Reason for return to supplier|","enum":["DISCOUNT","RETURN","RMA"],"title":"ReasonTypeENUM","type":"string"},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"ReasonResponseSchema":{"properties":{"code":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"description":{"type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"reasonUid":{"$ref":"#/components/schemas/UID"},"type":{"$ref":"#/components/schemas/ReasonTypeENUM"}},"required":["reasonUid","type","code","description"],"title":"ReasonResponseSchema","type":"object"}},"responses":{"ReasonResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReasonResponseSchema"}}},"description":"Reason response"}}},"paths":{"/tenants/{tenantUid}/reasons":{"post":{"description":"Create new reason","operationId":"post-tenants-reasons","parameters":[],"requestBody":{"$ref":"#/components/requestBodies/ReasonCreateRequest"},"responses":{"200":{"$ref":"#/components/responses/ReasonResponse"}},"summary":"Create new reason","tags":["Reasons"]}}}}
```

## Get reason details

> Get details for the reason.

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Reasons","description":"Reasons"}],"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":"Accesstoken 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":{"ReasonResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReasonResponseSchema"}}},"description":"Reason response"}},"schemas":{"ReasonResponseSchema":{"properties":{"code":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"description":{"type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"reasonUid":{"$ref":"#/components/schemas/UID"},"type":{"$ref":"#/components/schemas/ReasonTypeENUM"}},"required":["reasonUid","type","code","description"],"title":"ReasonResponseSchema","type":"object"},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"ReasonTypeENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| DISCOUNT | Reason for discounts|\n| RETURN | Reason for returns|\n| RMA | Reason for return to supplier|","enum":["DISCOUNT","RETURN","RMA"],"title":"ReasonTypeENUM","type":"string"}}},"paths":{"/tenants/{tenantUid}/reasons/{reasonUid}":{"get":{"description":"Get details for the reason.","operationId":"get-tenants-reasons-details","responses":{"200":{"$ref":"#/components/responses/ReasonResponse"}},"summary":"Get reason details","tags":["Reasons"]}}}}
```

## Update reason details

> Update details of the reason.

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Reasons","description":"Reasons"}],"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":"Accesstoken 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"}},"requestBodies":{"ReasonUpdateRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReasonUpdateRequestSchema"}}}}},"schemas":{"ReasonUpdateRequestSchema":{"title":"ReasonUpdateRequestSchema","type":"object","properties":{"code":{"type":"string"},"description":{"type":"string"}}},"ReasonResponseSchema":{"properties":{"code":{"type":"string"},"createdAt":{"format":"date-time","type":"string"},"description":{"type":"string"},"lastModifiedAt":{"format":"date-time","type":"string"},"reasonUid":{"$ref":"#/components/schemas/UID"},"type":{"$ref":"#/components/schemas/ReasonTypeENUM"}},"required":["reasonUid","type","code","description"],"title":"ReasonResponseSchema","type":"object"},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"ReasonTypeENUM":{"description":"|ENUM      | Description |\n| ---------------- | ------------ |\n| DISCOUNT | Reason for discounts|\n| RETURN | Reason for returns|\n| RMA | Reason for return to supplier|","enum":["DISCOUNT","RETURN","RMA"],"title":"ReasonTypeENUM","type":"string"}},"responses":{"ReasonResponse":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReasonResponseSchema"}}},"description":"Reason response"}}},"paths":{"/tenants/{tenantUid}/reasons/{reasonUid}":{"put":{"description":"Update details of the reason.","operationId":"put-tenants-reasons-details","requestBody":{"$ref":"#/components/requestBodies/ReasonUpdateRequest"},"responses":{"200":{"$ref":"#/components/responses/ReasonResponse"}},"summary":"Update reason details","tags":["Reasons"]}}}}
```

## Delete a reason

> Delete a reason.

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Reasons","description":"Reasons"}],"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":"Accesstoken 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"}}},"paths":{"/tenants/{tenantUid}/reasons/{reasonUid}":{"delete":{"description":"Delete a reason.","operationId":"delete-tenants-reasons-details","responses":{"204":{"description":"No Content"}},"summary":"Delete a reason","tags":["Reasons"]}}}}
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.flowretail.com/docs/developers/api-documentation/reasons.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
