US Transaction History

Longbridge US Accounts

This method is only available for US data-center accounts.

Get the transaction history of a US account (deposits and withdrawals, trades, corporate actions, transfers, margin financing, and so on), one page at a time.

Request

HTTP MethodPOST
HTTP URL/v1/us/assets/transaction-history

Parameters

Content-Type: application/json; charset=utf-8

The SDK method takes start_at and end_at (date-time values) instead of start and end; the other parameters use the same names.

NameTypeRequiredDescription
startintegerYESStart time (Unix seconds), inclusive
endintegerYESEnd time (Unix seconds), inclusive
pageintegerNOPage number, starting at 1 (default: 1)
sizeintegerNOPage size (default: 20)
typesstring[]NOTransaction types to include; omit for all types. See Transaction Types
currencystringNOCurrency filter, e.g. USD; omit for all currencies

Transaction Types

ValueDescription
TT_DEPOSIT_AND_WITHDRAWALDeposits and withdrawals
TT_STOCKS_AND_ETFS_TRADINGStock and ETF trading
TT_OPTIONS_TRADINGOption trading
TT_CRYPTO_TRADINGCrypto trading
TT_CORPORATE_ACTIONCorporate actions
TT_TRANSFER_IN_AND_OUTTransfers in and out
TT_CRYPTO_TRANSFERCrypto transfers
TT_MARGIN_FINANCINGMargin financing
TT_OTHEROther

Request Example

from datetime import datetime, timezone
from longbridge.openapi import TradeContext, Config, OAuthBuilder

oauth = OAuthBuilder("your-client-id").build(lambda url: print("Visit:", url))
config = Config.from_oauth(oauth)
ctx = TradeContext(config)
resp = ctx.us_transaction_history(
    start_at=datetime(2026, 1, 1, tzinfo=timezone.utc),
    end_at=datetime(2026, 3, 31, 23, 59, 59, tzinfo=timezone.utc),
    page=1,
    size=20,
    types=["TT_DEPOSIT_AND_WITHDRAWAL", "TT_STOCKS_AND_ETFS_TRADING"],
)
print(resp)
import asyncio
from datetime import datetime, timezone
from longbridge.openapi import AsyncTradeContext, Config, OAuthBuilder

async def main() -> None:
    oauth = await OAuthBuilder("your-client-id").build_async(lambda url: print("Visit:", url))
    config = Config.from_oauth(oauth)
    ctx = AsyncTradeContext.create(config)
    resp = await ctx.us_transaction_history(
        start_at=datetime(2026, 1, 1, tzinfo=timezone.utc),
        end_at=datetime(2026, 3, 31, 23, 59, 59, tzinfo=timezone.utc),
        page=1,
        size=20,
        types=["TT_DEPOSIT_AND_WITHDRAWAL", "TT_STOCKS_AND_ETFS_TRADING"],
    )
    print(resp)

if __name__ == "__main__":
    asyncio.run(main())
const { Config, TradeContext, OAuth } = require('longbridge')

async function main() {
  const oauth = await OAuth.build('your-client-id', (_, url) => {
    console.log('Open this URL to authorize: ' + url)
  })
  const config = Config.fromOAuth(oauth)
  const ctx = TradeContext.new(config)
  const resp = await ctx.usTransactionHistory({
    startAt: new Date('2026-01-01T00:00:00Z'),
    endAt: new Date('2026-03-31T23:59:59Z'),
    page: 1,
    size: 20,
    types: ['TT_DEPOSIT_AND_WITHDRAWAL', 'TT_STOCKS_AND_ETFS_TRADING'],
  })
  console.log(resp)
}
main().catch(console.error)
use std::sync::Arc;
use longbridge::{
    oauth::OAuthBuilder,
    trade::{GetUSTransactionHistoryOptions, TradeContext},
    Config,
};
use time::macros::datetime;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let oauth = OAuthBuilder::new("your-client-id").build(|url| println!("Open: {url}")).await?;
    let config = Arc::new(Config::from_oauth(oauth));
    let ctx = TradeContext::new(config);
    let mut opts = GetUSTransactionHistoryOptions::new(
        datetime!(2026-01-01 0:00 UTC),
        datetime!(2026-03-31 23:59:59 UTC),
    );
    opts.types = vec![
        "TT_DEPOSIT_AND_WITHDRAWAL".to_string(),
        "TT_STOCKS_AND_ETFS_TRADING".to_string(),
    ];
    let resp = ctx.us_transaction_history(opts).await?;
    println!("{:?}", resp);
    Ok(())
}
package main

import (
	"context"
	"fmt"
	"log"
	"time"

	"github.com/longbridge/openapi-go/config"
	"github.com/longbridge/openapi-go/oauth"
	"github.com/longbridge/openapi-go/trade"
)

