# Pix Internal Transaction Report

A Pix Internal Transaction Report lets Direct and Indirect participants report transactions that were settled internally on the participant, such as transfers between two Indirect participants of the same Direct participant or between accounts of the same participant.

Here we will show you how to create and manage them.

### The Pix Internal Transaction Report Object

**Attributes**

| Name | Type | Description |
| --- | --- | --- |
| `id` | STRING | Unique id for the Pix internal transaction report. |
| `referenceType` | STRING | Origin of the report's reference id. Options: "request" (derived from endToEndId), "reversal" (derived from returnId). |
| `amount` | INTEGER | Transaction amount in cents. Example: 100 (R$1.00). |
| `endToEndId` | STRING | End-to-end id of the reported Pix transaction. |
| `returnId` | STRING | Return id of the reported transaction. Present when referenceType is "reversal". |
| `method` | STRING | Type of the reported transaction. Options: "manual", "dict", "initiator", "dynamicQrcode", "staticQrcode", "payerQrcode", "subscription", "contactless", "staticContactless". |
| `senderBankCode` | STRING | Bank ISPB code of the sender. |
| `senderBranchCode` | STRING | Branch code of the sender's bank account. |
| `senderAccountNumber` | STRING | Account number of the sender. |
| `senderAccountType` | STRING | Account type of the sender. Options: "checking", "savings", "salary", "payment", "other". |
| `senderTaxId` | STRING | CPF or CNPJ of the sender. |
| `receiverBankCode` | STRING | Bank ISPB code of the receiver. |
| `receiverBranchCode` | STRING | Branch code of the receiver's bank account. |
| `receiverAccountNumber` | STRING | Account number of the receiver. |
| `receiverAccountType` | STRING | Account type of the receiver. Options: "checking", "savings", "salary", "payment", "other". |
| `receiverTaxId` | STRING | CPF or CNPJ of the receiver. |
| `receiverKeyId` | STRING | Pix key of the receiver, when the transaction used one. |
| `status` | STRING | Current status of the report. Options: "created", "processing", "success", "failed". |
| `created` | STRING | Datetime of the original transaction, supplied at creation. Example: "2020-04-23T23:00:00.000000+00:00". |
| `updated` | STRING | Last update datetime. Example: "2020-04-23T23:00:00.000000+00:00". |

### Create Pix Internal Transaction Reports

`POST /v2/pix-internal-transaction-report`

Report transactions that were settled internally on the participant, such as transfers between two Indirect participants of the same Direct participant or between accounts of the same participant.

You can create up to 100 reports in a single request.

**Parameters**

| Name | Required | Description |
| --- | --- | --- |
| `referenceType` | REQUIRED | Origin of the report's reference id. Options: "request" (use with endToEndId), "reversal" (use with returnId). |
| `amount` | REQUIRED | Transaction amount in cents. Example: 100 (R$1.00). |
| `endToEndId` | REQUIRED | End-to-end id of the reported Pix transaction. |
| `method` | REQUIRED | Type of the reported transaction. Options: "manual", "dict", "initiator", "dynamicQrcode", "staticQrcode", "payerQrcode", "subscription", "contactless", "staticContactless". |
| `created` | REQUIRED | Datetime of the original transaction. |
| `senderBankCode` | REQUIRED | Bank ISPB code of the sender. |
| `senderBranchCode` | REQUIRED | Branch code of the sender's bank account. |
| `senderAccountNumber` | REQUIRED | Account number of the sender. |
| `senderAccountType` | REQUIRED | Account type of the sender. Options: "checking", "savings", "salary", "payment", "other". |
| `senderTaxId` | REQUIRED | CPF or CNPJ of the sender. |
| `receiverBankCode` | REQUIRED | Bank ISPB code of the receiver. |
| `receiverBranchCode` | REQUIRED | Branch code of the receiver's bank account. |
| `receiverAccountNumber` | REQUIRED | Account number of the receiver. |
| `receiverAccountType` | REQUIRED | Account type of the receiver. Options: "checking", "savings", "salary", "payment", "other". |
| `receiverTaxId` | REQUIRED | CPF or CNPJ of the receiver. |
| `returnId` | OPTIONAL | Return id of the reported transaction. Required when referenceType is "reversal". |
| `receiverKeyId` | OPTIONAL | Pix key of the receiver, when the transaction used one. |

**Request**

