# Create an integration

Set up a mapping for the country and invoice type you need, starting from a sample of your system's data. You need Developer portal access and a representative sandbox payload.

> **Before you start**
>
> Have a sample invoice payload from your source system ready as JSON, XML or Excel (`.xlsx`), or identify a sample already sent for mapping. Remove real customer details. An integration maps your own fields to GETS, the Complyance standard invoice format; it does not install a ready-made ERP connector.

## Step 1: Start a new integration

Open **Developer portal → Integration engine**, check the workspace and environment, then choose **New Integration**. If the list is empty, choose **Create new integration**. Read **Getting Started** and continue.

## Step 2: Choose the country and document types

At **Configuration**, choose the country where you will issue the invoice. For it, use **Select Base Types**, **Select Modifiers** and **Select Variants** to choose the documents your sample represents; modifiers and variants apply to all the base types you select. Check your choices before continuing: changing them later restarts the steps that depend on them, after a warning.

## Step 3: Prepare access and select a payload

At **Manage API keys**, create a sandbox key if your backend needs one and copy the secret when shown. See [Create an API key](https://docs.complyance.io/one-platform/developer-portal/api-keys/) for permissions, expiry and safe storage.

At **Payload Selection**, choose a sample sent by your system or choose **Upload JSON, XML, or Excel**. Choose one that includes the invoice fields and line items you intend to map. If fields you need are missing from the mapping screen, choose **Re-select Payload** and use a different sample.

You now have the country, document types and sample selected for this integration. Complete **Field Mapping**, then **Testbed**, before using the source for invoicing. A new integration is not a passed test or a production-ready invoice route.

## Build an Excel integration

Use an Excel sample when your system exports invoices as spreadsheets, or when you will upload workbooks with your own headings through **Custom template** in the Invoice Portal. The integration shows **Excel Integration** in the list.

Prepare the sample workbook like this:

- Put the column headings in row 1. Each heading must be filled in and different from the others. Each heading becomes a field you can map.
- Fill in at least one invoice row below. The first row is the sample the mapping screen shows as **Reference Value**.
- Use the same headings you will use in the workbooks you send later. A trailing `(M)`, `(CM)` or `(O)` on a heading is ignored.
- If the workbook has several sheets, the one with the most columns is used.

Upload it at **Payload Selection**, then map and test as for any integration. If the workbook has no data rows, you see `The workbook does not contain any importable rows.`

To use the integration for uploads, [link its source](https://docs.complyance.io/one-platform/developer-portal/source-management/) to it. Every workbook you upload with **Custom template** then names that source in its **Source Name** and **Source Version** columns; see [Upload invoice documents](https://docs.complyance.io/one-platform/invoice-portal/documents/upload/#workbook-columns).

## If something goes wrong

**No sample is available:** check the workspace and environment, then upload a representative sample at **Payload Selection**.

**The preview does not show an expected field:** check the sample’s structure and choose or upload a payload that contains that field. Do not guess its mapping from a different invoice.

**You cannot continue after changing the country or document types:** review the warning and repeat the dependent steps with a sample suitable for the new selection.

Next, [map your fields to GETS](https://docs.complyance.io/one-platform/developer-portal/integration-engine/gets-mapping/).

Source: https://docs.complyance.io/one-platform/developer-portal/integration-engine/create/