func main() {
	o := oauth.New("your-client-id").
		OnOpenURL(func(url string) { fmt.Println("Open this URL to authorize:", url) })
	if err := o.Build(context.Background()); err != nil {
		log.Fatal(err)
	}
	conf, err := config.New(config.WithOAuthClient(o))
	if err != nil {
		log.Fatal(err)
	}
	c, err := trade.NewFromCfg(conf)
	if err != nil {
		log.Fatal(err)
	}
	defer c.Close()
	resp, err := c.USTransactionHistory(context.Background(), &trade.GetUSTransactionHistory{
		StartAt: time.Date(2026, 1, 1, 0, 0, 0, 0, time.UTC),
		EndAt:   time.Date(2026, 3, 31, 23, 59, 59, 0, time.UTC),
		Page:    1,
		Size:    20,
		Types:   []string{"TT_DEPOSIT_AND_WITHDRAWAL", "TT_STOCKS_AND_ETFS_TRADING"},
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Printf("%+v\n", resp)
}

Response

The response does not include a total count. A page with fewer items than size is the last page.

In the HTTP API, create_at and done_at are Unix seconds encoded as numeric strings (for example "1790203596"); the SDKs convert them to date-time values.

Response Example

{
  "current_page": 1,
  "items": [
    {
      "title": "VA Sell Success: ETHUSD",
      "biz_code": "LVASAD",
      "biz_code_name": "VA Sell Success",
      "amount": "1185.42",
      "currency": "USD",
      "symbol": "ETHUSD.BKKT",
      "counter_id": "VA/BKKT/ETHUSD",
      "market": "BKKT",
      "equity_type": "CRYPTO",
      "position_side": "LONG",
      "quantity": "0.3",
      "quantity_description": "0.3 ETH",
      "ref_no": "202609240001",
      "remark": "",
      "create_at": "1790203596",
      "done_at": "1790203596"
    },
    {
      "title": "Cryptocurrency Deposit: BTCUSD",
      "biz_code": "LVAVNSCR",
      "biz_code_name": "Cryptocurrency Deposit",
      "amount": "0",
      "currency": "",
      "symbol": "BTCUSD.BKKT",
      "counter_id": "VA/BKKT/BTCUSD",
      "market": "BKKT",
      "equity_type": "CRYPTO",
      "position_side": "LONG",
      "quantity": "0.01",
      "quantity_description": "0.01 BTC",
      "ref_no": "202610090001",
      "remark": "",
      "create_at": "1791478565",
      "done_at": "1791478565"
    }
  ]
}

Response Status

StatusDescriptionSchema
200SuccessUSTransactionHistory
400Bad requestNone

Schemas

USTransactionHistory

NameTypeRequiredDescription
current_pageintegertrueCurrent page number
itemsUSTransaction[]trueRecords on this page

USTransaction

NameTypeDescription
titlestringDisplay title, e.g. VA Sell Success: ETHUSD
biz_codestringBusiness code, e.g. LVASAD. See Business Codes
biz_code_namestringDisplay name of the business code, e.g. VA Sell Success
amountstringAmount
currencystringCurrency, e.g. USD; may be empty, e.g. for a crypto deposit
symbolstringSecurity symbol in TICKER.MARKET form, e.g. MULL.US or BTCUSD.BKKT, when the record relates to a security. Crypto symbols carry the .BKKT suffix here, unlike crypto_list in US Asset Overview, which returns the bare BTCUSD
counter_idstringInternal security identifier returned alongside symbol, e.g. VA/BKKT/BTCUSD. Returned by the HTTP API; the SDK types may not expose it
marketstringMarket, e.g. US or BKKT
equity_typestringHolding type, e.g. STOCK, OPTION, CRYPTO
position_sidestringPosition side: LONG | SHORT
quantitystringQuantity
quantity_descriptionstringQuantity description
ref_nostringReference number
remarkstringRemark
create_atstringCreation time, Unix seconds as a numeric string. The SDKs return a date-time value
done_atstringCompletion time, Unix seconds as a numeric string. The SDKs return a date-time value

Business Codes

biz_code identifies the kind of record. Values seen in production include:

biz_codeDescription
LVABADCrypto buy filled (biz_code_name: VA Buy Success)
LVASADCrypto sell filled (biz_code_name: VA Sell Success)
LVAVNSCRCrypto deposit (biz_code_name: Cryptocurrency Deposit)
LCSTBDSeen in production; use biz_code_name for its display name
LCWDSeen in production; use biz_code_name for its display name

The list is not exhaustive, and other codes may appear. title and biz_code_name are display text whose language can vary, so use biz_code in program logic.