# 6. Maintain your fare data

:::lead
Published fare data can't be edited. You change it by creating a new version that is valid from
the date the change applies, and you end it by setting its last effective date.
:::

## Before you begin

Make sure that:

- You have published fare data. See [4. Test and publish](/guides/fare-data/4-test-and-publish).
- You have read
  [Versions and lifecycle](/docs/partner-services/fare-data/versions-and-lifecycle).

## Change published fare data

The same steps apply to products and parameters. For example, to change a product's name or its
purchase window from a certain date:

1. Create a new version. Send the complete content. A new version doesn't inherit anything
   from earlier versions.

   ::endpoint[products-api/createSupplementProductVersion]

   The new version is a `DRAFT`. An element can have only one version in progress at a time.

2. Send it to test from the date the change applies, and test it in staging:

   `POST /v3/supplement-products/{id}/{version}/propose`

   ```json
   { "validBetween": { "fromDate": "2028-01-01" } }
   ```

3. Publish it with the same date:

   `POST /v3/supplement-products/{id}/{version}/publish`

When the new version is published, the API sets the `toDate` of the previous version to 31 December 2027, the day before the new version starts. The effective dates stay continuous:

| Version number | `fromDate` | `toDate` | Status |
| --- | --- | --- | --- |
| 1 | `2027-01-01` | `2027-12-31` | `VERSIONED` |
| 2 | `2028-01-01` | (open) | `VERSIONED` |

If the new version refers to other parameters, those parameters must be published for its effective dates first. See the
[coverage rule](/docs/partner-services/fare-data/versions-and-lifecycle#coverage-rule).

## Change a price

Create a new version of the fare table with the new price, and publish it with effective dates that start on the date the price applies. The product uses the new price from that day, without
a new version of its own.
See [Price changes](/docs/partner-services/fare-data/versions-and-lifecycle#price-changes).

## End a product

To stop a published product, set the last effective date of its latest published version with
`expire`:

`POST /v3/supplement-products/{id}/{version}/expire`

```json
{
  "toDate": "2028-12-31",
  "note": "No longer sold from 2029"
}
```

The product can be used up to and including 31 December 2028. `toDate` can't be in the past.

You can't end a parameter earlier than the published products that depend on it. End the
products first.

## Fix or discard work in progress

A version that is not published yet can be changed or thrown away:

- **Change a draft:** send the complete content with `PUT`.

  ::endpoint[products-api/updateSupplementProductVersion]

- **Change something under test:** send it back to `DRAFT` with `withdraw`, change it, and
  propose it again.

  `POST /v3/supplement-products/{id}/{version}/withdraw`

- **Discard a draft:** delete it. This needs the `slett` permission. Withdraw a version under test
  before you delete it.

  ::endpoint[products-api/deleteSupplementProductVersion]

## Changes affect other operators

:::warning
Other operators can include your products in their own sales packages, for example to sell a
supplement together with their tickets. When you change or reprice a product, the change also
applies there. Let the other operators know about changes that affect them.
:::

## Next steps

Read on:

- [Versions and lifecycle](/docs/partner-services/fare-data/versions-and-lifecycle) has
  all the rules and the most common errors.
- The API references for [products](/apis/products-api),
  [product parameters](/apis/product-parameters-api) and [pricing](/apis/pricing-api).
