---
title: "Save a mapping configuration"
description: "Mappings API"
---

> 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.

# Save a mapping configuration

{/* Generated by apps/docs/scripts/generate.ts from contracts/api/openapi.yaml. Do not edit. */}
<div class="cvo-op">
<div class="cvo-op-main">

<div class="cvo-op-header">
<div class="cvo-op-path-row">
<span class="cvo-method" data-method="post">POST</span>
<code class="cvo-op-path-code">/v1/mappings</code>
</div>
</div>

Stores a reviewed mapping config as a new, immutable version for the credential's company, and records the person who confirmed it.

A mapping config says how your own export files (CSV, Excel, your JSON or XML, SAP IDoc) become invoices.

### Where the config comes from

This route does not create the draft. A draft is produced from a customer sample file, a person reviews it, and you send the reviewed document as `config`.

The version is the config's own `version` field. Every invoice mapped with it later carries that value as `meta.mappingConfigVersion`. A draft is named `<source>-0.0.0-draft`, so rename it to the version you go live with as part of the review.

### Versions never change

A frozen config is never replaced or deleted. To change it, freeze a new version. Sending a version this company already froze returns 409 and leaves the existing version unchanged.

## Request body

`application/json`, required

## Response

A `201` answer carries these fields.

## Status codes

| Status | Meaning |
|---|---|
| `201` | The version was frozen. The body says what was frozen, who confirmed it and when. The config is now usable as the `mappingVersion` of a mapped-file `/v1/conversions` operation for this company only. |
| `400` | The request was refused and nothing was stored: - `invalid_json`: the body is not JSON. - `invalid_mapping_config`: the config does not load. `detail` names the JSON Pointer that failed and the rule it broke. - `unknown_confirming_user`: no person who may confirm for this company was named. The same code covers a missing `confirmedBy`, an unknown address, a person from another workspace, and a person without access to this company. |
| `401` | No usable credential was sent (`invalid_credentials`). The company is taken from the credential only. A company field in the body is ignored. |
| `409` | This company already froze that version (`mapping_config_exists`). The existing version is unchanged. Freeze a new version instead. |

</div>
<div class="cvo-op-aside">

</div>
</div>

Source: https://docs.certinvo.com/reference/api/mappings/save-a-mapping-configuration/index.mdx
