> For the complete documentation index, see [llms.txt](https://3commas.gitbook.io/3commas-official-api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://3commas.gitbook.io/3commas-official-api-docs/dca-bot/deals/add-manual-safety-trade.md).

# Add Manual Safety Trade

<br>

**Description:** Creates a new additional safety manual trade entry<br>

**Permission:** BOTS\_WRITE\
**Security:** SIGNED\ <br>

> <mark style="color:green;">**`POST`**</mark>
>
> `/ver1/deals/{deal_id}/add_funds`

<br>

## Path Parameter<br>

**deal\_id**     `integer`     <mark style="color:orange;">required</mark>\
Unique 3Commas ID Deal entity

## Body Parameters<br>

**quantity**     `number`     <mark style="color:orange;">required</mark>\
Specifies the amount for the manual safety trade

**is\_market**     `boolean`     <mark style="color:orange;">required</mark>\
Indicates the type of order: `true` for a market order, `false` for a limit order

**response\_type**     `string`\
Defines the response format: `empty`;`deal`;`market_order`\
`deal` is using only for 1 pair bot.\
Default: `empty`

**rate**     `number`     <mark style="color:orange;">required</mark>\
Sets the rate for the safety order. Required if a limit order is used

\ <br>

## Response Parameters<br>

Response format depends on choosing `response_type`:

{% tabs %}
{% tab title="empty" %}
None
{% endtab %}

{% tab title="market\_order" %}
**order\_id**     `string`\
Unique 3Commas Trade entity ID

**order\_type**     `string`\
The side of the order to be created by this trade<br>

<details>

<summary><em>Allowed value</em></summary>

* Buy
* Sell

</details>

<br>

**deal\_order\_type**     `string`\
The type of the order to be created by this trade<br>

<details>

<summary><em>Allowed value</em></summary>

* Base
* Take profit
* Stop Loss
* Safety
* Manual Safety

</details>

**cancellable**     `boolean`\
Indicates whether this trade can be canceled (`true` or not (`false`)

**created\_at**     `string`\
ISO 8601 datetime string of when this Trade entity was created

**status\_string**     `string`\
3Commas status for this Trade

<details>

<summary><em>Allowed value</em></summary>

* **Active** - the trade is currently open, waiting to be filled
* **Filled** - the trade has been fully executed
* **Finished** - the trade process is complete
* **Cancelled** - the trade was canceled before it could be fully executed

</details>

**created\_at**     `string`\
ISO 8601 datetime string of when this Trade entity was created

**updated\_at**     `string`\
ISO 8601 datetime string of when this Trade entity was updated

**quantity**     `string`\
Total quantity of the asset in this order

**quantity\_remaining**     `string`\
Remaining quantity of the asset left to be filled in this order

**total**     `string`\
Total value of the order based on `quantity` and `rate`

**rate**     `string`\
Price per unit of the asset in the order

**average\_price**     `string`\
The weighted average price at which the asset was bought or sold during the execution of the trades
{% endtab %}

{% tab title="deal" %}
If successful, the response includes an updated copy of the [Deals](/3commas-official-api-docs/dca-bot/deals.md) entity.
{% endtab %}
{% endtabs %}

\ <br>

## Example Request<br>

```json
POST /ver1/deals/2295672969/add_funds
```

```
Body:

{
   "quantity": 0.01,
   "is_market": false,
   "response_type": "market_order",
   "rate": 0.2970
}

```

\ <br>

## Example Response and errors<br>

<details>

<summary>Status: 201 Created</summary>

<br>

```json
{
    "order_id": "1110817001",
    "order_type": "SELL",
    "deal_order_type": "Manual Safety",
    "cancellable": true,
    "status_string": "Active",
    "created_at": "2024-11-11T16:46:59.479Z",
    "updated_at": "2024-11-11T16:46:59.479Z",
    "quantity": "0.0",
    "quantity_remaining": "0.0",
    "total": "0.0",
    "rate": "0.297",
    "average_price": "0.0"
}
```

</details>

<details>

<summary>Status: 400 Bad request</summary>

\
\`\`\` { "error": "record\_invalid", "error\_description": "Invalid parameters", "error\_attributes": { "rate": \[ "is missing" ] } } \`\`\`

</details>
