# Compensation

Compensation

## List compensations

> List compensations

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Compensation","description":"Compensation"}],"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":{"CompensationListResponse":{"description":"Example response","content":{"application/json":{"schema":{"type":"object","required":["items","paging"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CompensationResponseSchema"}},"paging":{"$ref":"#/components/schemas/Paging"}}}}}}},"schemas":{"CompensationResponseSchema":{"title":"CompensationResponseSchema","type":"object","required":["name","code","compensationUid"],"properties":{"name":{"type":"string"},"code":{"type":"string"},"compensationUid":{"$ref":"#/components/schemas/UID"}}},"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"},"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"}},"parameters":{"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"}}},"paths":{"/tenants/{tenantUid}/compensations":{"get":{"summary":"List compensations","tags":["Compensation"],"responses":{"200":{"$ref":"#/components/responses/CompensationListResponse"}},"operationId":"get-tenant-compensations","description":"List compensations","parameters":[{"$ref":"#/components/parameters/pageNumberQuery"},{"$ref":"#/components/parameters/pageSizeQuery"},{"$ref":"#/components/parameters/sortByQuery"},{"$ref":"#/components/parameters/sortDirectionQuery"}]}}}}
```

## Add new Compensation

> Add new Compensation\
> \
> Required permissions: COMPENSATION

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Compensation","description":"Compensation"}],"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":{"CompensationResponse":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompensationResponseSchema"}}}}},"schemas":{"CompensationResponseSchema":{"title":"CompensationResponseSchema","type":"object","required":["name","code","compensationUid"],"properties":{"name":{"type":"string"},"code":{"type":"string"},"compensationUid":{"$ref":"#/components/schemas/UID"}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"CompensationCreateRequestSchema":{"title":"CompensationCreateRequestSchema","type":"object","required":["name","code"],"properties":{"name":{"type":"string"},"code":{"type":"string"},"compensationUid":{"$ref":"#/components/schemas/UID"}}}},"requestBodies":{"CompensationCreateRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompensationCreateRequestSchema"}}}}}},"paths":{"/tenants/{tenantUid}/compensations":{"post":{"summary":"Add new Compensation","tags":["Compensation"],"responses":{"201":{"$ref":"#/components/responses/CompensationResponse"}},"operationId":"post-tenant-compensation","description":"Add new Compensation\n\nRequired permissions: COMPENSATION","requestBody":{"$ref":"#/components/requestBodies/CompensationCreateRequest"}}}}}
```

## Get compensation details

