> For the complete documentation index, see [llms.txt](https://docs.fieldmotion.com/fieldmotion-api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fieldmotion.com/fieldmotion-api-docs/opportunity/_converttoquote.md).

# \_convertToQuote

Converts an Opportunity to a Quote.

### Parameter

#### id

The ID of the Opportunity to be deleted.

### Example

<pre><code>FM_api('Opportunity_convertToQuote',[
    'id'=>'60002'
<strong>]);
</strong></code></pre>

### Results:

#### On Success:

```
{"ok":1,"quoteId":369020}
```

If the "id" parameter matches an Opportunity already converted to a Quote:

```
{"ok":1,"quoteId":null}
```

#### On Failure:

If the "id" parameter is not set:

```
{"error":"missing or invalid parameter: id"}
```

If the "id" parameter given does not match an existing Opportunity:

```
{"error":"missing or invalid parameter: customer_id"}
```
