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.
SDK Links
Python |
Rust |
Go |
Node.js |
Java |
C++ |
Request
| HTTP Method | POST |
| HTTP URL | /v1/us/assets/transaction-history |
Parameters
Content-Type: application/json; charset=utf-8
The SDK method takes
start_atandend_at(date-time values) instead ofstartandend; the other parameters use the same names.
| Name | Type | Required | Description |
|---|---|---|---|
| start | integer | YES | Start time (Unix seconds), inclusive |
| end | integer | YES | End time (Unix seconds), inclusive |
| page | integer | NO | Page number, starting at 1 (default: 1) |
| size | integer | NO | Page size (default: 20) |
| types | string[] | NO | Transaction types to include; omit for all types. See Transaction Types |
| currency | string | NO | Currency filter, e.g. USD; omit for all currencies |
Transaction Types
| Value | Description |
|---|---|
TT_DEPOSIT_AND_WITHDRAWAL | Deposits and withdrawals |
TT_STOCKS_AND_ETFS_TRADING | Stock and ETF trading |
TT_OPTIONS_TRADING | Option trading |
TT_CRYPTO_TRADING | Crypto trading |
TT_CORPORATE_ACTION | Corporate actions |
TT_TRANSFER_IN_AND_OUT | Transfers in and out |
TT_CRYPTO_TRANSFER | Crypto transfers |
TT_MARGIN_FINANCING | Margin financing |
TT_OTHER | Other |
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
| Status | Description | Schema |
|---|---|---|
| 200 | Success | USTransactionHistory |
| 400 | Bad request | None |
Schemas
USTransactionHistory
| Name | Type | Required | Description |
|---|---|---|---|
| current_page | integer | true | Current page number |
| items | USTransaction[] | true | Records on this page |
USTransaction
| Name | Type | Description |
|---|---|---|
| title | string | Display title, e.g. VA Sell Success: ETHUSD |
| biz_code | string | Business code, e.g. LVASAD. See Business Codes |
| biz_code_name | string | Display name of the business code, e.g. VA Sell Success |
| amount | string | Amount |
| currency | string | Currency, e.g. USD; may be empty, e.g. for a crypto deposit |
| symbol | string | Security 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_id | string | Internal security identifier returned alongside symbol, e.g. VA/BKKT/BTCUSD. Returned by the HTTP API; the SDK types may not expose it |
| market | string | Market, e.g. US or BKKT |
| equity_type | string | Holding type, e.g. STOCK, OPTION, CRYPTO |
| position_side | string | Position side: LONG | SHORT |
| quantity | string | Quantity |
| quantity_description | string | Quantity description |
| ref_no | string | Reference number |
| remark | string | Remark |
| create_at | string | Creation time, Unix seconds as a numeric string. The SDKs return a date-time value |
| done_at | string | Completion 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_code | Description |
|---|---|
LVABAD | Crypto buy filled (biz_code_name: VA Buy Success) |
LVASAD | Crypto sell filled (biz_code_name: VA Sell Success) |
LVAVNSCR | Crypto deposit (biz_code_name: Cryptocurrency Deposit) |
LCSTBD | Seen in production; use biz_code_name for its display name |
LCWD | Seen 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.