# SnapTrade

> Read connected brokerage accounts, positions, balances, orders and activity.

App · 16 actions. Web page: https://docs.lodol.com/docs/integrations/snaptrade

## Actions

### Get account details

Get account details in SnapTrade.

**Inputs**

- Account (`account_id`, text, required): Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.

**Outputs**

- `data` (object): The response from SnapTrade.

**Example output**

```json
{
  "data": {
    "brokerage_authorization": "example",
    "id": "example",
    "institution_name": "example",
    "name": "example",
    "number": "example"
  }
}
```

### Get account order

Get account order in SnapTrade.

**Inputs**

- Account (`account_id`, text, required): Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.
- Brokerage order ID (`brokerage_order_id`, text, required): Order ID returned by brokerage. This is the unique identifier for the order in the brokerage system.

**Outputs**

- `data` (object): The response from SnapTrade.

**Example output**

```json
{
  "data": {
    "brokerage_order_id": "example",
    "canceled_quantity": "example",
    "execution_price": "example",
    "expiry_date": "example",
    "filled_quantity": "example",
    "group": {
      "id": "example",
      "role": {}
    },
    "legs": [
      {
        "action": "example",
        "canceled_quantity": "example",
        "execution_price": "example",
        "filled_quantity": "example",
        "instrument": {},
        "leg_id": "example",
        "status": {},
        "total_quantity": "example"
      }
    ],
    "open_quantity": "example",
    "order_type": {
      "kind": "example",
      "limit_price": "example",
      "raw_type": "example",
      "stop_price": "example",
      "trail": {
        "amount": "example",
        "type": "example"
      }
    },
    "price_effect": {},
    "priced_in": {},
    "status": "example",
    "time_executed": "example",
    "time_in_force": "example",
    "time_placed": "example",
    "time_updated": "example",
    "total_quantity": "example"
  }
}
```

### Get brokerage connection

Get brokerage connection in SnapTrade.

**Inputs**

- Authorization (`authorization_id`, text, required): Unique identifier for the connection (brokerage_authorization_id). This is the UUID used to reference the connection in SnapTrade.

**Outputs**

- `data` (object): The response from SnapTrade.

**Example output**

```json
{
  "data": {
    "brokerage": {
      "allows_fractional_units": true,
      "allows_trading": true,
      "aws_s3_logo_url": "example",
      "aws_s3_square_logo_url": "example",
      "brokerage_type": {
        "id": "example",
        "name": "example"
      },
      "description": "example",
      "display_name": "example",
      "enabled": true,
      "exchanges": [
        {}
      ],
      "has_reporting": true,
      "id": "example",
      "is_degraded": true,
      "is_real_time_connection": true,
      "maintenance_mode": true,
      "name": "example",
      "open_url": "example",
      "slug": "example",
      "url": "example"
    },
    "created_date": "example",
    "data_freshness_mode": {
      "institution": "example",
      "snaptrade": "example"
    },
    "disabled": true,
    "disabled_date": "example",
    "id": "example",
    "is_eligible_for_payout": true,
    "meta": {},
    "name": "example",
    "type": "example",
    "updated_date": "example"
  }
}
```

### Get detailed account balances

Get detailed account balances in SnapTrade.

**Inputs**

- Account (`account_id`, text, required): Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.

**Outputs**

- `data` (object): The response from SnapTrade.

**Example output**

```json
{
  "data": {
    "account_id": "example",
    "buying_power": [
      {
        "amount": "example",
        "basis": "example",
        "currency": "example"
      }
    ],
    "cash": [
      {
        "amount": "example",
        "currency": "example"
      }
    ],
    "cash_or_margin": "example",
    "data_freshness": {
      "as_of": "example"
    },
    "margin": {
      "loan_balances": [
        {}
      ]
    },
    "net_value": {
      "amount": "example",
      "currency": "example"
    }
  }
}
```

### Get equity quotes

Get equity quotes in SnapTrade.

**Inputs**

- Symbols (`symbols`, list, required): List of Universal Symbol IDs or tickers to get quotes for. When providing multiple values, use a comma as separator. Maximum of 10 values allowed
- Use ticker (`use_ticker`, true/false): Should be set to `True` if `symbols` are comprised of tickers. Defaults to `False` if not provided.
- Account (`account_id`, text, required): Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.

**Outputs**

- `data` (list): The response from SnapTrade.

**Example output**

```json
{
  "data": [
    {
      "ask_price": 1,
      "ask_size": 1,
      "bid_price": 1,
      "bid_size": 1,
      "last_trade_price": 1,
      "symbol": {
        "currencies": [
          {}
        ],
        "currency": {},
        "description": "example",
        "exchange": {},
        "figi_code": "example",
        "figi_instrument": {},
        "id": "example",
        "raw_symbol": "example",
        "symbol": "example",
        "type": {}
      }
    }
  ]
}
```

### Get security by ticker

Get security by ticker in SnapTrade.

**Inputs**