```python
import starkinfra

reports = starkinfra.pixinternaltransactionreport.create([
    starkinfra.PixInternalTransactionReport(
        reference_type="request",
        amount=1000,
        end_to_end_id="E20018183202201011000r01",
        method="manual",
        created="2022-01-01T00:00:00+00:00",
        sender_bank_code="34052649",
        sender_branch_code="0001",
        sender_account_number="00000-0",
        sender_account_type="checking",
        sender_tax_id="012.345.678-90",
        receiver_bank_code="20018183",
        receiver_branch_code="0001",
        receiver_account_number="10000-0",
        receiver_account_type="checking",
        receiver_tax_id="20.018.183/0001-80",
        receiver_key_id="20.018.183/0001-80"
    )
])

for report in reports:
    print(report)
```

**Response**

```python
[
    PixInternalTransactionReport(
        id="5656565656565656",
        reference_type="request",
        amount=1000,
        end_to_end_id="E20018183202201011000r01",
        return_id="",
        method="manual",
        sender_bank_code="34052649",
        sender_branch_code="0001",
        sender_account_number="00000-0",
        sender_account_type="checking",
        sender_tax_id="012.345.678-90",
        receiver_bank_code="20018183",
        receiver_branch_code="0001",
        receiver_account_number="10000-0",
        receiver_account_type="checking",
        receiver_tax_id="20.018.183/0001-80",
        receiver_key_id="20.018.183/0001-80",
        status="created",
        created="2022-01-01T00:00:00+00:00",
        updated="2022-01-01T00:00:00+00:00"
    )
]
```

### List Pix Internal Transaction Reports

`GET /v2/pix-internal-transaction-report`

List and filter all Pix internal transaction reports. Results are paged.

**Parameters**

| Name | Required | Description |
| --- | --- | --- |
| `after` | OPTIONAL | Filter entities created after this date. |
| `before` | OPTIONAL | Filter entities created before this date. |
| `cursor` | OPTIONAL | String used to get the next batch of results. |
| `ids` | OPTIONAL | List of ids to get specific entities. Max = 100. |
| `limit` | OPTIONAL | Number of results per cursor. Max = 100. |
| `status` | OPTIONAL | Filter by status. Options: "created", "processing", "success", "failed". |
| `referenceIds` | OPTIONAL | Filter by reference ids (endToEndId or returnId). Max = 30. |
| `referenceTypes` | OPTIONAL | Filter by reference types. Options: "request", "reversal". Max = 30. |
| `fields` | OPTIONAL | List of strings to filter response JSON keys. Not available in the SDKs. |

**Request**

```python
import starkinfra

reports = starkinfra.pixinternaltransactionreport.query(
    limit=10,
    after="2022-01-01",
    before="2022-12-31",
    status=["success"],
    ids=["5656565656565656"]
)

for report in reports:
    print(report)
```

**Response**

```python
<generator object query at 0x...>

PixInternalTransactionReport(
    id="5656565656565656",
    reference_type="request",
    amount=1000,
    end_to_end_id="E20018183202201011000r01",
    method="manual",
    status="success",
    created="2022-01-01T00:00:00+00:00",
    updated="2022-01-01T00:00:00+00:00"
)
```

### Get a Pix Internal Transaction Report

`GET /v2/pix-internal-transaction-report/:id`

Get a single Pix internal transaction report by its id.

**Parameters**

| Name | Required | Description |
| --- | --- | --- |
| `id` | REQUIRED | Id of the Pix internal transaction report entity. |
| `fields` | OPTIONAL | List of strings to filter response JSON keys. Not available in the SDKs. |

**Request**

```python
import starkinfra

report = starkinfra.pixinternaltransactionreport.get("5656565656565656")

print(report)
```

**Response**

```python
PixInternalTransactionReport(
    id="5656565656565656",
    reference_type="request",
    amount=1000,
    end_to_end_id="E20018183202201011000r01",
    return_id="",
    method="manual",
    sender_bank_code="34052649",
    sender_branch_code="0001",
    sender_account_number="00000-0",
    sender_account_type="checking",
    sender_tax_id="012.345.678-90",
    receiver_bank_code="20018183",
    receiver_branch_code="0001",
    receiver_account_number="10000-0",
    receiver_account_type="checking",
    receiver_tax_id="20.018.183/0001-80",
    receiver_key_id="20.018.183/0001-80",
    status="success",
    created="2022-01-01T00:00:00+00:00",
    updated="2022-01-01T00:00:00+00:00"
)
```

