# Convert a lead into a deal

Turns one lead into a deal, ONCE and atomically: the mapped cells are copied, the merchant is found or made and linked both ways, the lead's record group and owners are carried onto the deal, the lead is stamped converted and both records get their timeline entries. Answers the new deal row, which is what the app opens. A second call on the same lead is a 409 naming the deal it already made. Leads page only.

Access class: `def:read`.

## Endpoint

`POST /v1/definitions/{key}/rows/{rowId}/convert`

## Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| key | path | string | Yes |
| rowId | path | string | Yes |

## Request body

Content type: `application/json`.

```json
{
  "body": {},
  "params": {
    ":key": "string",
    ":rowId": ""
  },
  "query": {}
}
```

## Responses

### 201

the action's answer

Content type: `application/json`.

```json
{
  "data": {
    "cells": {
      "<uuid-2>": "string",
      "<uuid-4>": "string"
    },
    "createdBy": "string",
    "id": "",
    "position": 1.5,
    "source": "string"
  }
}
```

### default

a refusal: `{"error": "<what a person needs to read>"}`. 401 no credential, 402 the plan does not include this, 403 the seat does not, 404 the thing does not exist or is not yours to see.

Content type: `application/json`.

```json
{
  "error": "string"
}
```