- Query (`query`, text, required): The ticker or Universal Symbol ID to look up the symbol with.

**Outputs**

- `data` (object): The response from SnapTrade.

**Example output**

```json
{
  "data": {
    "currencies": [
      {
        "code": "example",
        "id": "example",
        "name": "example"
      }
    ],
    "currency": {
      "code": "example",
      "id": "example",
      "name": "example"
    },
    "description": "example",
    "exchange": {
      "close_time": "example",
      "code": "example",
      "id": "example",
      "mic_code": "example",
      "name": "example",
      "start_time": "example",
      "suffix": "example",
      "timezone": "example"
    },
    "figi_code": "example",
    "figi_instrument": {
      "figi_code": "example",
      "figi_share_class": "example"
    },
    "id": "example",
    "raw_symbol": "example",
    "symbol": "example",
    "type": {
      "code": "example",
      "description": "example",
      "id": "example",
      "is_supported": true
    }
  }
}
```

### List account activity

List account activity in SnapTrade.

**Inputs**

- Account (`account_id`, text, required): Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.
- Start date (`start_date`, date): The start date (inclusive) of the transaction history to retrieve. If not provided, the default is the first transaction known to SnapTrade based on `trade_date`.
- End date (`end_date`, date): The end date (inclusive) of the transaction history to retrieve. If not provided, the default is the last transaction known to SnapTrade based on `trade_date`.
- Offset (`offset`, number): An integer that specifies the starting point of the paginated results. Default is 0. At least 0.
- Limit (`limit`, number): An integer that specifies the maximum number of transactions to return. Default of 1000. At least 1.
- Type (`type`, text): Optional comma separated list of transaction types to filter by. SnapTrade does a best effort to categorize brokerage transaction types into a common set of values. Here are some of the most popular values: - `BUY` - Asset bought. - `SELL` - Asset sold. - `DIVIDEND` - Dividend payout. - `SUBSTITUTE_DIVIDEND` - Payment in lieu of a dividend. - `CAPITAL_GAINS_LONG` - Long-term capital-gain distribut

**Outputs**

- `data` (object): The response from SnapTrade.

**Example output**

```json
{
  "data": {
    "data": [
      {
        "amount": 1,
        "currency": {},
        "currency_universal_symbol": {},
        "description": "example",
        "external_reference_id": "example",
        "fee": 1,
        "fx_rate": 1,
        "id": "example",
        "institution": "example",
        "instrument": {},
        "option_symbol": {},
        "option_type": "example",
        "price": 1,
        "settlement_date": "example",
        "symbol": {},
        "trade_date": "example",
        "type": "example",
        "units": 1
      }
    ],
    "pagination": {
      "limit": 1,
      "offset": 1,
      "total": 1
    }
  }
}
```

### List account balances

List account balances in SnapTrade.

**Inputs**

- Account (`account_id`, text, required): Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.

**Outputs**

- `data` (list): The response from SnapTrade.

**Example output**

```json
{
  "data": [
    {
      "buying_power": 1,
      "cash": 1,
      "currency": {
        "code": "example",
        "id": "example",
        "name": "example"
      }
    }
  ]
}
```

### List account orders

List account orders in SnapTrade.

**Inputs**

- State (`state`, text): defaults to "all". One of: `all`, `open`, `executed`.
- Days (`days`, number): Number of days in the past to fetch the most recent orders. Defaults to the last 30 days if no value is passed in. Values greater than 90 will be capped at 90. From 1 to 90.
- Account (`account_id`, text, required): Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.

**Outputs**

- `data` (object): The response from SnapTrade.

**Example output**

```json
{
  "data": {
    "data_freshness": {
      "as_of": "example"
    },
    "results": [
      {
        "brokerage_order_id": "example",
        "canceled_quantity": "example",
        "execution_price": "example",
        "expiry_date": "example",
        "filled_quantity": "example",
        "group": {},
        "legs": [
          {}
        ],
        "open_quantity": "example",
        "order_type": {},
        "price_effect": {},
        "priced_in": {},
        "status": "example",
        "time_executed": "example",
        "time_in_force": "example",
        "time_placed": "example",
        "time_updated": "example",
        "total_quantity": "example"
      }
    ]
  }
}
```

### List account positions

List account positions in SnapTrade.

**Inputs**

- Account (`account_id`, text, required): Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.

**Outputs**

- `data` (object): The response from SnapTrade.

**Example output**

```json
{
  "data": {
    "data_freshness": {
      "as_of": "example"
    },
    "results": [
      {
        "cash_equivalent": true,
        "cost_basis": "example",
        "currency": "example",
        "instrument": {},
        "price": "example",
        "tax_lots": [
          {}
        ],
        "units": "example"
      }
    ]
  }
}
```

### List accounts for a connection

List accounts for a connection in SnapTrade.

**Inputs**

- Brokerage connection (`brokerage_connection_id`, text, required): Unique identifier for the connection (brokerage_authorization_id). This is the UUID used to reference the connection in SnapTrade.

