# Organization Transactions

## Fetch Organization Transactions

Retrieve all transactions in a specific organization, according to an organization ID, Wallet ID and specific asset (ID).

```graphql
query Transaction($where: TransactionWhereUniqueInput!) {
  transaction(where: $where) {
    id
    amount
    blockchain {
      name
      code
    }
    createdAt
    createdBy {
      fullName
    }
    fee
    note
    status {
      status
    }
    wallet {
      name
      id
    }
    financialAsset {
      code
    }
    isAccelerated
    priority
    rateUSD
    rateEUR
    kyt
  }
}
```

### **Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <token>`   |

### **Body (**<mark style="color:orange;">TransactionWhereUniqueInput</mark> object)

| Name                                 | Type   | Description    |
| ------------------------------------ | ------ | -------------- |
| id<mark style="color:red;">\*</mark> | string | Transaction ID |

Example body:

```json
{
  "where": {
    "id": "clllyfhdj00w9btqke47wsesf"
  }
}
```

### Response

Return values:

| Name                  | Type    | Description                                                                                                                                                             |
| --------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| id                    | String  | Transaction ID                                                                                                                                                          |
| amount                | Integer | Transaction Amount                                                                                                                                                      |
| name (blockchain)     | String  | Blockchain Name                                                                                                                                                         |
| id (blockchain)       | String  | Blockchain ID                                                                                                                                                           |
| createdAt             | String  | Creation Time of Transaction                                                                                                                                            |
| fullName (createdBy)  | String  | Full Name of the User Created the Transaction                                                                                                                           |
| fee                   | Integer | Fee Amount                                                                                                                                                              |
| note                  | String  | Tranasaction Note (can be empty)                                                                                                                                        |
| status                | String  | Status                                                                                                                                                                  |
| name (wallet)         | String  | Wallet Name                                                                                                                                                             |
| id (wallet)           | String  | Wallet ID                                                                                                                                                               |
| code (financialAsset) | String  | FinancialAsset Code (i.e - "ETH" / "BTC")                                                                                                                               |
| isAccelerated         | Boolean | Flag that indicates wether the transaction is [accelerated](https://docs.inabit.com/api-reference/develop-with-inabit-api/organizations/broken-reference). (true/false) |
| priority              | String  | <p>Transaction Priority<br>(Slow, Medium, Fast, etc.)</p>                                                                                                               |
| rateUSD               | Integer | Asset Rate at the time of the transaction (in USD)                                                                                                                      |
| rateEUR               | Integer | Asset Rate at the time of the Transaction (in Euro)                                                                                                                     |
| kyt                   | String  | <p>KYT (Know-Your-Transaction) risk score.<br>0 - Worst score<br>10 - Best Score</p>                                                                                    |

{% tabs %}
{% tab title="🟢 Success" %}

```json
{
  "data": {
    "transaction": {
      "id": "clllyfhdj00w9btqke47wsesf",
      "amount": 941.93,
      "blockchain": {
        "name": "Ethereum",
        "code": "ETH"
      },
      "createdAt": "2023-08-22T06:58:14.071Z",
      "createdBy": null,
      "fee": 1.36,
      "note": "Voluptas nihil dolorem qui explicabo libero earum.",
      "status": {
        "status": "Pending"
      },
      "wallet": {
        "name": "Organization Wallet 4",
        "id": "clllyfexn00h0btqkyed7tgqg"
      },
      "financialAsset": {
        "code": "ETH"
      },
      "isAccelerated": false,
      "priority": "Fast",
      "rateUSD": 3640.44,
      "rateEUR": 3351.94,
      "kyt": 4
    }
  }
```

{% endtab %}

{% tab title="🔴 Failure" %}

```json
{
  "errors": [
    {
      "message": "Unauthorized",
      "extensions": {
        "code": "UNAUTHENTICATED",
        "response": {
          "statusCode": 401,
          "message": "Unauthorized"
        }
      }
    }
  ],
  "data": {
    "transaction": null
  }
}
```

{% endtab %}
{% endtabs %}

### Try it out!

{% embed url="<https://studio.apollographql.com/sandbox/explorer?endpoint=https://api.inabit.app/graphql&explorerURLState=N4IgJg9gxgrgtgUwHYBcQC4QEcYIE4CeABACp4CGSAzuVCgJYTUAUAJAO4AW+C6pF1WgyYB1bngQBJJAAcYKAJRFgAHSREiKATTqMWXHnw7iES1eo1FycCDFRrLRAEYAbaAGsoncvXXnHGlAQYAgOlgC+YRoAZr6UUPTkLgCCVFQIKMpRlkEh2ZEWGu4EKNlUKOQoMFRZhZblldX52UGoQgDChDIoEMlQQXaZ-gFI1qF1BY5U7OQyqekoJBC1AUS5446T9TMyS8k2g1FhBeEg4UA>" %}
