Skip to main content

Overview

The Trades API allows you to manage trades for investment and cryptocurrency accounts. Trades represent buy/sell transactions of securities like stocks, ETFs, crypto, and other financial instruments.

List trades

curl -X GET "https://api.sure.app/v1/trades?account_id=3&start_date=2024-01-01" \
  -H "X-Api-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json"
Retrieve a paginated list of trades with optional filtering.

Query parameters

page
integer
default:"1"
Page number for pagination
per_page
integer
default:"25"
Number of trades per page (max 100)
account_id
integer
Filter by single account ID
account_ids
array
Filter by multiple account IDs
start_date
string
Filter trades on or after this date (YYYY-MM-DD)
end_date
string
Filter trades on or before this date (YYYY-MM-DD)

Response

trades
array
Array of trade objects
pagination
object
Pagination metadata
{
  "trades": [
    {
      "id": 501,
      "date": "2024-01-10",
      "amount": "$1,750.00",
      "currency": "USD",
      "name": "Buy 10 shares of AAPL",
      "notes": null,
      "qty": 10,
      "price": "$175.00",
      "investment_activity_label": "Buy",
      "account": {
        "id": 3,
        "name": "Vanguard 401(k)",
        "account_type": "investment"
      },
      "security": {
        "id": 100,
        "ticker": "AAPL",
        "name": "Apple Inc."
      },
      "category": null,
      "created_at": "2024-01-10T09:30:00Z",
      "updated_at": "2024-01-10T09:30:00Z"
    },
    {
      "id": 502,
      "date": "2024-01-15",
      "amount": "$875.00",
      "currency": "USD",
      "name": "Sell 5 shares of AAPL",
      "notes": "Rebalancing portfolio",
      "qty": -5,
      "price": "$175.00",
      "investment_activity_label": "Sell",
      "account": {
        "id": 3,
        "name": "Vanguard 401(k)",
        "account_type": "investment"
      },
      "security": {
        "id": 100,
        "ticker": "AAPL",
        "name": "Apple Inc."
      },
      "category": null,
      "created_at": "2024-01-15T14:00:00Z",
      "updated_at": "2024-01-15T14:00:00Z"
    }
  ],
  "pagination": {
    "page": 1,
    "per_page": 25,
    "total_count": 2,
    "total_pages": 1
  }
}

Investment activity labels

Trades can be tagged with activity labels for better categorization:
LabelDescription
BuyPurchase of securities
SellSale of securities
Sweep InAutomatic cash sweep into account
Sweep OutAutomatic cash sweep out of account
DividendDividend payment
ReinvestmentDividend reinvestment
InterestInterest earned
FeeAccount or trade fee
TransferTransfer between accounts
ContributionAccount contribution
WithdrawalAccount withdrawal
ExchangeCurrency or security exchange
OtherOther activity

Account requirements

Trades can only be created for accounts that support them:
  • Investment accounts: Always support trades
  • Crypto accounts: Only support trades if subtype is “exchange”
  • Other account types: Do not support trades

Build docs developers (and LLMs) love