**Outputs**

- `data` (object): The response from SnapTrade.

**Example output**

```json
{
  "data": {
    "results": [
      {
        "available_credit": {},
        "cash_or_margin": "example",
        "connection_id": "example",
        "display_name": "example",
        "funding_date": "example",
        "id": {},
        "institution_account_id": "example",
        "institution_id": "example",
        "is_paper": true,
        "kind": "example",
        "masked_account_number": "example",
        "minimum_payment_amount": {},
        "net_value": {},
        "next_payment_date": "example",
        "opening_date": "example",
        "raw_type": "example",
        "status": "example",
        "sync_status": {}
      }
    ]
  }
}
```

### List brokerage accounts

List brokerage accounts in SnapTrade.

**Inputs**: None.

**Outputs**

- `data` (object): The response from SnapTrade.

**Example output**

```json
{
  "data": {
    "results": [
      {
        "available_credit": {},
        "cash_or_margin": "example",
        "connection_id": "example",
        "display_name": "example",
        "funding_date": "example",
        "id": {},
        "institution_account_id": "example",
        "institution_id": "example",
        "is_paper": true,
        "kind": "example",
        "masked_account_number": "example",
        "minimum_payment_amount": {},
        "net_value": {},
        "next_payment_date": "example",
        "opening_date": "example",
        "raw_type": "example",
        "status": "example",
        "sync_status": {}
      }
    ]
  }
}
```

### List brokerage connections

List brokerage connections in SnapTrade.

**Inputs**: None.

**Outputs**

- `data` (list): The response from SnapTrade.

**Example output**

```json
{
  "data": [
    {
      "brokerage": {
        "allows_fractional_units": true,
        "allows_trading": true,
        "aws_s3_logo_url": "example",
        "aws_s3_square_logo_url": "example",
        "brokerage_type": {},
        "description": "example",
        "display_name": "example",
        "enabled": true,
        "exchanges": [
          {}
        ],
        "has_reporting": true,
        "id": "example",
        "is_degraded": true,
        "is_real_time_connection": true,
        "maintenance_mode": true,
        "name": "example",
        "open_url": "example",
        "slug": "example",
        "url": "example"
      },
      "created_date": "example",
      "data_freshness_mode": {
        "institution": "example",
        "snaptrade": "example"
      },
      "disabled": true,
      "disabled_date": "example",
      "id": "example",
      "is_eligible_for_payout": true,
      "meta": {},
      "name": "example",
      "type": "example",
      "updated_date": "example"
    }
  ]
}
```

### List historical account values

List historical account values in SnapTrade.

**Inputs**

- Account (`account_id`, text, required): Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.

**Outputs**

- `data` (object): The response from SnapTrade.

**Example output**

```json
{
  "data": {
    "currency": "example",
    "history": [
      {
        "date": "example",
        "total_value": "example"
      }
    ]
  }
}
```

### Search account symbols

Search account symbols in SnapTrade.

**Inputs**

- Account (`account_id`, text, required): Unique identifier for the connected brokerage account. This is the UUID used to reference the account in SnapTrade.
- Substring (`substring`, text): The search query for symbols.

**Outputs**

- `data` (list): The response from SnapTrade.

**Example output**

```json
{
  "data": [
    {
      "currencies": [
        {}
      ],
      "currency": {
        "code": "example",
        "id": "example",
        "name": "example"
      },
      "description": "example",
      "exchange": {
        "close_time": "example",
        "code": "example",
        "id": "example",
        "mic_code": "example",
        "name": "example",
        "start_time": "example",
        "suffix": "example",
        "timezone": "example"
      },
      "figi_code": "example",
      "figi_instrument": {
        "figi_code": "example",
        "figi_share_class": "example"
      },
      "id": "example",
      "raw_symbol": "example",
      "symbol": "example",
      "type": {
        "code": "example",
        "description": "example",
        "id": "example",
        "is_supported": true
      }
    }
  ]
}
```

### Search securities

Search securities in SnapTrade.

**Inputs**

- Substring (`substring`, text): The search query for symbols.

**Outputs**

- `data` (list): The response from SnapTrade.

**Example output**

```json
{
  "data": [
    {
      "currencies": [
        {}
      ],
      "currency": {
        "code": "example",
        "id": "example",
        "name": "example"
      },
      "description": "example",
      "exchange": {
        "close_time": "example",
        "code": "example",
        "id": "example",
        "mic_code": "example",
        "name": "example",
        "start_time": "example",
        "suffix": "example",
        "timezone": "example"
      },
      "figi_code": "example",
      "figi_instrument": {
        "figi_code": "example",
        "figi_share_class": "example"
      },
      "id": "example",
      "raw_symbol": "example",
      "symbol": "example",
      "type": {
        "code": "example",
        "description": "example",
        "id": "example",
        "is_supported": true
      }
    }
  ]
}
```