> Get compensation details

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Compensation","description":"Compensation"}],"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":{"CompensationResponse":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompensationResponseSchema"}}}}},"schemas":{"CompensationResponseSchema":{"title":"CompensationResponseSchema","type":"object","required":["name","code","compensationUid"],"properties":{"name":{"type":"string"},"code":{"type":"string"},"compensationUid":{"$ref":"#/components/schemas/UID"}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"}}},"paths":{"/tenants/{tenantUid}/compensations/{compensationUid}":{"get":{"summary":"Get compensation details","tags":["Compensation"],"responses":{"200":{"$ref":"#/components/responses/CompensationResponse"}},"operationId":"get-tenant-compensation","description":"Get compensation details","parameters":[]}}}}
```

## Update compensation details

> Update compensation details\
> \
> Required permissions: COMPENSATION

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Compensation","description":"Compensation"}],"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":{"CompensationResponse":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompensationResponseSchema"}}}}},"schemas":{"CompensationResponseSchema":{"title":"CompensationResponseSchema","type":"object","required":["name","code","compensationUid"],"properties":{"name":{"type":"string"},"code":{"type":"string"},"compensationUid":{"$ref":"#/components/schemas/UID"}}},"UID":{"title":"UID","type":"string","pattern":"^[A-Za-z0-9-_]+"},"CompensationUpdateRequestSchema":{"title":"CompensationUpdateRequestSchema","type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"RequireReferringOrderLines":{"type":"boolean","description":"When an order is marked with a compensation with this field set to true, the order must have order lines referring to a settled sale"}}}},"requestBodies":{"CompensationUpdateRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompensationUpdateRequestSchema"}}}}}},"paths":{"/tenants/{tenantUid}/compensations/{compensationUid}":{"put":{"summary":"Update compensation details","tags":["Compensation"],"responses":{"200":{"$ref":"#/components/responses/CompensationResponse"}},"operationId":"put-tenant-compensation","description":"Update compensation details\n\nRequired permissions: COMPENSATION","requestBody":{"$ref":"#/components/requestBodies/CompensationUpdateRequest"}}}}}
```

## Delete a compensation

> Delete a compensation\
> \
> Required permissions: COMPENSATION

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Compensation","description":"Compensation"}],"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"}}},"paths":{"/tenants/{tenantUid}/compensations/{compensationUid}":{"delete":{"summary":"Delete a compensation","tags":["Compensation"],"responses":{"204":{"description":"No Content"}},"operationId":"delete-tenant-compensation","description":"Delete a compensation\n\nRequired permissions: COMPENSATION"}}}}
```

## List Compensation reasons

> List Compensation reasons

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Compensation","description":"Compensation"}],"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":{"CompensationReasonListResponse":{"description":"Example response","content":{"application/json":{"schema":{"type":"object","required":["items","paging"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/CompensationReasonResponseSchema"}},"paging":{"$ref":"#/components/schemas/Paging"}}}}}}},"schemas":{"CompensationReasonResponseSchema":{"title":"CompensationReasonResponseSchema","type":"object","description":"productUid refers to the product that is added to an order when this compensation reason is added to the order.\nlimit is the amount of total compensations on an order. Returns a warning if limit is exceeded.\n","required":["reason","code","productUid","limit","requireDocumentation","compensationReasonUid"],"properties":{"reason":{"type":"string"},"code":{"type":"string"},"productUid":{"$ref":"#/components/schemas/OptionalUID"},"limit":{"type":"integer"},"requireDocumentation":{"type":"boolean"},"compensationReasonUid":{"type":"string"}}},"OptionalUID":{"title":"OptionalUID","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"},"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"}},"parameters":{"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"}}},"paths":{"/tenants/{tenantUid}/compensations/{compensationUid}/reasons":{"get":{"summary":"List Compensation reasons","tags":["Compensation"],"responses":{"200":{"$ref":"#/components/responses/CompensationReasonListResponse"}},"operationId":"get-tenant-compensation-reasons","parameters":[{"$ref":"#/components/parameters/pageNumberQuery"},{"$ref":"#/components/parameters/pageSizeQuery"},{"$ref":"#/components/parameters/sortByQuery"},{"$ref":"#/components/parameters/sortDirectionQuery"}],"description":"List Compensation reasons"}}}}
```

## Add a compensation reason

> Add a compensation reason\
> \
> Required permissions: COMPENSATION

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Compensation","description":"Compensation"}],"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":{"CompensationReasonResponse":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompensationReasonResponseSchema"}}}}},"schemas":{"CompensationReasonResponseSchema":{"title":"CompensationReasonResponseSchema","type":"object","description":"productUid refers to the product that is added to an order when this compensation reason is added to the order.\nlimit is the amount of total compensations on an order. Returns a warning if limit is exceeded.\n","required":["reason","code","productUid","limit","requireDocumentation","compensationReasonUid"],"properties":{"reason":{"type":"string"},"code":{"type":"string"},"productUid":{"$ref":"#/components/schemas/OptionalUID"},"limit":{"type":"integer"},"requireDocumentation":{"type":"boolean"},"compensationReasonUid":{"type":"string"}}},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"CompensationReasonCreateRequestSchema":{"title":"CompensationReasonCreateRequestSchema","type":"object","description":"productUid refers to the product that is added to an order when this compensation reason is added to the order.\nlimit is the amount of total compensations on an order. Returns a warning if limit is exceeded.\n","required":["reason","code","productUid","limit","requireDocumentation"],"properties":{"reason":{"type":"string"},"code":{"type":"string"},"productUid":{"$ref":"#/components/schemas/OptionalUID"},"limit":{"type":"integer"},"requireDocumentation":{"type":"boolean"},"compensationReasonUid":{"type":"string"}}}},"requestBodies":{"CompensationReasonCreateRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompensationReasonCreateRequestSchema"}}}}}},"paths":{"/tenants/{tenantUid}/compensations/{compensationUid}/reasons":{"post":{"summary":"Add a compensation reason","tags":["Compensation"],"responses":{"201":{"$ref":"#/components/responses/CompensationReasonResponse"}},"operationId":"post-tenant-compensation-reason","description":"Add a compensation reason\n\nRequired permissions: COMPENSATION","requestBody":{"$ref":"#/components/requestBodies/CompensationReasonCreateRequest"}}}}}
```

## Get Compensation reason details

> Get Compensation reason details

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Compensation","description":"Compensation"}],"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":{"CompensationReasonResponse":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompensationReasonResponseSchema"}}}}},"schemas":{"CompensationReasonResponseSchema":{"title":"CompensationReasonResponseSchema","type":"object","description":"productUid refers to the product that is added to an order when this compensation reason is added to the order.\nlimit is the amount of total compensations on an order. Returns a warning if limit is exceeded.\n","required":["reason","code","productUid","limit","requireDocumentation","compensationReasonUid"],"properties":{"reason":{"type":"string"},"code":{"type":"string"},"productUid":{"$ref":"#/components/schemas/OptionalUID"},"limit":{"type":"integer"},"requireDocumentation":{"type":"boolean"},"compensationReasonUid":{"type":"string"}}},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"}}},"paths":{"/tenants/{tenantUid}/compensations/{compensationUid}/reasons/{compensationReasonUid}":{"get":{"summary":"Get Compensation reason details","tags":["Compensation"],"responses":{"200":{"$ref":"#/components/responses/CompensationReasonResponse"}},"operationId":"get-tenant-compensation-reason","parameters":[],"description":"Get Compensation reason details"}}}}
```

