# Turnover

## Returns all retail turnovers

<mark style="color:blue;">`GET`</mark> `https://www.moderan.net/api/domains/DOMAIN_ID/propertysets/0/retailturnovers?startDate=2023-10-01&endDate=2023-10-31`

#### Path Parameters

| Name                                         | Type   | Description           |
| -------------------------------------------- | ------ | --------------------- |
| DOMAIN\_ID<mark style="color:red;">\*</mark> | String | Domain ID of customer |

#### Query Parameters

| Name                                        | Type   | Description                              |
| ------------------------------------------- | ------ | ---------------------------------------- |
| startDate<mark style="color:red;">\*</mark> | String | Start time of period (format DD.MM.YYYY) |
| endDate<mark style="color:red;">\*</mark>   | String | End time of period (format DD.MM.YYYY)   |

## Creates a new turnover entry

<mark style="color:green;">`POST`</mark> `https://www.moderan.net/api/domains/DOMAIN_ID/propertysets/0/retailturnovers`

### Example payload for POST

```
{
   "turnoverRentMonth":"2023-10-19",
   "shopName":"Pineapple",
   "property":{
      "id":2488,
      "name":"Mänd"
   },
   "turnoverRentAmount":44,
   "tenant":{
      "id":12358,
      "name":"Ananass"
   }
}
```

## Updates a turnover entry

<mark style="color:orange;">`PUT`</mark> `https://www.moderan.net/api/domains/DOMAIN_ID/propertysets/0/retailturnovers/TURNOVER_ID`

#### Path Parameters

| Name         | Type   | Description            |
| ------------ | ------ | ---------------------- |
| DOMAINID     | String | Domain ID of customer  |
| TURNOVER\_ID | String | ID of updated turnover |

### Example of payload for PUT

```
{
   "shopName":"Raspberry",
   "id":174,
   "property":{
      "id":2488,
      "name":"Mänd"
   },
   "tenant":{
      "id":12239,
      "name":"Vaarikas"
   },
   "turnoverRentMonth":"2023-10-15",
   "turnoverRentAmount":14452,
}
```