### List Pix Internal Transaction Report Logs

`GET /v2/pix-internal-transaction-report/log`

Get a paged list of all Pix internal transaction report logs.

**Parameters**

| Name | Required | Description |
| --- | --- | --- |
| `after` | OPTIONAL | Filter entities created after this date. |
| `before` | OPTIONAL | Filter entities created before this date. |
| `cursor` | OPTIONAL | String used to get the next batch of results. |
| `ids` | OPTIONAL | Filter by log ids. |
| `limit` | OPTIONAL | Number of results per cursor. Max = 100. |
| `types` | OPTIONAL | Filter logs by log types. Options: "created", "sent", "success", "failed". |
| `reportIds` | OPTIONAL | Filter logs by Pix internal transaction report ids. |

**Request**

```python
import starkinfra

logs = starkinfra.pixinternaltransactionreport.log.query(
    limit=10,
    after="2022-01-01",
    before="2022-12-31",
    types=["success"],
    report_ids=["5656565656565656"]
)

for log in logs:
    print(log)
```

**Response**

```python
Log(
    id="6767676767676767",
    type="success",
    errors=[],
    report=PixInternalTransactionReport(
        id="5656565656565656",
        reference_type="request",
        amount=1000,
        end_to_end_id="E20018183202201011000r01",
        return_id="",
        method="manual",
        sender_bank_code="34052649",
        sender_branch_code="0001",
        sender_account_number="00000-0",
        sender_account_type="checking",
        sender_tax_id="012.345.678-90",
        receiver_bank_code="20018183",
        receiver_branch_code="0001",
        receiver_account_number="10000-0",
        receiver_account_type="checking",
        receiver_tax_id="20.018.183/0001-80",
        receiver_key_id="20.018.183/0001-80",
        status="success",
        created="2022-01-01T00:00:00+00:00",
        updated="2022-01-01T00:00:00+00:00"
    ),
    created="2022-01-01T00:01:00+00:00"
)
```

### Get a Pix Internal Transaction Report Log

`GET /v2/pix-internal-transaction-report/log/:id`

Get a single Pix internal transaction report log by its id.

**Parameters**

| Name | Required | Description |
| --- | --- | --- |
| `id` | REQUIRED | Id of the log entity. |

**Request**

```python
import starkinfra

log = starkinfra.pixinternaltransactionreport.log.get("6767676767676767")

print(log)
```

**Response**

```python
Log(
    id="6767676767676767",
    type="success",
    errors=[],
    report=PixInternalTransactionReport(
        id="5656565656565656",
        reference_type="request",
        amount=1000,
        end_to_end_id="E20018183202201011000r01",
        return_id="",
        method="manual",
        sender_bank_code="34052649",
        sender_branch_code="0001",
        sender_account_number="00000-0",
        sender_account_type="checking",
        sender_tax_id="012.345.678-90",
        receiver_bank_code="20018183",
        receiver_branch_code="0001",
        receiver_account_number="10000-0",
        receiver_account_type="checking",
        receiver_tax_id="20.018.183/0001-80",
        receiver_key_id="20.018.183/0001-80",
        status="success",
        created="2022-01-01T00:00:00+00:00",
        updated="2022-01-01T00:00:00+00:00"
    ),
    created="2022-01-01T00:01:00+00:00"
)
```

## Available Languages

Code samples on this page are in Python. The same content is available with samples in:

- [Python](https://docs.starkinfra.com/api/v2/pix-internal-transaction-report-python.md)
- [Node.js](https://docs.starkinfra.com/api/v2/pix-internal-transaction-report-node.md)
- [PHP](https://docs.starkinfra.com/api/v2/pix-internal-transaction-report-php.md)
- [Java](https://docs.starkinfra.com/api/v2/pix-internal-transaction-report-java.md)
- [Ruby](https://docs.starkinfra.com/api/v2/pix-internal-transaction-report-ruby.md)
- [Elixir](https://docs.starkinfra.com/api/v2/pix-internal-transaction-report-elixir.md)
- [.NET](https://docs.starkinfra.com/api/v2/pix-internal-transaction-report-dotnet.md)
- [Go](https://docs.starkinfra.com/api/v2/pix-internal-transaction-report-go.md)
- [Clojure](https://docs.starkinfra.com/api/v2/pix-internal-transaction-report-clojure.md)
- [cURL](https://docs.starkinfra.com/api/v2/pix-internal-transaction-report-curl.md)