## Update compensation reason details

> Update compensation reason details\
> \
> Required permissions: COMPENSATION

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Compensation","description":"Compensation"}],"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":{"CompensationReasonResponse":{"description":"Example response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompensationReasonResponseSchema"}}}}},"schemas":{"CompensationReasonResponseSchema":{"title":"CompensationReasonResponseSchema","type":"object","description":"productUid refers to the product that is added to an order when this compensation reason is added to the order.\nlimit is the amount of total compensations on an order. Returns a warning if limit is exceeded.\n","required":["reason","code","productUid","limit","requireDocumentation","compensationReasonUid"],"properties":{"reason":{"type":"string"},"code":{"type":"string"},"productUid":{"$ref":"#/components/schemas/OptionalUID"},"limit":{"type":"integer"},"requireDocumentation":{"type":"boolean"},"compensationReasonUid":{"type":"string"}}},"OptionalUID":{"title":"OptionalUID","type":"string","pattern":"^[A-Za-z0-9-_]*"},"CompensationReasonUpdateRequestSchema":{"title":"CompensationReasonUpdateRequestSchema","type":"object","description":"productUid refers to the product that is added to an order when this compensation reason is added to the order.\nlimit is the amount of total compensations on an order. Returns a warning if limit is exceeded.\n","properties":{"reason":{"type":"string"},"code":{"type":"string"},"productUid":{"$ref":"#/components/schemas/OptionalUID"},"limit":{"type":"integer"},"requireDocumentation":{"type":"boolean"}}}},"requestBodies":{"CompensationReasonUpdateRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompensationReasonUpdateRequestSchema"}}}}}},"paths":{"/tenants/{tenantUid}/compensations/{compensationUid}/reasons/{compensationReasonUid}":{"put":{"summary":"Update compensation reason details","tags":["Compensation"],"responses":{"201":{"$ref":"#/components/responses/CompensationReasonResponse"}},"operationId":"put-tenant-compensation-reason","description":"Update compensation reason details\n\nRequired permissions: COMPENSATION","requestBody":{"$ref":"#/components/requestBodies/CompensationReasonUpdateRequest"}}}}}
```

## DELETE /tenants/{tenantUid}/compensations/{compensationUid}/reasons/{compensationReasonUid}

> Delete a Compensation reason\
> &#x20;   \
> Required permissions: COMPENSATION

```json
{"openapi":"3.0.2","info":{"title":"Flow Retail API version 2","version":"2.0.0"},"tags":[{"name":"Compensation","description":"Compensation"}],"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"}}},"paths":{"/tenants/{tenantUid}/compensations/{compensationUid}/reasons/{compensationReasonUid}":{"delete":{"tags":["Compensation"],"responses":{"204":{"description":"No Content"}},"operationId":"delete-tenant-compensation-reason","description":"Delete a Compensation reason\n    \nRequired permissions: COMPENSATION"}}}}
```
