---
title: "Retire or merge a mapping"
description: "Learn how to stop using a saved mapping without losing it, and how to make two mappings of one layout into one."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.certinvo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Retire or merge a mapping

A saved mapping can never be changed or deleted, because every invoice names the version that made it. When you have
saved one layout twice, or no longer use a mapping, you retire it or merge it into another. This guide shows both.

## What retiring does

- Every version of the mapping is kept. It stays on the list of saved mappings, marked **retired**, and each version is
  still readable. An invoice it made still names it, and its trace still reads it.
- No new file is read through it. When a file names no mapping, a retired one is not tried, so a layout two mappings
  read stops asking which one.
- A file that names one of its versions through the API is refused with `409 mapping_retired`. The answer names the
  mapping that holds its decisions now, when there is one.
- You can bring it back at any time. Every retirement and return is kept, with who did it, when and why.

Certinvo retires a mapping by itself only when it decides exactly what another one decides. The list then says it was
retired **by Certinvo**, and why, such as "identical to handwerk-1.0.0".

## Retire a mapping in the console

1. Open **Mappings**, under **Mapping** in the side menu. Every mapping is listed there: the drafts not yet saved
   first, then the saved mappings.
2. On the mapping's row, choose **Retire**. Certinvo says what retiring does and asks for a reason; the list shows it on
   the row. Choose **Retire** to confirm, or **Cancel** to change nothing.
3. To bring a retired mapping back, choose **Bring back**. It is not asked: it only undoes the retirement.

When two of your mappings read a file you drop on Convert, the choice also offers **Use this one, retire the other**.
That converts the file through the one you pick and retires the others in the same step.

## Merge one mapping into another

1. On the row of the mapping you no longer want, choose the other mapping under **Merge into …**.
2. Certinvo says that the mapping hands its files to the other one and asks for a reason. Choose **Merge** to confirm,
   or **Cancel** to change nothing.
3. Certinvo saves the next version of the mapping you chose. It keeps every decision of the merged mapping that does
   not contradict one of its own:
   - a field it does not fill yet;
   - another column read for one of its fields, kept as a second name of that field;
   - a column left out;
   - the name of the source system;
   - the answers given for the customer's own codes.
4. The merged mapping is retired, marked as merged into the one you chose, with your reason.

If the merged mapping adds nothing, no version is saved, and it is retired as a copy.

If the two decide a place differently, nothing is merged. The list says which places, such as a column one reads and
the other left out. Decide those places in the next version of the mapping you keep, then retire the other.

Two mappings of different file formats, such as a CSV and a JSON export of one system, are never merged. Give both the
same `system` in their card instead, and the list keeps them together, with that name under **Source**.

## Through the API

- `POST /v1/mappings/retirements` with `{name, confirmedBy}` retires a mapping; add `restore: true` to bring it back.
  `into` names the mapping that holds its decisions now, and `why` says why, in words.
- `POST /v1/mappings/merges` with `{from, into, version, confirmedBy}` merges `from` into `into`, saved as `version`,
  which must be a version of `into`. `why`, when sent, is recorded as why `from` was retired; without it, the record
  names the version it was merged into. A contradiction answers `409 merge_conflict`, naming each place.
- `GET /v1/mappings` lists each mapping with `retired` (null, or who, when, why and into what) and `system`.

## See also

- [Handle a file that no longer fits](/how-to/customer-files/handle-a-file-that-no-longer-fits)
- [Mapping card format](/reference/mapping-card-format)
- [API error codes](/reference/api-error-codes)

Source: https://docs.certinvo.com/how-to/customer-files/retire-or-merge-a-mapping/index.mdx
