> For the complete documentation index, see [llms.txt](https://www.notbank.com/learn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.notbank.com/learn/api-reference/websocket-api/report.md).

# Report

### GenerateTradeActivityReport

**Permissions:** NotbankTrading\
**Call Type:** Synchronous

Creates an immediate report on historical trade activity on a specific OMS for a list of accounts, during a specified time interval.

A user with NotbankTrading permission can only generate trade reports for accounts with which he/she is associated to.

The actual Trade Activity Report will be generated as a comma-separated (CSV) file. It can be downloaded using the API method **DownloadDocument**.

#### Request

{% tabs %}
{% tab title="Node" %}

```javascript
import Notbank from 'notbank'
// websocket connection code ...

await client.getReportService().generateTradeActivityReport({
  accountIdList: [185, 9],
  startTime: "2023-03-01T16:00:00.000Z",
  endTime: "2023-03-02T16:00:00.000Z"
});

// parameters
{
  accountIdList: number[]; // Required
  startTime: string; // Required, format ISO 8601
  endTime: string; // Required, format ISO 8601
}
```

{% endtab %}

{% tab title="Java" %}

```java
import java.util.List;
import exchange.notbank.report.paramBuilders.GenerateActivityReportParamBuilder;

var response = client.getReportService().generateTradeActivityReport(new GenerateActivityReportParamBuilder(
    List.of(185, 9),
    "2025-06-10T16:00:00.000Z",
    "2025-07-15T16:00:00.000Z")).get();
```

{% endtab %}

{% tab title="Python" %}

```python
from notbank_python_sdk.requests_models import GenerateTradeActivityReportRequest

response = client.generate_trade_activity_report(GenerateTradeActivityReportRequest(
    start_time="2023-03-01T16:00:00.000Z",
    end_time="2023-03-02T16:00:00.000Z",
    account_id_list=[185, 9],
))
```

{% endtab %}

{% tab title="Json" %}

```json
{
  "m": 0,
  "i": 0,
  "n": "GenerateTradeActivityReport",
  "o": "{
    \"OMSId\": 1,
    \"startTime\": \"2023-03-01T16:00:00.000Z\",
    \"endTime\": \"2023-03-02T16:00:00.000Z\",
    \"accountIdList\": [185, 9]
  }"
}
```

{% endtab %}
{% endtabs %}

| Key           | Value                                                                                                                                                                                                  |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| accountIdList | **integer array**. A comma-delimited array of one ore more account IDs, each valid on a single OMS for the authenticated user. The account user may not be the only user of the account. **required**. |
| omsId         | **integer**. The ID of the OMS on which the array of account IDs resides. **required**.                                                                                                                |
| startTime     | **string**. Identifies the time and date for the historic beginning of the trade activity report. **required**.                                                                                        |
| endTime       | **string**. Identifies the time and date for the historic end of the trade activity report. **required**.                                                                                              |

#### Response

```json
{
  "m": 1,
  "i": 0,
  "n": "GenerateTradeActivityReport",
  "o": "{
    \"RequestingUser\": 6,
    \"OMSId\": 1,
    \"reportFlavor\": \"TradeActivity\",
    \"createTime\": \"2023-03-29T09:23:48.919Z\",
    \"initialRunTime\": \"2023-03-29T09:23:48.919Z\",
    \"intervalStartTime\": \"2023-03-01T16:00:00.000Z\",
    \"intervalEndTime\": \"2023-03-02T16:00:00.000Z\",
    \"RequestStatus\": \"Submitted\",
    \"ReportFrequency\": \"onDemand\",
    \"intervalDuration\": 864000000000,
    \"RequestId\": \"f99dfd7b-138a-451f-8eca-7dd9916198f7\",
    \"lastInstanceId\": \"00000000-0000-0000-0000-000000000000\",
    \"accountIds\": [9, 185]
  }"
}
```

| Key               | Value                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| RequestingUser    | **integer**. The User ID of the person requesting the trade activity report. This confirms the ID of the authenticated user who made the request by returning it as part of the response.                                                                                                                                                                                                                                                                                                                                                                                                       |
| OMSId             | **integer**. The ID of the OMS on which the trade activity report will be run.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| reportFlavor      | **string**. The type of report to be generated. In the case of GenerateTradeActivityReport, report flavor will always be **TradeActivity**                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| createTime        | **string**. The time and date on which the request for the trade activity report was made.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| initialRunTime    | **string**. The time and date at which the trade activity report was first run.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| intervalStartTime | **string**. The start of the period that the report will cover.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| intervalEndTime   | **string**. The end of the period that the report will cover.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| RequestStatus     | <p><strong>string</strong>. The status of the request for the trade activity report. A <strong>Generate\~Report</strong> request will always return <em>Submitted</em>. One of:<br>- Submitted<br>- Validating<br>- Scheduled<br>- InProgress<br>- Completed<br>- Aborting<br>- Aborted<br>- UserCancelled<br>- SysRetired<br>- UserCancelled<br>- Pending</p>                                                                                                                                                                                                                                  |
| ReportFrequency   | <p><strong>string</strong>. When the report runs. For a <strong>Generate\~Report</strong> request, this is always OnDemand. One of:<br>- OnDemand<br>- Hourly<br>- Daily<br>- Weekly<br>- Monthly<br>- Annually</p>                                                                                                                                                                                                                                                                                                                                                                             |
| intervalDuration  | <p><strong>long integer</strong>. The period that the report covers relative to the run date. The <strong>Generate~~Report</strong> request requires a start time and an end time. The Notbank software calculates the difference between them as <em>intervalDuration</em>.<br><br>For example, say that you specify a 90-day start-date-to-end-date window for a report. The <em>intervalDuration</em> value returns a value equivalent to 90 days. If you have called <strong>Generate~~Report</strong>, that value simply confirms the length of time that the on-demand report covers.</p> |
| RequestId         | **string**. The ID of the original request. Request IDs are long strings unique within the OMS.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| lastInstanceId    | **string**. For scheduled reports, the report ID of the most recent previously run report. Will be *null* for a **Generate\~Report** call, because generated reports are on-demand.                                                                                                                                                                                                                                                                                                                                                                                                             |
| accountIds        | **integer array**. A comma-delimited array of account IDs whose trades are reported in the trade activity report.                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |

### GenerateTransactionActivityReport

**Permissions:** NotbankTrading\
**Call Type:** Synchronous

Creates an immediate report on historical transaction activity on a specific OMS for a list of accounts during a specified time interval.

A user with NotbankTrading permission can only generate transaction reports for accounts with which he/she is associated to.

The actual Transaction Activity Report will be generated as a comma-separated (CSV) file. It can be downloaded using the API method **DownloadDocument**.

#### Request

{% tabs %}
{% tab title="Node" %}

```javascript
import Notbank from 'notbank'
// websocket connection code ...

await client.getReportService().generateTransactionActivityReport({
  accountIdList: [185, 9],
  startTime: "2023-03-01T16:00:00.000Z",
  endTime: "2023-03-02T16:00:00.000Z"
});

// parameters
{
  accountIdList: number[]; // Required
  startTime: string; // Required, format ISO 8601
  endTime: string; // Required, format ISO 8601
}
```

{% endtab %}

{% tab title="Java" %}

```java
import java.util.List;
import exchange.notbank.report.paramBuilders.GenerateActivityReportParamBuilder;

var response = client.getReportService().generateTransactionActivityReport(new GenerateActivityReportParamBuilder(
  List.of(185, 9),
  "2025-06-10T16:00:00.000Z",
  "2025-07-15T16:00:00.000Z")).get();
```

{% endtab %}

{% tab title="Python" %}

```python
from notbank_python_sdk.requests_models import GenerateTransactionActivityReportRequest

response = client.generate_transaction_activity_report(GenerateTransactionActivityReportRequest(
    start_time="2023-03-01T16:00:00.000Z",
    end_time="2023-03-02T16:00:00.000Z",
    account_id_list=[185, 9],
))
```

{% endtab %}

{% tab title="Json" %}

```json
{
  "m": 0,
  "i": 0,
  "n": "GenerateTransactionActivityReport",
  "o": "{
    \"OMSId\": 1,
    \"startTime\": \"2023-03-01T16:00:00.000Z\",
    \"endTime\": \"2023-03-02T16:00:00.000Z\",
    \"accountIdList\": [185, 9]
  }"
}
```

{% endtab %}
{% endtabs %}

| Key           | Value                                                                                                                                                                                                  |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| accountIdList | **integer array**. A comma-delimited array of one ore more account IDs, each valid on a single OMS for the authenticated user. The account user may not be the only user of the account. **required**. |
| omsId         | **integer**. The ID of the OMS on which the array of account IDs resides. **required**.                                                                                                                |
| startTime     | **string**. Identifies the time and date for the historic beginning of the transaction activity report. **required**.                                                                                  |
| endTime       | **string**. Identifies the time and date for the historic end of the transaction activity report. **required**.                                                                                        |

#### Response

```json
{
  "m": 1,
  "i": 0,
  "n": "GenerateTransactionActivityReport",
  "o": "{
    \"RequestingUser\": 6,
    \"OMSId\": 1,
    \"reportFlavor\": \"Transaction\",
    \"createTime\": \"2023-03-29T09:23:30.245Z\",
    \"initialRunTime\": \"2023-03-29T09:23:30.245Z\",
    \"intervalStartTime\": \"2023-03-01T16:00:00.000Z\",
    \"intervalEndTime\": \"2023-03-02T16:00:00.000Z\",
    \"RequestStatus\": \"Submitted\",
    \"ReportFrequency\": \"onDemand\",
    \"intervalDuration\": 864000000000,
    \"RequestId\": \"a864c139-5395-4fbe-8627-6aa164a2180d\",
    \"lastInstanceId\": \"00000000-0000-0000-0000-000000000000\",
    \"accountIds\": [9, 185]
  }"
}
```

Similar objects are returned for **Generate\~Report** and **Schedule\~Report** calls. As a result, for an on-demand **Generate\~Report** call, some string-value pairs such as *initialRunTime* may return the current time and *ReportFrequency* will always return *OnDemand* because the report is only generated once and on demand.

| Key               | Value                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| RequestingUser    | **integer**. The User ID of the person requesting the transaction activity report. This confirms the ID of the authenticated user who made the request by returning it as part of the response.                                                                                                                                                                                                                                                                                                                                                                                              |
| OMSId             | **integer**. The ID of the OMS on which the transaction activity report will be run.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| reportFlavor      | **string**. The type of report to be generated. In the case of GenerateTransactionActivityReport, report flavor will always be **TransactionActivity**                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| createTime        | **string**. The time and date on which the request for the transaction activity report was made.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| initialRunTime    | **string**. The time and date at which the transaction activity report was first run.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| intervalStartTime | **string**. The start of the period that the report will cover.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| intervalEndTime   | **string**. The end of the period that the report will cover.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| RequestStatus     | <p><strong>string</strong>. The status of the request for the transaction activity report. A Generate\~Report request will always return <em>Submitted</em>. One of:<br>- Submitted<br>- Validating<br>- Scheduled<br>- InProgress<br>- Completed<br>- Aborting<br>- Aborted<br>- UserCancelled<br>- SysRetired<br>- UserCancelled<br>- Pending</p>                                                                                                                                                                                                                                          |
| ReportFrequency   | <p><strong>string</strong>. When the report runs. For a <strong>Generate\~Report</strong> call, this is always OnDemand. One of:<br>- OnDemand<br>- Hourly<br>- Daily<br>- Weekly<br>- Monthly<br>- Annually</p>                                                                                                                                                                                                                                                                                                                                                                             |
| intervalDuration  | <p><strong>long integer</strong>. The period that the report covers relative to the run date. The <strong>Generate~~Report</strong> call requires a start time and an end time. The Notbank software calculates the difference between them as <em>intervalDuration</em>.<br><br>For example, say that you specify a 90-day start-date-to-end-date window for a report. The <em>intervalDuration</em> value returns a value equivalent to 90 days. If you have called <strong>Generate~~Report</strong>, that value simply confirms the length of time that the on-demand report covers.</p> |
| RequestId         | **string**. The ID of the original request. Request IDs are long strings unique within the OMS.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| lastInstanceId    | **string**. For scheduled reports, the report ID of the most recent previously run report. Will be *null* for a **Generate\~Report** call, because generated reports are on-demand.                                                                                                                                                                                                                                                                                                                                                                                                          |
| accountIds        | **integer array**. A comma-delimited array of account IDs whose transactions are reported in the transaction activity report.                                                                                                                                                                                                                                                                                                                                                                                                                                                                |

### GenerateProductDeltaActivityReport

**Permissions:** NotbankTrading\
**Call Type:** Synchronous

Initiates the generation of a Product Delta Activity Report for the specified accounts over a specified time interval.

#### Request

{% tabs %}
{% tab title="Node" %}

```javascript
import Notbank from 'notbank'
// websocket connection code ...

await client.getReportService().generateProductDeltaActivityReport({
  accountIdList: [185, 9],
  startTime: "2023-03-01T16:00:00.000Z",
  endTime: "2023-03-02T16:00:00.000Z"
});

// parameters
{
  accountIdList: number[];
  startTime: string;
  endTime: string;
}
```

{% endtab %}

{% tab title="Java" %}

```java
import java.util.List;
import exchange.notbank.report.paramBuilders.GenerateActivityReportParamBuilder;

var response = client.getReportService().generateProductDeltaActivityReport(new GenerateActivityReportParamBuilder(
    List.of(185, 9),
    "2025-06-10T16:00:00.000Z",
    "2025-07-15T16:00:00.000Z")).get();
```

{% endtab %}

{% tab title="Python" %}

```python
from notbank_python_sdk.requests_models import GenerateProductDeltaActivityReportRequest

response = client.generate_product_delta_activity_report(GenerateProductDeltaActivityReportRequest(
    start_time="2023-03-01T16:00:00.000Z",
    end_time="2023-03-02T16:00:00.000Z",
    account_id_list=[185, 9],
))
```

{% endtab %}

{% tab title="Json" %}

```json
{
  "m": 0,
  "i": 0,
  "n": "GenerateProductDeltaActivityReport",
  "o": "{
    \"OMSId\": 1,
    \"startTime\": \"2023-03-01T16:00:00.000Z\",
    \"endTime\": \"2023-03-02T16:00:00.000Z\",
    \"accountIdList\": [185, 9]
  }"
}
```

{% endtab %}
{% endtabs %}

| Key           | Value                                                                                                                                                                                                  |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| accountIdList | **integer array**. A comma-delimited array of one ore more account IDs, each valid on a single OMS for the authenticated user. The account user may not be the only user of the account. **required**. |
| omsId         | **integer**. The ID of the OMS on which the array of account IDs resides. **required**.                                                                                                                |
| startTime     | **string**. Identifies the time and date for the historic beginning of the product delta activity report. **required**.                                                                                |
| endTime       | **string**. Identifies the time and date for the historic end of the product delta activity report. **required**.                                                                                      |

#### Response

```json
{
  "m": 1,
  "i": 0,
  "n": "GenerateProductDeltaActivityReport",
  "o": "{
    \"RequestingUser\": 1,
    \"OMSId\": 1,
    \"reportFlavor\": \"ProductDelta\",
    \"createTime\": \"2023-12-06T08:44:41.721Z\",
    \"initialRunTime\": \"2023-12-06T08:44:41.721Z\",
    \"intervalStartTime\": \"2023-03-01T16:00:00.000Z\",
    \"intervalEndTime\": \"2023-03-02T16:00:00.000Z\",
    \"RequestStatus\": \"Submitted\",
    \"ReportFrequency\": \"onDemand\",
    \"intervalDuration\": 864000000000,
    \"RequestId\": \"00117ffc-239d-4d37-804f-738b8250c1d9\",
    \"lastInstanceId\": \"00000000-0000-0000-0000-000000000000\",
    \"accountIds\": [9, 185]
  }"
}
```

| Key               | Value                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| RequestingUser    | **integer**. The User ID of the person requesting the product delta activity report. This confirms the ID of the authenticated user who made the request by returning it as part of the response.                                                                                                                                                                                                                                                                                                                                                                                            |
| OMSId             | **integer**. The ID of the OMS on which the product delta activity report will be run.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| reportFlavor      | **string**. The type of report to be generated. In the case of GenerateProductDeltaActivityReport, report flavor will always be **ProductDelta**.                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| createTime        | **string**. The time and date on which the request for the product delta activity report was made.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| initialRunTime    | **string**. The time and date at which the product delta activity report was first run.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| intervalStartTime | **string**. The start of the period that the report will cover.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| intervalEndTime   | **string**. The end of the period that the report will cover.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| RequestStatus     | <p><strong>string</strong>. The status of the request for the product delta activity report. A Generate\~Report request will always return <em>Submitted</em>. One of:<br>- Submitted<br>- Validating<br>- Scheduled<br>- InProgress<br>- Completed<br>- Aborting<br>- Aborted<br>- UserCancelled<br>- SysRetired<br>- UserCancelled<br>- Pending</p>                                                                                                                                                                                                                                        |
| ReportFrequency   | <p><strong>string</strong>. When the report runs. For a <strong>Generate\~Report</strong> call, this is always OnDemand. One of:<br>- OnDemand<br>- Hourly<br>- Daily<br>- Weekly<br>- Monthly<br>- Annually</p>                                                                                                                                                                                                                                                                                                                                                                             |
| intervalDuration  | <p><strong>long integer</strong>. The period that the report covers relative to the run date. The <strong>Generate~~Report</strong> call requires a start time and an end time. The Notbank software calculates the difference between them as <em>intervalDuration</em>.<br><br>For example, say that you specify a 90-day start-date-to-end-date window for a report. The <em>intervalDuration</em> value returns a value equivalent to 90 days. If you have called <strong>Generate~~Report</strong>, that value simply confirms the length of time that the on-demand report covers.</p> |
| RequestId         | **string**. The ID of the original request. Request IDs are long strings unique within the OMS.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| lastInstanceId    | **string**. For scheduled reports, the report ID of the most recent previously run report. Will be *null* for a **Generate\~Report** call, because generated reports are on-demand.                                                                                                                                                                                                                                                                                                                                                                                                          |
| accountIds        | **integer array**. A comma-delimited array of account IDs whose transactions are reported in the product delta activity report.                                                                                                                                                                                                                                                                                                                                                                                                                                                              |

### GeneratePnLActivityReport

**Permissions:** NotbankTrading\
**Call Type:** Synchronous

Initiates the generation of a Profit and Loss Activity Report for the specified accounts over a specified time interval.

#### Request

{% tabs %}
{% tab title="Node" %}

```javascript
import Notbank from 'notbank'
// websocket connection code ...

await client.getReportService().generatePnLActivityReport({
  accountIdList: [185, 9],
  startTime: "2023-03-01T16:00:00.000Z",
  endTime: "2023-03-02T16:00:00.000Z"
});

// parameters
{
  accountIdList: number[];
  startTime: string;
  endTime: string;
}
```

{% endtab %}

{% tab title="Java" %}

```java
import java.util.List;
import exchange.notbank.report.paramBuilders.GenerateActivityReportParamBuilder;

var response = client.getReportService().generatePnLActivityReport(new GenerateActivityReportParamBuilder(
    List.of(185, 9),
    "2025-06-10T16:00:00.000Z",
    "2025-07-15T16:00:00.000Z"));

```

{% endtab %}

{% tab title="Python" %}

```python
from notbank_python_sdk.requests_models import GeneratePnlActivityReportRequest

response = client.generate_pnl_activity_report(GeneratePnlActivityReportRequest(
    start_time="2023-03-01T16:00:00.000Z",
    end_time="2023-03-02T16:00:00.000Z",
    account_id_list=[185, 9],
))
```

{% endtab %}

{% tab title="Json" %}

```json
{
  "m": 0,
  "i": 0,
  "n": "GeneratePnLActivityReport",
  "o": "{
    \"OMSId\": 1,
    \"startTime\": \"2023-03-01T16:00:00.000Z\",
    \"endTime\": \"2023-03-02T16:00:00.000Z\",
    \"accountIdList\": [185, 9]
  }"
}
```

{% endtab %}
{% endtabs %}

| Key           | Value                                                                                                                                                                                                  |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| accountIdList | **integer array**. A comma-delimited array of one ore more account IDs, each valid on a single OMS for the authenticated user. The account user may not be the only user of the account. **required**. |
| omsId         | **integer**. The ID of the OMS on which the array of account IDs resides. **required**.                                                                                                                |
| startTime     | **string**. Identifies the time and date for the historic beginning of the profit and loss activity report. **required**.                                                                              |
| endTime       | **string**. Identifies the time and date for the historic end of the profit and loss activity report. **required**.                                                                                    |

#### Response

```json
{
  "m": 1,
  "i": 0,
  "n": "GeneratePnLActivityReport",
  "o": "{
    \"RequestingUser\": 1,
    \"OMSId\": 1,
    \"reportFlavor\": \"ProfitAndLoss\",
    \"createTime\": \"2023-12-06T08:50:54.313Z\",
    \"initialRunTime\": \"2023-12-06T08:50:54.313Z\",
    \"intervalStartTime\": \"2023-03-01T16:00:00.000Z\",
    \"intervalEndTime\": \"2023-03-02T16:00:00.000Z\",
    \"RequestStatus\": \"Submitted\",
    \"ReportFrequency\": \"onDemand\",
    \"intervalDuration\": 864000000000,
    \"RequestId\": \"41696500-45e5-4609-b233-9b60389d7abc\",
    \"lastInstanceId\": \"00000000-0000-0000-0000-000000000000\",
    \"accountIds\": [9, 185]
  }"
}

```

| Key               | Value                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| RequestingUser    | **integer**. The User ID of the person requesting the profit and loss activity report. This confirms the ID of the authenticated user who made the request by returning it as part of the response.                                                                                                                                                                                                                                                                                                                                                                                          |
| OMSId             | **integer**. The ID of the OMS on which the profit and loss activity report will be run.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| reportFlavor      | **string**. The type of report to be generated. In the case of GeneratePnLActivityReport, report flavor will always be **ProfitAndLoss**                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| createTime        | **string**. The time and date on which the request for the profit and loss activity report was made.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| initialRunTime    | **string**. The time and date at which the profit and loss activity report was first run.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| intervalStartTime | **string**. The start of the period that the report will cover.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| intervalEndTime   | **string**. The end of the period that the report will cover.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| RequestStatus     | <p><strong>string</strong>. The status of the request for the profit and loss activity report. A Generate\~Report request will always return <em>Submitted</em>. One of:<br>- Submitted<br>- Validating<br>- Scheduled<br>- InProgress<br>- Completed<br>- Aborting<br>- Aborted<br>- UserCancelled<br>- SysRetired<br>- UserCancelled<br>- Pending</p>                                                                                                                                                                                                                                      |
| ReportFrequency   | <p><strong>string</strong>. When the report runs. For a <strong>Generate\~Report</strong> call, this is always OnDemand. One of:<br>- OnDemand<br>- Hourly<br>- Daily<br>- Weekly<br>- Monthly<br>- Annually</p>                                                                                                                                                                                                                                                                                                                                                                             |
| intervalDuration  | <p><strong>long integer</strong>. The period that the report covers relative to the run date. The <strong>Generate~~Report</strong> call requires a start time and an end time. The Notbank software calculates the difference between them as <em>intervalDuration</em>.<br><br>For example, say that you specify a 90-day start-date-to-end-date window for a report. The <em>intervalDuration</em> value returns a value equivalent to 90 days. If you have called <strong>Generate~~Report</strong>, that value simply confirms the length of time that the on-demand report covers.</p> |
| RequestId         | **string**. The ID of the original request. Request IDs are long strings unique within the OMS.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| lastInstanceId    | **string**. For scheduled reports, the report ID of the most recent previously run report. Will be *null* for a **Generate\~Report** call, because generated reports are on-demand.                                                                                                                                                                                                                                                                                                                                                                                                          |
| accountIds        | **integer array**. A comma-delimited array of account IDs whose transactions are reported in the profit and loss activity report.                                                                                                                                                                                                                                                                                                                                                                                                                                                            |

### ScheduleTradeActivityReport

**Permissions:** NotbankTrading\
**Call Type:** Synchronous

Initiates the generation of a series of Trade Activity Reports for the specified accounts, over a regular periodic time interval.

A user with NotbankTrading permission can only schedule generation of trade reports for accounts with which he/she is associated to.

A trade report will be generated every period unless cancelled using the API method **CancelReport**.

The actual Trade Activity Report will be generated as a comma-separated (CSV) file. It can be downloaded using the API method **DownloadDocument**.

#### Request

{% tabs %}
{% tab title="Node" %}

```javascript
import Notbank from 'notbank'
// websocket connection code ...

await client.getReportService().scheduleTradeActivityReport({
  accountIdList: [185, 9],
  beginTime: "2023-03-01T16:00:00.000Z",
  Frequency: "Weekly"
});

// parameters
{
  accountIdList: number[];
  beginTime: string;
  Frequency?: ReportFrequency | number | string; 
}
```

{% endtab %}

{% tab title="Java" %}

```java
import java.util.List;
import exchange.notbank.report.constants.ReportFrequency;
import exchange.notbank.report.paramBuilders.ScheduleActivityReportParamBuilder;

var response = client.getReportService().scheduleTradeActivityReport(
    new ScheduleActivityReportParamBuilder(List.of(185, 9), "2025-07-19T16:00:00.000Z")
    .frequency(ReportFrequency.WEEKLY)).get();
```

{% endtab %}

{% tab title="Python" %}

```python
from notbank_python_sdk.constants import ReportFrequency
from notbank_python_sdk.requests_models import ScheduleTradeActivityReportRequest

response = client.schedule_trade_activity_report(ScheduleTradeActivityReportRequest(
    begin_time="2023-03-30T16:00:00.000Z",
    account_id_list=[185, 9],
    frequency=ReportFrequency.WEEKLY,
))
```

{% endtab %}

{% tab title="Json" %}

```json
{
  "m": 0,
  "i": 0,
  "n": "ScheduleTradeActivityReport",
  "o": "{
    \"OMSId\": 1,
    \"beginTime\": \"2023-03-30T16:00:00.000Z\",
    \"Frequency\": \"Weekly\",
    \"accountIdList\": [185, 9]
  }"
}
```

{% endtab %}
{% endtabs %}

| Key           | Value                                                                                                                                                                                                                                                       |
| ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Frequency     | <p><strong>integer or string</strong>. How often the report will run and a trade report get generated. One of:<br>- 0 Hourly<br>- 1 Daily<br>- 2 Weekly<br>- 3 Monthly<br>- 4 Annually<br>- 5 onDemand. Default is 0 Hourly. <strong>optional</strong>.</p> |
| accountIdList | **integer array**. Comma-separated integers; each element an account ID on the OMS whose trade activity will be reported on. All accounts must be from the same OMS. **required**.                                                                          |
| OMSId         | **integer**. The ID of the OMS on which the accounts named in the list reside. **required**.                                                                                                                                                                |
| beginTime     | **string**. The time at which the periodic reports begin; the day and time when you want reporting to start, in Microsoft Ticks format. **required**.                                                                                                       |

#### Response

```json
{
  "m": 1,
  "i": 0,
  "n": "ScheduleTradeActivityReport",
  "o": "{
    \"RequestingUser\": 6,
    \"OMSId\": 1,
    \"reportFlavor\": \"TradeActivity\",
    \"createTime\": \"2023-03-29T16:11:13.093Z\",
    \"initialRunTime\": \"2023-03-30T16:00:00.000Z\",
    \"intervalStartTime\": \"2023-03-30T16:00:00.000Z\",
    \"intervalEndTime\": \"2023-04-06T16:00:00.000Z\",
    \"RequestStatus\": \"Submitted\",
    \"ReportFrequency\": \"Weekly\",
    \"intervalDuration\": 6048000000000,
    \"RequestId\": \"eb7f18bb-1978-47ba-aae1-b74c3a8acb2d\",
    \"lastInstanceId\": \"00000000-0000-0000-0000-000000000000\",
    \"accountIds\": [9, 185]
  }"
}
```

| Key               | Value                                                                                                                                                                                                                                                                                                                                                 |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| RequestingUser    | **integer**. The User ID of the person requesting the trade activity report. This confirms the ID of the authenticated user who made the request by returning it as part of the response.                                                                                                                                                             |
| OMSId             | **integer**. The ID of the OMS on which the trade activity report will be run.                                                                                                                                                                                                                                                                        |
| reportFlavor      | **string**. The type of report to be generated. In the case of ScheduleTradeActivityReport, report flavor will always be **TradeActivity**                                                                                                                                                                                                            |
| createTime        | **string**. The time and date on which the request for the trade activity report was made, in Microsoft Ticks format.                                                                                                                                                                                                                                 |
| initialRunTime    | **string**. The time and date at which the trade activity report was first run, in Microsoft Ticks format.                                                                                                                                                                                                                                            |
| intervalStartTime | **string**. The start of the period that the report will cover, in Microsoft Ticks format.                                                                                                                                                                                                                                                            |
| intervalEndTime   | **string**. The end of the period that the report will cover, in Microsoft Ticks format.                                                                                                                                                                                                                                                              |
| RequestStatus     | <p><strong>string</strong>. The status of the request for the trade activity report. One of:<br>- Submitted<br>- Validating<br>- Scheduled<br>- InProgress<br>- Completed<br>- Aborting<br>- Aborted<br>- UserCancelled<br>- SysRetired<br>- UserCancelledPending</p>                                                                                 |
| ReportFrequency   | <p><strong>string</strong>. When the report runs. One of:<br>- OnDemand<br>- Hourly<br>- Daily<br>- Weekly<br>- Monthly<br>- Annually</p>                                                                                                                                                                                                             |
| intervalDuration  | <p><strong>long integer</strong>. The period that the report covers relative to the run date, in POSIX format. The call specifies a start time and an <em>intervalDuration</em>.<br><br>In a scheduled report, the interval duration depends on the frequency. If the frequency is <strong>Weekly</strong>, the interval duration will be 1 week.</p> |
| RequestId         | **string**. The ID of the original request. Request IDs are long strings unique within the OMS.                                                                                                                                                                                                                                                       |
| lastInstanceId    | **string**. For scheduled reports, the report ID of the most recent previously run report.                                                                                                                                                                                                                                                            |
| accountIds        | **integer array**. A comma-delimited array of account IDs whose trades are reported in the trade activity report.                                                                                                                                                                                                                                     |

### ScheduleTransactionActivityReport

**Permissions:** NotbankTrading\
**Call Type:** Synchronous

Initiates the generation of an series of Transaction Activity Reports for the specified accounts over a regular periodic time interval.

A user with NotbankTrading permission can only schedule generation of transaction reports for accounts with which he/she is associated to.

A transaction report will be generated every period unless cancelled using the API method **CancelReport**.

The actual Transaction Activity Report will be generated as a comma-separated (CSV) file. It can be downloaded using the API call **DownloadDocument**.

#### Request

{% tabs %}
{% tab title="Node" %}

```javascript
import Notbank from 'notbank'
// websocket connection code ...

await client.getReportService().scheduleTransactionActivityReport({
  accountIdList: [185, 9],
  beginTime: "2023-03-01T16:00:00.000Z",
  Frequency: "Weekly"
});

// parameters
{
  accountIdList: number[]; // Required
  beginTime: string; // format ISO 8601
  frequency?: ReportFrequency | number | string; // Optional
}
```

{% endtab %}

{% tab title="Java" %}

```java
import java.util.List;
import exchange.notbank.report.constants.ReportFrequency;
import exchange.notbank.report.paramBuilders.ScheduleActivityReportParamBuilder;

var response = client.getReportService().scheduleTransactionActivityReport(
    new ScheduleActivityReportParamBuilder(List.of(185, 9), "2025-07-19T16:00:00.000Z")
        .frequency(ReportFrequency.WEEKLY)).get();
```

{% endtab %}

{% tab title="Python" %}

```python
from notbank_python_sdk.constants import ReportFrequency
from notbank_python_sdk.requests_models import ScheduleTransactionActivityReportRequest

response = client.schedule_transaction_activity_report(ScheduleTransactionActivityReportRequest(
    begin_time="2023-03-30T16:00:00.000Z",
    account_id_list=[185, 9],
    frequency=ReportFrequency.WEEKLY,
))
```

{% endtab %}

{% tab title="Json" %}

```json
{
  "m": 0,
  "i": 0,
  "n": "ScheduleTransactionActivityReport",
  "o": "{
    \"OMSId\": 1,
    \"beginTime\": \"2023-03-30T16:00:00.000Z\",
    \"Frequency\": \"Weekly\",
    \"accountIdList\": [185, 9]
  }"
}
```

{% endtab %}
{% endtabs %}

| Key           | Value                                                                                                                                                                                                                                                     |
| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| frequency     | <p><strong>integer or string</strong>. How often the report will run and a trade report get generated. One of:<br>- 0 Hourly<br>- 1 Daily<br>- 2 Weekly<br>- 3 Monthly<br>- 4 Annually<br>- 5 onDemand. Default is Hourly. <strong>optional</strong>.</p> |
| accountIdList | **integer array**. Comma-separated integers; each element an account ID on the OMS whose transaction activity will be reported on. All accounts must be from the same OMS. **required**.                                                                  |
| omsId         | **integer**. The ID of the OMS on which the accounts named in the list reside. **required**.                                                                                                                                                              |
| beginTime     | **string**. The time at which the periodic reports begin; the day and time when you want reporting to start, in Microsoft Ticks format. **required**.                                                                                                     |

#### Response

```json
{
  "m": 1,
  "i": 0,
  "n": "ScheduleTransactionActivityReport",
  "o": "{
    \"RequestingUser\": 6,
    \"OMSId\": 1,
    \"reportFlavor\": \"Transaction\",
    \"createTime\": \"2023-03-29T16:24:35.923Z\",
    \"initialRunTime\": \"2023-03-30T16:00:00.000Z\",
    \"intervalStartTime\": \"2023-03-30T16:00:00.000Z\",
    \"intervalEndTime\": \"2023-04-06T16:00:00.000Z\",
    \"RequestStatus\": \"Submitted\",
    \"ReportFrequency\": \"Weekly\",
    \"intervalDuration\": 6048000000000,
    \"RequestId\": \"ba20a1d1-7acb-48b9-89eb-df2787e65934\",
    \"lastInstanceId\": \"00000000-0000-0000-0000-000000000000\",
    \"accountIds\": [9, 185]
  }"
}
```

| Key               | Value                                                                                                                                                                                                                                                                                                                                                 |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| RequestingUser    | **integer**. The User ID of the person requesting the transaction activity report. This confirms the ID of the authenticated user who made the request by returning it as part of the response.                                                                                                                                                       |
| OMSId             | **integer**. The ID of the OMS on which the transaction activity report will be run.                                                                                                                                                                                                                                                                  |
| reportFlavor      | **string**. The type of report to be generated. In the case of ScheduleTransactionActivityReport, report flavor will always be **Transaction**                                                                                                                                                                                                        |
| createTime        | **string**. The time and date on which the request for the transaction activity report was made, in Microsoft Ticks format.                                                                                                                                                                                                                           |
| initialRunTime    | **string**. The time and date at which the transaction activity report was first run, in Microsoft Ticks format.                                                                                                                                                                                                                                      |
| intervalStartTime | **string**. The start of the period that the report will cover, in Microsoft Ticks format.                                                                                                                                                                                                                                                            |
| intervalEndTime   | **string**. The end of the period that the report will cover, in Microsoft Ticks format.                                                                                                                                                                                                                                                              |
| RequestStatus     | <p><strong>string</strong>. The status of the request for the transaction activity report. One of:<br>- Submitted<br>- Validating<br>- Scheduled<br>- InProgress<br>- Completed<br>- Aborting<br>- Aborted<br>- UserCancelled<br>- SysRetired<br>- UserCancelledPending</p>                                                                           |
| ReportFrequency   | <p><strong>string</strong>. When the report runs. One of:<br>- OnDemand<br>- Hourly<br>- Daily<br>- Weekly<br>- Monthly<br>- Annually</p>                                                                                                                                                                                                             |
| intervalDuration  | <p><strong>long integer</strong>. The period that the report covers relative to the run date, in POSIX format. The call specifies a start time and an <em>intervalDuration</em>.<br><br>In a scheduled report, the interval duration depends on the frequency, if the frequency is <strong>Weekly</strong>, the interval duration will be 1 week.</p> |
| RequestId         | **string**. The ID of the original request. Request IDs are long strings unique within the OMS.                                                                                                                                                                                                                                                       |
| lastInstanceId    | **string**. For scheduled reports, the report ID of the most recent previously run report.                                                                                                                                                                                                                                                            |
| accountIds        | **integer array**. A comma-delimited array of account IDs whose transactions are reported in the transaction activity report.                                                                                                                                                                                                                         |

### ScheduleProductDeltaActivityReport

**Permissions:** NotbankTrading\
**Call Type:** Synchronous

Initiates the generation of a series of Product Delta Activity reports for the specified accounts over a regular periodic time interval.

#### Request

{% tabs %}
{% tab title="Node" %}

```javascript
import Notbank from 'notbank'
// websocket connection code ...

await client.getReportService().scheduleProductDeltaActivityReport({
  accountIdList: [185, 9],
  beginTime: "2023-03-01T16:00:00.000Z",
  Frequency: "Weekly"
});

// parameters
{
  accountIdList: number[];
  beginTime: string;
  frequency?: ReportFrequency | number | string;
}
```

{% endtab %}

{% tab title="Java" %}

```java
import java.util.List;
import exchange.notbank.report.constants.ReportFrequency;
import exchange.notbank.report.paramBuilders.ScheduleActivityReportParamBuilder;

var response = client.getReportService().scheduleProductDeltaActivityReport(
    new ScheduleActivityReportParamBuilder(List.of(185, 9), "2025-07-19T16:00:00.000Z")
        .frequency(ReportFrequency.WEEKLY)).get();
```

{% endtab %}

{% tab title="Python" %}

```python
from notbank_python_sdk.constants import ReportFrequency
from notbank_python_sdk.requests_models import ScheduleProductDeltaActivityReportRequest

response = client.schedule_product_delta_activity_report(ScheduleProductDeltaActivityReportRequest(
    begin_time="2023-03-30T16:00:00.000Z",
    account_id_list=[185, 9],
    frequency=ReportFrequency.WEEKLY,
))
```

{% endtab %}

{% tab title="Json" %}

```json
{
  "m": 0,
  "i": 0,
  "n": "ScheduleProductDeltaActivityReport",
  "o": "{
    \"OMSId\": 1,
    \"beginTime\": \"2023-03-30T16:00:00.000Z\",
    \"Frequency\": \"Weekly\",
    \"accountIdList\": [185, 9]
  }"
}
```

{% endtab %}
{% endtabs %}

| Key           | Value                                                                                                                                                                                                                                                                        |
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| frequency     | <p><strong>integer or string</strong>. How often the report will run and a product delta activity report get generated. One of:<br>- 0 Hourly<br>- 1 Daily<br>- 2 Weekly<br>- 3 Monthly<br>- 4 Annually<br>- 5 onDemand. Default is 0 Hourly. <strong>optional</strong>.</p> |
| accountIdList | **integer array**. Comma-separated integers; each element an account ID on the OMS whose product delta activity will be reported on. All accounts must be from the same OMS. **required**.                                                                                   |
| omsId         | **integer**. The ID of the OMS on which the accounts named in the list reside. **required**.                                                                                                                                                                                 |
| beginTime     | **string**. The time at which the periodic reports begin; the day and time when you want reporting to start, in Microsoft Ticks format. **required**.                                                                                                                        |

#### Response

```json
{
  "m": 1,
  "i": 0,
  "n": "ScheduleProductDeltaActivityReport",
  "o": "{
    \"RequestingUser\": 1,
    \"OMSId\": 1,
    \"reportFlavor\": \"ProductDelta\",
    \"createTime\": \"2023-12-06T08:57:25.933Z\",
    \"initialRunTime\": \"2023-12-06T08:57:25.933Z\",
    \"intervalStartTime\": \"2023-03-30T16:00:00.000Z\",
    \"intervalEndTime\": \"2023-04-06T16:00:00.000Z\",
    \"RequestStatus\": \"Submitted\",
    \"ReportFrequency\": \"Weekly\",
    \"intervalDuration\": 6048000000000,
    \"RequestId\": \"8dd8c68d-b724-d3f7-cc8a-f303c1c428af\",
    \"lastInstanceId\": \"00000000-0000-0000-0000-000000000000\",
    \"accountIds\": [9, 185]
  }"
}
```

| Key               | Value                                                                                                                                                                                                                                                                                                                                                 |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| RequestingUser    | **integer**. The User ID of the person requesting the product delta activity report. This confirms the ID of the authenticated user who made the request by returning it as part of the response.                                                                                                                                                     |
| OMSId             | **integer**. The ID of the OMS on which the product delta activity report will be run.                                                                                                                                                                                                                                                                |
| reportFlavor      | **string**. The type of report to be generated. In the case of ScheduleProductDeltaActivityReport, report flavor will always be **ProductDelta**.                                                                                                                                                                                                     |
| createTime        | **string**. The time and date on which the request for the product delta activity report was made, in Microsoft Ticks format.                                                                                                                                                                                                                         |
| initialRunTime    | **string**. The time and date at which the product delta activity report was first run, in Microsoft Ticks format.                                                                                                                                                                                                                                    |
| intervalStartTime | **string**. The start of the period that the report will cover, in Microsoft Ticks format.                                                                                                                                                                                                                                                            |
| intervalEndTime   | **string**. The end of the period that the report will cover, in Microsoft Ticks format.                                                                                                                                                                                                                                                              |
| RequestStatus     | <p><strong>string</strong>. The status of the request for the product delta activity report. One of:<br>- Submitted<br>- Validating<br>- Scheduled<br>- InProgress<br>- Completed<br>- Aborting<br>- Aborted<br>- UserCancelled<br>- SysRetired<br>- UserCancelledPending</p>                                                                         |
| ReportFrequency   | <p><strong>string</strong>. When the report runs. One of:<br>- OnDemand<br>- Hourly<br>- Daily<br>- Weekly<br>- Monthly<br>- Annually</p>                                                                                                                                                                                                             |
| intervalDuration  | <p><strong>long integer</strong>. The period that the report covers relative to the run date, in POSIX format. The call specifies a start time and an <em>intervalDuration</em>.<br><br>In a scheduled report, the interval duration depends on the frequency, if the frequency is <strong>Weekly</strong>, the interval duration will be 1 week.</p> |
| RequestId         | **string**. The ID of the original request. Request IDs are long strings unique within the OMS.                                                                                                                                                                                                                                                       |
| lastInstanceId    | **string**. For scheduled reports, the report ID of the most recent previously run report.                                                                                                                                                                                                                                                            |
| accountIds        | **integer array**. A comma-delimited array of account IDs whose transactions are reported in the product delta activity report.                                                                                                                                                                                                                       |

### ScheduleProfitAndLossActivityReport

**Permissions:** NotbankTrading\
**Call Type:** Synchronous

Initiates the generation of a series of Profit and Loss Activity reports for the specified accounts over a regular periodic time interval.

#### Request

{% tabs %}
{% tab title="Node" %}

```javascript
import Notbank from 'notbank'
// websocket connection code ...

await client.getReportService().scheduleProfitAndLossActivityReport({
  accountIdList: [185, 9],
  beginTime: "2023-03-01T16:00:00.000Z",
  Frequency: "Weekly"
});

// parameters
{
  accountIdList: number[]; // Required
  beginTime: string; // format ISO 8601
  frequency?: ReportFrequency | number | string; // Optional
}
```

{% endtab %}

{% tab title="Java" %}

```java
import java.util.List;
import exchange.notbank.report.constants.ReportFrequency;
import exchange.notbank.report.paramBuilders.ScheduleActivityReportParamBuilder;

var response = client.getReportService().scheduleProfitAndLossActivityReport(
    new ScheduleActivityReportParamBuilder(List.of(185, 9), "2025-07-19T16:00:00.000Z")
        .frequency(ReportFrequency.WEEKLY)).get();
```

{% endtab %}

{% tab title="Python" %}

```python
from notbank_python_sdk.constants import ReportFrequency
from notbank_python_sdk.requests_models import ScheduleProfitAndLossActivityReportRequest

response = client.schedule_profit_and_loss_activity_report(
    ScheduleProfitAndLossActivityReportRequest(
        begin_time="2023-03-30T16:00:00.000Z",
        account_id_list=[185, 9],
        frequency=ReportFrequency.WEEKLY,
    ))
```

{% endtab %}

{% tab title="Json" %}

```json
{
  "m": 0,
  "i": 0,
  "n": "ScheduleProfitAndLossActivityReport",
  "o": "{
    \"OMSId\": 1,
    \"beginTime\": \"2023-03-30T16:00:00.000Z\",
    \"Frequency\": \"Weekly\",
    \"accountIdList\": [185, 9]
  }"
}
```

{% endtab %}
{% endtabs %}

| Key           | Value                                                                                                                                                                                                                                                                          |
| ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| frequency     | <p><strong>integer or string</strong>. How often the report will run and a profit and lost activity report get generated. One of:<br>- 0 Hourly<br>- 1 Daily<br>- 2 Weekly<br>- 3 Monthly<br>- 4 Annually<br>- 5 onDemand. Default is 0 Hourly. <strong>optional</strong>.</p> |
| accountIdList | **integer array**. Comma-separated integers; each element an account ID on the OMS whose profit and loss activity will be reported on. All accounts must be from the same OMS. **required**.                                                                                   |
| omsId         | **integer**. The ID of the OMS on which the accounts named in the list reside. **required**.                                                                                                                                                                                   |
| beginTime     | **string**. The time at which the periodic reports begin; the day and time when you want reporting to start, in Microsoft Ticks format. **required**.                                                                                                                          |

#### Response

```json
{
  "m": 1,
  "i": 0,
  "n": "ScheduleProfitAndLossActivityReport",
  "o": "{
    \"RequestingUser\": 1,
    \"OMSId\": 1,
    \"reportFlavor\": \"ProfitAndLoss\",
    \"createTime\": \"2023-12-06T09:04:05.944Z\",
    \"initialRunTime\": \"2023-12-06T09:04:05.944Z\",
    \"intervalStartTime\": \"2023-03-30T16:00:00.000Z\",
    \"intervalEndTime\": \"2023-04-06T16:00:00.000Z\",
    \"RequestStatus\": \"Submitted\",
    \"ReportFrequency\": \"Weekly\",
    \"intervalDuration\": 6048000000000,
    \"RequestId\": \"36197677-d103-e143-3b9c-a5ae8f17e093\",
    \"lastInstanceId\": \"00000000-0000-0000-0000-000000000000\",
    \"accountIds\": [9, 185]
  }"
}
```

| Key               | Value                                                                                                                                                                                                                                                                                                                                                 |
| ----------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| RequestingUser    | **integer**. The User ID of the person requesting the profit and loss activity report. This confirms the ID of the authenticated user who made the request by returning it as part of the response.                                                                                                                                                   |
| OMSId             | **integer**. The ID of the OMS on which the profit and loss activity report will be run.                                                                                                                                                                                                                                                              |
| reportFlavor      | **string**. The type of report to be generated. In the case of ScheduleProfitandLossActivityReport, report flavor will always be **ProfitAndLoss**                                                                                                                                                                                                    |
| createTime        | **string**. The time and date on which the request for the profit and loss activity report was made, in Microsoft Ticks format.                                                                                                                                                                                                                       |
| initialRunTime    | **string**. The time and date at which the profit and loss activity report was first run, in Microsoft Ticks format.                                                                                                                                                                                                                                  |
| intervalStartTime | **string**. The start of the period that the report will cover, in Microsoft Ticks format.                                                                                                                                                                                                                                                            |
| intervalEndTime   | **string**. The end of the period that the report will cover, in Microsoft Ticks format.                                                                                                                                                                                                                                                              |
| RequestStatus     | <p><strong>string</strong>. The status of the request for the profit and loss activity report. One of:<br>- Submitted<br>- Validating<br>- Scheduled<br>- InProgress<br>- Completed<br>- Aborting<br>- Aborted<br>- UserCancelled<br>- SysRetired<br>- UserCancelledPending</p>                                                                       |
| ReportFrequency   | <p><strong>string</strong>. When the report runs. One of:<br>- OnDemand<br>- Hourly<br>- Daily<br>- Weekly<br>- Monthly<br>- Annually</p>                                                                                                                                                                                                             |
| intervalDuration  | <p><strong>long integer</strong>. The period that the report covers relative to the run date, in POSIX format. The call specifies a start time and an <em>intervalDuration</em>.<br><br>In a scheduled report, the interval duration depends on the frequency, if the frequency is <strong>Weekly</strong>, the interval duration will be 1 week.</p> |
| RequestId         | **string**. The ID of the original request. Request IDs are long strings unique within the OMS.                                                                                                                                                                                                                                                       |
| lastInstanceId    | **string**. For scheduled reports, the report ID of the most recent previously run report.                                                                                                                                                                                                                                                            |
| accountIds        | **integer array**. A comma-delimited array of account IDs whose transactions are reported in the profit and loss activity report.                                                                                                                                                                                                                     |

### CancelUserReport

**Permissions:** NotbankTrading\
**Call Type:** Synchronous

Cancels a User Report. If successful, changes the state of a UserReportTicket to **UserCancelled**.

To get list of user reports that can be possibly cancelled, you can use the API method **GetUserReportTickets**.

#### Request

{% tabs %}
{% tab title="Node" %}

```javascript
import Notbank from 'notbank'
// websocket connection code ...

await client.getReportService().cancelUserReport({
  UserReportId: "389f244a-b958-4545-a4a7-61a73205b59e"
});

// parameters
{
  UserReportId: string;
}
```

{% endtab %}

{% tab title="Java" %}

```java
import java.util.UUID;
import exchange.notbank.report.paramBuilders.CancelUserReportParamBuilder;

var response = client.getReportService().cancelUserReport(
    new CancelUserReportParamBuilder(UUID.fromString("ff4b0469-17e9-49d5-bffc-ce137508a454"))).get();
```

{% endtab %}

{% tab title="Python" %}

```python
from notbank_python_sdk.requests_models import CancelUserReportRequest

response = client.cancel_user_report(CancelUserReportRequest(
    user_report_id="389f244a-b958-4545-a4a7-61a73205b59e"))
```

{% endtab %}

{% tab title="Json" %}

```json
{
  "m": 0,
  "i": 0,
  "n": "CancelUserReport",
  "o": "{
    \"UserReportId\":\"389f244a-b958-4545-a4a7-61a73205b59e\"
  }"
}
```

{% endtab %}
{% endtabs %}

| Key          | Value                                                                                                                                                                |
| ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| UserReportId | **string**. The GUID is a globally unique ID string that identifies the user report to be canceled. The OMS provides this ID when you create a report. **required**. |

#### Response

```json
{
  "m": 1,
  "i": 0,
  "n": "CancelUserReport",
  "o": "{
    \"result\": true,
    \"errormsg\": null,
    \"errorcode\": 0,
    \"detail\": null
  }"
}
```

The response to **CancelUserReport** verifies that the call was received, not that the user report has been canceled successfully. Individual event updates sent to the user show cancellations. To verify that a report has been canceled, call **GetUserReportTickets** or **GetUserReportWriterResultRecords**.

| Key       | Value                                                                                                                                                                                                                                                                                                                             |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| result    | **boolean**. A successful receipt of the cancellation returns true; and unsuccessful receipt of the cancellation (an error condition) returns false.                                                                                                                                                                              |
| errormsg  | **string**. A successful receipt of the cancellation returns null; the *errormsg* parameter for an unsuccessful receipt returns one of the following messages: Not Authorized (errorcode 20), Invalid Request (errorcode 100), Operation Failed (errorcode 101), Server Error (errorcode 102), Resource Not Found (errorcode 104) |
| errorcode | **integer**. A successful receipt of the cancellation returns 0. An unsuccessful receipt returns one of the *errorcodes* shown in the *errormsg* list.                                                                                                                                                                            |
| detail    | **string**. Message text that the system may send. Usually *null*.                                                                                                                                                                                                                                                                |

### GetUserReportWriterResultRecords

**Permissions:** NotbankTrading\
**Call Type:** Synchronous

Gets the execution records of reports requested by the User.

Users with NotbankTrading permission can request user report writer result records only for their own.

**Note:** "Depth" in this API method is the count of records to be returned, not market depth.

#### Request

{% tabs %}
{% tab title="Node" %}

```javascript
import Notbank from 'notbank'
// websocket connection code ...

await client.getReportService().getUserReportWriterResultRecords({
  UserId: 6
});

// parameters
{
  UserId: number;
  Depth?: number;
  StartIndex?: number;
}
```

{% endtab %}

{% tab title="Java" %}

```java
import exchange.notbank.report.paramBuilders.GetUserReportWriterResultRecordsParamBuilder;

var response = client.getReportService().getUserReportWriterResultRecords(
        new GetUserReportWriterResultRecordsParamBuilder(6)).get();
```

{% endtab %}

{% tab title="Python" %}

```python
from notbank_python_sdk.requests_models import GetUserReportWriterResultRecordsRequest

response = client.get_user_report_writer_result_records(
            GetUserReportWriterResultRecordsRequest(user_id=6))

```

{% endtab %}

{% tab title="Json" %}

```json
{
  "m": 0,
  "i": 0,
  "n": "GetUserReportWriterResultRecords",
  "o": "{
    \"UserId\": 6
  }"
}
```

{% endtab %}
{% endtabs %}

| Key        | Value                                                                                                                                                                                             |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| UserId     | **integer**. The ID of the user whose report writer result records will be returned. **required**.                                                                                                |
| Depth      | **integer**. The count of records to be returned, beginning at *startIndex* and working backwards into the past. If not defined, all report writer result records will be returned. **optional**. |
| StartIndex | **integer**. The record number at which the call starts returning records; from there, record return moves into the past. The most recent record is record is at startindex 0. **optional**.      |

#### Response

```json
{
  "m": 1,
  "i": 0,
  "n": "GetUserReportWriterResultRecords",
  "o": "[
    {
      \"RequestingUser\": 6,
      \"urtTicketId\": \"c2186954-3549-4214-99de-17281b0b7b02\",
      \"descriptorId\": \"0d24a8bd-1017-4f5a-acbb-eb41316411ca\",
      \"resultStatus\": \"SuccessComplete\",
      \"reportExecutionStartTime\": \"2023-03-30T07:16:30.949Z\",
      \"reportExecutionCompleteTime\": \"2023-03-30T07:16:30.954Z\",
      \"reportOutputFilePathname\": \"\",
      \"reportDescriptiveHeader\": \"TradeActivity|onDemand|2023-03-03T16:00:00.000Z|2023-03-04T16:00:00.000Z|2023-03-30T06:16:26.381Z|2023-03-30T07:16:30.949Z|0.00535 seconds\"
    }
  ]"
}
```

| Key                         | Value                                                                                                                                                                            |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| RequestingUser              | **integer**. The ID of the user requesting the report writer result records.                                                                                                     |
| urtTicketId                 | **string**. An alphanumeric string containing the unique report ID of the report.                                                                                                |
| descriptorId                | **string**. A GUID (globally-unique identifier) that describes the report separately from the report ticket.                                                                     |
| resultStatus                | <p><strong>string</strong>. The status of each run of the reports. One of:<br>- 0 NotStarted<br>- 1 NotComplete<br>- 2 ErrorComplete<br>- 3 SuccessComplete<br>- 4 Cancelled</p> |
| reportExecutionStartTime    | **string**. The time that the report writer began execution, in Microsoft Ticks format.                                                                                          |
| reportExecutionCompleteTime | **string**. The time that the report writer completed the report, in Microsoft Ticks format.                                                                                     |
| reportOutputFilePathname    | **string**. The pathname (location) of the report output file.                                                                                                                   |
| reportDescriptiveHeader     | **string**. A string describing the report.                                                                                                                                      |

### GetUserReportTickets

**Permissions:** NotbankTrading\
**Call Type:** Synchronous

Gets a list of user report tickets for a specific user ID. A user report ticket identifies a report requested or scheduled by a user. Reports can run once or periodically.

#### Request

{% tabs %}
{% tab title="Node" %}

```javascript
import Notbank from 'notbank'
// websocket connection code ...

await client.getReportService().getUserReportTickets({
  UserId: 6
});

// parameters
{
  UserId: number;
}
```

{% endtab %}

{% tab title="Java" %}

```java
import exchange.notbank.report.paramBuilders.GetUserReportTicketsParamBuilder;

var response = client.getReportService().getUserReportTickets(
        new GetUserReportTicketsParamBuilder(6)).get();
```

{% endtab %}

{% tab title="Python" %}

```python
from notbank_python_sdk.requests_models.get_user_report_tickets import GetUserReportTicketsRequest

response = client.get_user_report_tickets(
            GetUserReportTicketsRequest(user_id=6))
```

{% endtab %}

{% tab title="Json" %}

```json
{
  "m": 0,
  "i": 0,
  "n": "GetUserReportTickets",
  "o": "{
    \"UserId\":6
  }"
}
```

{% endtab %}
{% endtabs %}

| Key    | Value                                                                                     |
| ------ | ----------------------------------------------------------------------------------------- |
| UserId | **integer**. The ID of the user whose user report tickets will be returned. **required**. |

#### Response

```json
{
  "m": 1,
  "i": 0,
  "n": "GetUserReportTickets",
  "o": "[
    {
      \"RequestingUser\": 6,
      \"OMSId\": 1,
      \"reportFlavor\": \"TradeActivity\",
      \"createTime\": \"2023-03-16T02:18:27.597Z\",
      \"initialRunTime\": \"2023-03-16T02:18:27.596Z\",
      \"intervalStartTime\": \"2023-03-01T16:00:00.000Z\",
      \"intervalEndTime\": \"2023-03-03T16:00:00.000Z\",
      \"RequestStatus\": \"Completed\",
      \"ReportFrequency\": \"onDemand\",
      \"intervalDuration\": 1728000000000,
      \"RequestId\": \"0e3b96ac-c72c-4821-b124-b1d5c653e89f\",
      \"lastInstanceId\": \"00000000-0000-0000-0000-000000000000\",
      \"accountIds\": [9]
    },
    {
      \"RequestingUser\": 6,
      \"OMSId\": 1,
      \"reportFlavor\": \"TradeActivity\",
      \"createTime\": \"2023-03-16T02:42:48.647Z\",
      \"initialRunTime\": \"2023-03-16T02:42:48.646Z\",
      \"intervalStartTime\": \"2023-03-01T16:00:00.000Z\",
      \"intervalEndTime\": \"2023-03-02T16:00:00.000Z\",
      \"RequestStatus\": \"Completed\",
      \"ReportFrequency\": \"onDemand\",
      \"intervalDuration\": 864000000000,
      \"RequestId\": \"0f14b67b-8e80-43c3-b1ce-7c9146e645f8\",
      \"lastInstanceId\": \"00000000-0000-0000-0000-000000000000\",
      \"accountIds\": [9]
    }
  ]"
}
```

Returns an array of objects as a response, each object represents a report.

| Key               | Value                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| RequestingUser    | **integer**. The User ID of the person requesting the report.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| OMSId             | **integer**. The ID of the OMS on which the report was run.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| reportFlavor      | <p><strong>string</strong>. The type of report. One of<br>- Tradeactivity<br>- Transaction<br>- Treasury</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| createTime        | **string**. The time and date at which the request for the report was made, Microsoft Ticks format.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| initialRunTime    | **string**. The time and date at which the report was first run, Microsoft Ticks format.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| intervalStartTime | **string**. The start of the period that the report will cover, Microsoft Ticks format.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| intervalEndTime   | **string**. The end of the period that the report will cover, Microsoft Ticks format.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| RequestStatus     | <p><strong>string</strong>. The status of the request for the report. Each status returns one of:<br>- Submitted<br>- Validating<br>- Scheduled<br>- InProgress<br>- Completed<br>- Aborting<br>- Aborted<br>- UserCancelled<br>- SysRetired<br>- UserCancelPending</p>                                                                                                                                                                                                                                                                                                                                                                                       |
| ReportFrequency   | <p><strong>string</strong>. When the report runs:<br>- OnDemand<br>- Hourly<br>- Daily<br>- Weekly<br>- Monthly<br>- Annually</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| intervalDuration  | **long integer**. The period that the report looks backward relative to the run date, in POSIX format. The system calculates *intervalDuration* between *intervalStartTime* and *intervalEndTime* and reports it in POSIX format. For example, say that you specify a 90-day start-to-end-date window for a report. The *intervalDuration* value returns a value equivalent to 90 days and represents the backward-looking period of the report. Say that you have set up a weekly report to look back 90 days. When the report runs again in a week's time, it again looks back 90 days -- but now those 90 days are offset by a week from the first report. |
| RequestId         | **string**. The ID of the original request. Request IDs are long strings unique within the OMS.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| lastInstanceId    | **string**. For scheduled reports, the report ID of the most recent previously run report. This will be *null* for a Generate\~Report call, because generated reports are all on-demand.                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| accountIds        | **integer array**. A comma-delimited array of account IDs whose trades are reported in the trade activity report.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

### RemoveUserReportTicket

**Permissions:** NotbankTrading\
**Call Type:** Synchronous

Removes the specified user report ticket from processing.

#### Request

{% tabs %}
{% tab title="Node" %}

```javascript
import Notbank from 'notbank'
// websocket connection code ...

await client.getReportService().removeUserReportTicket({
  UserReportTicketId: "e27e5268-db50-70fa-de84-ee0b6ae16093"
});

// parameters
{
  UserReportTicketId: string
}
```

{% endtab %}

{% tab title="Java" %}

```java
import exchange.notbank.report.paramBuilders.RemoveUserReportTicketParamBuilder;

var response = client.getReportService().removeUserReportTicket(
        new RemoveUserReportTicketParamBuilder("e27e5268-db50-70fa-de84-ee0b6ae16093")).get();
```

{% endtab %}

{% tab title="Python" %}

```python
from notbank_python_sdk.requests_models import RemoveUserReportTicketRequest
response = client.remove_user_report_ticket(RemoveUserReportTicketRequest(
            "18066e61-5adf-61be-1203-eacbe6bb8905"))
```

{% endtab %}

{% tab title="Json" %}

```json
{
  "m": 0,
  "i": 0,
  "n": "RemoveUserReportTicket",
  "o": "{e27e5268-db50-70fa-de84-ee0b6ae16093}"
}
```

{% endtab %}
{% endtabs %}

The request payload doesn't have a fieldname, assigning the value to a field name will result to **Operation Failed** error. The only value that should be passed in the payload is the **UserReportTicketId** value.

#### Response

```json
{
  "m": 1,
  "i": 0,
  "n": "RemoveUserReportTicket",
  "o": "{
    \"result\": true,
    \"errormsg\": null,
    \"errorcode\": 0,
    \"detail\": null
  }"
}
```

| Key       | Value                                                                                                                                                                                                                                                                                                                                                        |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| result    | **boolean**. A successful request returns *true*; and unsuccessful request (an error condition) returns *false*.                                                                                                                                                                                                                                             |
| errormsg  | <p><strong>string</strong>. A successful request returns <em>null</em>; the <em>errormsg</em> parameter for an unsuccessful request returns one of the following messages:<br>Not Authorized (errorcode 20)<br>Invalid Request (errorcode 100)<br>Operation Failed (errorcode 101)<br>Server Error (errorcode 102)<br>Resource Not Found (errorcode 104)</p> |
| errorcode | **integer**. A successful request returns 0. An unsuccessful receipt returns one of the *errorcodes* shown in the *errormsg* list.                                                                                                                                                                                                                           |
| detail    | **string**. Additional message details sent by the system. Usually *null*.                                                                                                                                                                                                                                                                                   |

### GetUserReportTicketsByStatus

**Permissions:** NotbankTrading\
**Call Type:** Synchronous

Gets a list of user report tickets included in the list of statuses.

#### Request

{% tabs %}
{% tab title="Node" %}

```javascript
import Notbank from 'notbank'
// websocket connection code ...

await client.getReportService().getUserReportTicketsByStatus([
  { RequestStatus: "Submitted" },
  { RequestStatus: "Scheduled" }
]);

// parameters
{
  RequestStatus: ReportRequestStatus;
}

ReportRequestStatus {
  Submitted = "Submitted",
  Validating = "Validating",
  Scheduled = "Scheduled",
  InProgress = "InProgress",
  Completed = "Completed",
  Aborting = "Aborting",
  Aborted = "Aborted",
  UserCancelled = "UserCancelled",
  SysRetired = "SysRetired",
  Pending = "Pending",
  UserCancelPending = "UserCancelPending"
}
```

{% endtab %}

{% tab title="Java" %}

```java
import java.util.List;
import exchange.notbank.report.constants.ReportRequestStatus;
import exchange.notbank.report.paramBuilders.GetUserReportTicketsByStatusParamBuilder;

var response = client.getReportService().getUserReportTicketsByStatus(
        new GetUserReportTicketsByStatusParamBuilder(List.of(ReportRequestStatus.IN_PROGRESS, ReportRequestStatus.SCHEDULED))).get();
```

{% endtab %}

{% tab title="Python" %}

```python
from notbank_python_sdk.constants import ReportRequestStatus
from notbank_python_sdk.requests_models import GetUserReportTicketsByStatusRequest

response = client.get_user_report_tickets_by_status(GetUserReportTicketsByStatusRequest(
            request_statuses=[ReportRequestStatus.SUBMITTED, ReportRequestStatus.SCHEDULED]))
```

{% endtab %}

{% tab title="Json" %}

```json
{
  "m": 0,
  "i": 0,
  "n": "GetUserReportTicketsByStatus",
  "o": "[
    {
      \"RequestStatus\": \"Submitted\"
    },
    {
      \"RequestStatus\": \"Scheduled\"
    }
  ]"
}
```

{% endtab %}
{% endtabs %}

The request payload should be an array with object/s as its elements. The object field name should be RequestStatus. The default list consists of **Submitted** as the only RequestStatus.

| Key           | Value                                                                                                                                                                                                                                                                                              |
| ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| RequestStatus | <p><strong>string</strong>. The status of user report tickets you wish to retrieve. One of:<br>- Submitted<br>- Validating<br>- Scheduled<br>- InProgress<br>- Completed<br>- Aborting<br>- Aborted<br>- UserCancelled<br>- SysRetired<br>- UserCancelledPending<br><strong>required</strong>.</p> |

#### Response

```json
{
  "m": 1,
  "i": 0,
  "n": "GetUserReportTicketsByStatus",
  "o": "[
    {
      \"RequestingUser\": 15,
      \"OMSId\": 1,
      \"reportFlavor\": \"TradeActivity\",
      \"createTime\": \"2024-01-02T05:11:10.733Z\",
      \"initialRunTime\": \"2024-01-02T05:11:10.732Z\",
      \"intervalStartTime\": \"2024-01-01T16:00:00.000Z\",
      \"intervalEndTime\": \"2024-01-02T16:00:00.000Z\",
      \"RequestStatus\": \"Submitted\",
      \"ReportFrequency\": \"Daily\",
      \"intervalDuration\": 864000000000,
      \"RequestId\": \"11464174-60cd-afcc-29e8-00fab6e7d129\",
      \"lastInstanceId\": \"00000000-0000-0000-0000-000000000000\",
      \"accountIds\": [18]
    },
    {
      \"RequestingUser\": 28,
      \"OMSId\": 1,
      \"reportFlavor\": \"TradeActivity\",
      \"createTime\": \"2023-12-13T15:00:04.794Z\",
      \"initialRunTime\": \"2023-12-13T15:00:04.792Z\",
      \"intervalStartTime\": \"2024-01-01T22:00:00.000Z\",
      \"intervalEndTime\": \"2024-01-02T22:00:00.000Z\",
      \"RequestStatus\": \"Scheduled\",
      \"ReportFrequency\": \"Daily\",
      \"intervalDuration\": 864000000000,
      \"RequestId\": \"8f4e3a95-fed3-3823-d950-86c60550e816\",
      \"lastInstanceId\": \"00000000-0000-0000-0000-000000000000\",
      \"accountIds\": [32]
    }
  ]"
}
```

Returns an array of objects as a response, each object represents a user report ticket whose status matches the specificied status/es in the request.

| Key               | Value                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| RequestingUser    | **integer**. The User ID of the person requesting the report.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| OMSId             | **integer**. The ID of the OMS on which the report was run.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| reportFlavor      | <p><strong>string</strong>. The type of report. One of<br>- Tradeactivity<br>- Transaction<br>- Treasury</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| createTime        | **string**. The time and date at which the request for the report was made, Microsoft Ticks format.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| initialRunTime    | **string**. The time and date at which the report was first run, Microsoft Ticks format.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| intervalStartTime | **string**. The start of the period that the report will cover, Microsoft Ticks format.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| intervalEndTime   | **string**. The end of the period that the report will cover, Microsoft Ticks format.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| RequestStatus     | <p><strong>string</strong>. The status of the request, will be the specificied status/es in the request. Each status returns one of:<br>- Submitted<br>- Validating<br>- Scheduled<br>- InProgress<br>- Completed<br>- Aborting<br>- Aborted<br>- UserCancelled<br>- SysRetired<br>- UserCancelPending</p>                                                                                                                                                                                                                                                                                                                                                    |
| ReportFrequency   | <p><strong>string</strong>. When the report runs. One of:<br>- OnDemand<br>- Hourly<br>- Daily<br>- Weekly<br>- Monthly<br>- Annually</p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| intervalDuration  | **long integer**. The period that the report looks backward relative to the run date, in POSIX format. The system calculates *intervalDuration* between *intervalStartTime* and *intervalEndTime* and reports it in POSIX format. For example, say that you specify a 90-day start-to-end-date window for a report. The *intervalDuration* value returns a value equivalent to 90 days and represents the backward-looking period of the report. Say that you have set up a weekly report to look back 90 days. When the report runs again in a week's time, it again looks back 90 days -- but now those 90 days are offset by a week from the first report. |
| RequestId         | **string**. The ID of the original request. Request IDs are long strings unique within the OMS.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| lastInstanceId    | **string**. For scheduled reports, the report ID of the most recent previously run report. This will be *null* for a Generate\~Report call, because generated reports are all on-demand.                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| accountIds        | **integer array**. A comma-delimited array of account IDs whose trades are reported in the trade activity report.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

### DownloadDocument

**Permissions:** NotbankTrading\
**Call Type:** Synchronous

Download Document

#### Request

{% tabs %}
{% tab title="Node" %}

```javascript
import Notbank from 'notbank'
// websocket connection code ...

await client.getReportService().downloadDocument({
  DescriptorId: "66769552-cacd-471b-bb53-04b1ed1c87f9"
});

// parameters
{
  DescriptorId: string;
}
```

{% endtab %}

{% tab title="Java" %}

```java
import java.util.UUID;
import exchange.notbank.report.paramBuilders.DownloadDocumentParamBuilder;
var response = client.getReportService().downloadDocument(
        new DownloadDocumentParamBuilder(UUID.fromString("3108e502-ba32-f2b0-73b3-ffb0bd997390"))).get();
```

{% endtab %}

{% tab title="Python" %}

```python
from notbank_python_sdk.requests_models import DownloadDocumentRequest

response = client.download_document(DownloadDocumentRequest("3108e502-ba32-f2b0-73b3-ffb0bd997390"))
```

{% endtab %}

{% tab title="Json" %}

```json
{
  "m": 0,
  "i": 0,
  "n": "DownloadDocument",
  "o": "{
    \"DescriptorId\":\"66769552-cacd-471b-bb53-04b1ed1c87f9\"
  }"
}
```

{% endtab %}
{% endtabs %}

| Key          | Value                                                                                        |
| ------------ | -------------------------------------------------------------------------------------------- |
| DescriptorId | **string**. The GUID that uniquely identifies a report that can be downloaded. **required**. |

#### Response

```json
{
  "m": 1,
  "i": 0,
  "n": "DownloadDocument",
  "o": "{
    \"descriptorId\": \"66769552-cacd-471b-bb53-04b1ed1c87f9\",
    \"docName\": \"URM.6.onDemand.TradeActivity.9.2023-04-01T15.2023-04-17T15.66769552-cacd-471b-bb53-04b1ed1c87f9.csv\",
    \"numSlices\": 1,
    \"statusCode\": \"Success\",
    \"statusMessage\": \"success\"
  }"
}

```

| Key           | Value                                                                          |
| ------------- | ------------------------------------------------------------------------------ |
| DescriptorId  | **string**. The GUID that uniquely identifies a report that can be downloaded. |
| DocName       | **string**. The actual filename of the document stored in the server.          |
| NumSlices     | **integer**. The number of slices.                                             |
| statusCode    | **string**. One of: **Success**, **Error**.                                    |
| statusMessage | **string**. One of: **success**, **error**.                                    |

### DownloadDocumentSlice

**Permissions:** NotbankTrading\
**Call Type:** Synchronous

Download Document Slice.

#### Request

{% tabs %}
{% tab title="Node" %}

```javascript
import Notbank from 'notbank'
// websocket connection code ...

await client.getReportService().downloadDocumentSlice({
  DescriptorId: "66769552-cacd-471b-bb53-04b1ed1c87f9",
  sliceNum: 0
});

// parameters
{
  DescriptorId: string;
  sliceNum?: number;
}
```

{% endtab %}

{% tab title="Java" %}

```java
import exchange.notbank.report.paramBuilders.DownloadDocumentSliceParamBuilder;

var response = client.getReportService().downloadDocumentSlice(
        new DownloadDocumentSliceParamBuilder("66769552-cacd-471b-bb53-04b1ed1c87f9").sliceNum(0)).get();
```

{% endtab %}

{% tab title="Python" %}

```python
from notbank_python_sdk.requests_models import DownloadDocumentSliceRequest

response = client.download_document_slice(DownloadDocumentSliceRequest(
            "66769552-cacd-471b-bb53-04b1ed1c87f9", 0))
```

{% endtab %}

{% tab title="Json" %}

```json
{
  "m": 0,
  "i": 0,
  "n": "DownloadDocumentSlice",
  "o": "{
    \"DescriptorId\":\"66769552-cacd-471b-bb53-04b1ed1c87f9\",
    \"sliceNum\": 0
  }"
}
```

{% endtab %}
{% endtabs %}

| Key          | Value                                                                                        |
| ------------ | -------------------------------------------------------------------------------------------- |
| DescriptorId | **string**. The GUID that uniquely identifies a report that can be downloaded. **required**. |
| sliceNum     | **integer**. Default is 0. **optional**.                                                     |

#### Response

```json
{
  "m": 1,
  "i": 0,
  "n": "DownloadDocumentSlice",
  "o": "{
    \"descriptorId\": \"66769552-cacd-471b-bb53-04b1ed1c87f9\",
    \"base64Bytes\": \"IlJlZ2lzdGVyZWRFbnRpdHlJZCIsIlRyYW5zUmVwb3J0S...\",
    \"statusCode\": \"Success\",
    \"statusMessage\": \"Success\"
  }"
}
```

| Key           | Value                                                                          |
| ------------- | ------------------------------------------------------------------------------ |
| DescriptorId  | **string**. The GUID that uniquely identifies a report that can be downloaded. |
| base64Bytes   | **string**. The actual contents of the document in base64 format.              |
| statusCode    | **string**. One of: **Success**, **Error**.                                    |
| statusMessage | **string**. One of: **success**, **error**.                                    |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.notbank.com/learn/api-reference/websocket-api/report.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
