> For the complete documentation index, see [llms.txt](https://docs.concedus.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.concedus.com/import-process/send-data-sets/send-contract-record.md).

# Send Contract Record

After a customer signs a new contract, send the contract data set to Concedus to start the import process. The format and structure of the contract data is documented under [Data Format](#data-format). If the customer is not yet registered, he first has to complete the verification process. If the customer is already registered / after the verification is completed, we send you the result of the import request in the form of a compliance record. Depending on the result, you can take further action.

<figure><img src="/files/8xfVAiPtkssyhZLXm1sr" alt=""><figcaption><p>Contract import process</p></figcaption></figure>

## API Method

The transfer of contract records is based on the transfer of customer records. The only difference here is the JSON content and the endpoint. The customer is always assigned to a contract. If the customer has already been transferred in advance, only the customer key and the person key including modified are required in the customer object.

{% hint style="info" %}
In the Demo-Environment the product "TestAnleihe" is activated by default. Please use this only.
{% endhint %}

## Import contract

<mark style="color:green;">`POST`</mark> `https://demo2.api.concedus.com/v2/compliance/contracts`

#### Headers

| Name                                            | Type   | Description                         |
| ----------------------------------------------- | ------ | ----------------------------------- |
| Content-Type<mark style="color:red;">\*</mark>  | String | application/zip or application/json |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer `token`                      |

#### Request Body

| Name                                        | Type | Description                            |
| ------------------------------------------- | ---- | -------------------------------------- |
| contracts<mark style="color:red;">\*</mark> | json | See: [JSON structure](#json-structure) |
| attachments                                 | pdf  | Contract pdf                           |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
  "identLinks": []
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
  "code": "400",
  "info": "Illegal JSON content",
  "reason": "<individual Error description>"
}
```

{% endtab %}

{% tab title="401: Unauthorized " %}

```javascript
{
  "code": "401",
  "info": "Unauthorized",
  "reason": "Bearer not verified"
}
```

{% endtab %}
{% endtabs %}

## Data Format

* **ZIP** must be sent if attachments are to be transferred as well. (default)
* **JSON** is transmitted when no other attachments are transmitted in file form.

{% hint style="info" %}
Most products require a contract as PDF file, please ask our legal department if you are not sure if you don't need such a contract)
{% endhint %}

{% hint style="warning" %}
Only use valid filenames. Do not use special characters including "/".
{% endhint %}

<details>

<summary>Contract example</summary>

Customer already exists

```json
{
    "contracts": [
        {
            "product": "TestAnleihe",
            "agio": 0.0,
            "agioDiscountAf": 0.0,
            "share": 6634,
            "origin": "V",
            "signed": "2022-04-04",
            "units": 322,
            "interestRate": 0.0,
            "customer": {
                "person": {
                    "key": "PERS_9399d213-7adf-4817-b7b5-5ef47637ac33",
                    "modified": "2023-03-27T16:25:01"
                },
                "key": "CUSTO_8f77a80f-5f4f-4682-81e2-39210a1a612a",
                "modified": "2023-03-27T16:25:01"
            },
            "events": [
                {
                    "date": "2023-03-23",
                    "subject": "Zeichnugsschein",
                    "category": "Zeichnungsschein",
                    "file": "contract0.pdf",
                    "public": true,
                    "key": "ATT_c1bb8442-9609-42d5-8a85-75f8ec68886c",
                    "modified": "2023-03-27T16:25:01"
                }
            ],
            "key": "CONTR_9cabef57-1250-44b7-9184-c17eed80b523",
            "modified": "2023-03-27T16:25:01"
        }
    ]
}
```

</details>

### JSON structure

#### Contract

<table><thead><tr><th>Field</th><th>Type</th><th>Requirement</th><th>Description</th></tr></thead><tbody><tr><td><pre><code>product
</code></pre></td><td>string</td><td>required</td><td>"TestAnleihe" (predefined)</td></tr><tr><td><pre><code>agio
</code></pre></td><td>number</td><td>optional</td><td>Surcharge/fee that the customer must pay on top of the nominal price (not obligatory)</td></tr><tr><td><pre><code>agioDiscountAf
</code></pre></td><td>number</td><td>optional</td><td>Discount that the customer receives on the nominal price (not obligatory)</td></tr><tr><td><pre><code>share
</code></pre></td><td>number</td><td>required</td><td>Nominal value or share of the financial instrument always in EUR without the agio. This is the price of the contracts value and needs to match with the sum on the contract</td></tr><tr><td><pre><code>origin
</code></pre></td><td>string</td><td>required</td><td><p>"P": primary market </p><p>"V": secondary market</p></td></tr><tr><td><pre><code>signed
</code></pre></td><td>string</td><td>required</td><td>DateTime when the contract is signed</td></tr><tr><td><pre><code>units
</code></pre></td><td>number</td><td>optional</td><td>The number of shares or amount of shares</td></tr><tr><td><pre><code>interestRate
</code></pre></td><td>number</td><td>optional</td><td>The interest of the financial instrument</td></tr><tr><td><pre><code>customer
</code></pre></td><td>object</td><td>required</td><td><p>If customer is new, all data required (like <a href="/pages/ciQSNbu2QhpDTV6NOm4q#customers">customer</a>) </p><p>If customer already exists, only customer.key, customer.person.key and modified required</p></td></tr><tr><td><pre><code>events
</code></pre></td><td>object</td><td>depends on legal requirements</td><td>See: <a href="#events">Events</a></td></tr><tr><td><pre><code>key
</code></pre></td><td>string</td><td>required</td><td>See: <a href="/pages/qktxyt71bzyZpbexMTmZ#key">Key</a></td></tr><tr><td><pre><code>modified
</code></pre></td><td>string</td><td>required</td><td>See: <a href="/pages/qktxyt71bzyZpbexMTmZ#modified">Modified</a></td></tr></tbody></table>

#### Events

<table><thead><tr><th>Field</th><th>Type</th><th>Requirement</th><th>Description</th></tr></thead><tbody><tr><td><pre><code>date
</code></pre></td><td>string</td><td>required</td><td>DateTime when the file was created</td></tr><tr><td><pre><code>subject
</code></pre></td><td>string</td><td>required</td><td>individual</td></tr><tr><td><pre><code>category
</code></pre></td><td>string</td><td>required</td><td>default: "Contract"</td></tr><tr><td><pre><code>file
</code></pre></td><td>string</td><td>required</td><td>relative file path in the zip file (if wrong or missing, import will fail)</td></tr><tr><td><pre><code>key
</code></pre></td><td>string</td><td>required</td><td>See: <a href="/pages/qktxyt71bzyZpbexMTmZ#key">Key</a></td></tr><tr><td><pre><code>modified
</code></pre></td><td>string</td><td>required</td><td>See: <a href="/pages/qktxyt71bzyZpbexMTmZ#modified">Modified</a></td></tr></tbody></table>
