---
title: "Preview a mapping"
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.

# Preview a mapping

{/* 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/previews</code>
</div>
</div>

Runs one record through a draft mapping config and shows the invoice it produces. Use it to review a config before you freeze it. Send the draft config itself, not a stored version. It is checked the same way as when you freeze it, so a refusal here is the same refusal you would get later. Nothing is stored. Without `check`, nothing is validated either: a previewed invoice is then only well-formed. With `check: true`, a complete invoice is also validated under your validation policy, as a real invoice of yours would be, and the answer carries `policies`. `invoice: null` together with named errors is a normal preview result, not a failure.

## Request body

`application/json`, required

## Status codes

| Status | Meaning |
|---|---|
| `200` | `{invoice, partial, errors, review, peppol}`, with `fromSettings` and `policies` when they apply: - `invoice`: the canonical invoice, or null when anything is wrong. `errors` then names each problem. - `partial`: what the record produced so far, even when there are errors. It is for display next to the errors only. It is not an invoice and is never validated or stored. - `review`: the unknown codes that need a person to confirm them. - `peppol`: when your validation policy makes Peppol files, each code in `partial` that Peppol BIS refuses although the XRechnung lists accept it, as `{bt, target, code, lists}`. Otherwise null. It is a warning: nothing else in the answer changes, and the XRechnung files are made as before. - `fromSettings`: the seller fields filled from the company's seller details because the card does not write them, as `{to, value}`, when its `useOnInvoices` is ticked. Absent when none was. - `policies`: only with `check: true`. `{checked: false, why}` when nothing was validated: `incomplete` while `invoice` is null, `unavailable` when the validator could not run. Otherwise `{checked: true, verdict, runs, findings, notApplicable, refused}`: the validator's verdict under your policy, each run as `{rulebook, strength, rendering, verdict}`, and each rule finding once as `{rule, severity, text, rulebooks, decides, terms, fields}`. `terms` are the business terms the rule names and `fields` the mapping fields they name, such as `/buyerReference` for BT-10. `notApplicable` and `refused` are as in the check report. The preview runs the same code as a frozen mapping. |
| `400` | The config does not load (`invalid_mapping_config`). Freezing it would fail the same way. |
| `401` | No usable credential was sent (`invalid_credentials`). |

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

</div>
</div>

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