## Replace the tenant's price calculation scale (tenant:settings:write)

`PUT /api/masterdata/price-tiers`

Module: Master data · operationId: `savePriceTiers` · Tag: Settings · Auth: access token (`Authorization: Bearer <accessToken>`)

Replaces the scale as a whole. At least one row; the first starts at `fromCost` 0, `fromCost`
rises strictly from row to row (4 decimals), `markupRate` is 0–1000, at most 50 rows. Invalid rows
answer `400` with field keys like `priceTiers[1].fromCost`.

### Request body

`application/json` (required)

- `priceTiers` (array of PriceTier, required): Rows ordered by `fromCost`
  - `fromCost` (number, required): Purchase price from which the row applies (inclusive, net, base currency); the first row is 0
  - `markupRate` (number, required): Markup in percent of the purchase price (max 1000)
  - `rounding` (string, required): `NONE` rounds half up to cents; `UP_x` rounds up to the next multiple of x (0.05, 0.10, 0.50, 1, 5, 10); `END_90`/`END_99` take the smallest price ending in .90/.99 that is not below the value. (one of `NONE`, `UP_0_05`, `UP_0_10`, `UP_0_50`, `UP_1`, `UP_5`, `UP_10`, `END_90`, `END_99`)

Example:

```json
{
  "priceTiers": [
    {
      "fromCost": 0,
      "markupRate": 35,
      "rounding": "END_99"
    },
    {
      "fromCost": 500,
      "markupRate": 25,
      "rounding": "END_99"
    },
    {
      "fromCost": 2000,
      "markupRate": 15,
      "rounding": "UP_10"
    }
  ]
}
```

### Responses

- **200** Saved (`application/json`)
- **400** Malformed body or query parameter (`application/json`)
- **401** Missing, invalid or expired token (empty body)
- **403** The token lacks the permission or carries no tenant (`application/json`)

Fields of the 200 answer:

- `priceTiers` (array of PriceTier, required): Rows ordered by `fromCost`
  - `fromCost` (number, required): Purchase price from which the row applies (inclusive, net, base currency); the first row is 0
  - `markupRate` (number, required): Markup in percent of the purchase price (max 1000)
  - `rounding` (string, required): `NONE` rounds half up to cents; `UP_x` rounds up to the next multiple of x (0.05, 0.10, 0.50, 1, 5, 10); `END_90`/`END_99` take the smallest price ending in .90/.99 that is not below the value. (one of `NONE`, `UP_0_05`, `UP_0_10`, `UP_0_50`, `UP_1`, `UP_5`, `UP_10`, `END_90`, `END_99`)

Example 200 answer:

```json
{
  "priceTiers": [
    {
      "fromCost": 0,
      "markupRate": 35,
      "rounding": "END_99"
    },
    {
      "fromCost": 500,
      "markupRate": 25,
      "rounding": "END_99"
    },
    {
      "fromCost": 2000,
      "markupRate": 15,
      "rounding": "UP_10"
    }
  ]
}
```

### Example request

```bash
curl -X PUT 'https://api.mbcom.cloud/api/masterdata/price-tiers' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H 'Content-Type: application/json' \
  --data '{"priceTiers":[{"fromCost":0,"markupRate":35,"rounding":"END_99"},{"fromCost":500,"markupRate":25,"rounding":"END_99"},{"fromCost":2000,"markupRate":15,"rounding":"UP_10"}]}'
```
