---
id: "P:cAlgo.API.Deal.OrderId"
kind: "property"
type: "T:cAlgo.API.Deal"
url: "https://help.ctrader.com/ctrader-algo/references/Trading/Deals/Deal/OrderId/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# Deal.OrderId

Member of [Deal](https://help.ctrader.com/ctrader-algo/references/Trading/Deals/Deal/index.md).

## OrderId

Order Id.

Environments: Desktop supported · CLI supported · Cloud supported.

C#:

```csharp
int OrderId {get;}
```

Python:

```python
deal.OrderId: int
```

### Returns

`int` — 

Available since cAlgo.API 5.1.

### Examples

C#:

```csharp
var trade = History.FindLast("myLabel");
if (trade != null)
    Print("Closing deal was created by order {0}", trade.ClosingDeal.OrderId);
```

Python:

```python
trade = api.History.FindLast("myLabel")
if trade is not None:
    api.Print(f"Closing deal was created by order {trade.ClosingDeal.OrderId}")
```

