Skip to main content

Transactions

An account's transaction history: deposits, withdrawals, trades, staking, rewards and fees. Each transaction lists the assets that moved, as parts that were sent or received, and its fees, each with its fiat value.

Like Accounts, every call is made for one user, with that user's token.

Endpoints​

EndpointReturns
GET /accounts/{account_id}/transactions
user.transactions.getList({ accountId, ... })
A page of the account's transactions.
GET /accounts/{account_id}/transactions/{tx_id}
user.transactions.getOne({ accountId, txId })
One transaction.

Every field and filter is in the API reference.

Filters and pagination​

ParameterUse
from, toThe date range, as YYYY-MM-DD. Without from, older transactions are left out: for the full history, pass a date before the account's first transaction.
tickerOnly transactions involving this asset, for example BTC.
walletOnly this wallet's transactions: a wallet id from the account.
typesOnly these types, comma-separated, for example trade,deposit.
limitThe page size: 100 by default, 1,000 at most.
lastWhere the page starts: the id of the last transaction on the previous page. Empty for the first page.
sortasc or desc, by date.
exclude_fieldsFields to leave out of the response, comma-separated, for example other_parties,transaction_hash.

Get every transaction​

Page through the history with last, starting with an empty value:

const accountId = '613f3f9fe9b200002a0cc768';
const transactions = [];

// A date before the account's first transaction. If unsure, use a very early one.
const from = '2009-01-01';
const limit = 100;
let last = '';

while (true) {
const page = await user.transactions.getList({ accountId, from, last, limit });

if (!page.length) break;

transactions.push(...page);
// The next page starts after this page's last transaction.
last = page[page.length - 1].id;
}

Stop when a page comes back empty, not when it is shorter than limit. Vezgo keeps both sides of a trade on the same page, so a page can hold fewer transactions than you asked for.

The transaction object​

A trade on an exchange: USD sent, BTC received, and a fee.

{
"id": "613f3fac965d03004f6cf7a7",
"resource_type": "transaction",
"transaction_type": "trade",
"transaction_subtype": "buy",
"initiated_at": 1631535020587,
"confirmed_at": 1631535020587,
"wallet": "coinbase:cash:usd",
"parts": [
{
"direction": "sent",
"ticker": "USD",
"provider_ticker": "USD",
"amount": "1000",
"fiat_ticker": "USD",
"fiat_value": "1000"
},
{
"direction": "received",
"ticker": "BTC",
"provider_ticker": "BTC",
"amount": "0.02225",
"fiat_ticker": "USD",
"fiat_value": "1000"
}
],
"fees": [
{
"ticker": "USD",
"provider_ticker": "USD",
"amount": "4.99",
"fiat_ticker": "USD",
"fiat_value": "4.99",
"resource_type": "transaction_fee"
}
],
"misc": {},
"fiat_calculated_at": 1631535020587
}
FieldWhat it is
idThe transaction ID. Use it as last to page.
transaction_typeWhat happened: see Transaction types.
transaction_subtypeMore detail, for example onchain_deposit, buy or staking_reward. Can be null.
partsThe assets that moved. Each has a direction (sent or received), a ticker, an amount and a fiat_value, and for blockchains the from_address and to_address.
feesWhat the transaction cost, each with a ticker, an amount and a fiat_value.
initiated_at, confirmed_atWhen the transaction started and was confirmed, in milliseconds since the epoch. confirmed_at is null until it is.
walletThe wallet the transaction belongs to.
transaction_hashThe blockchain transaction hash, for on-chain transactions.
miscDetails specific to the provider. See the FAQ.

Amounts and fiat values are strings, so they keep their full precision. How fiat values are calculated is in the FAQ.

Transaction types​

transaction_typeUsual parts
depositOne part, received.
withdrawalOne part, sent.
tradeTwo parts: one sent, one received.
stakingTwo parts: the base asset sent, the staked asset received.
unstakingTwo parts: the staked asset sent, the base asset received.
rewardOne part, received: staking, learning and other rewards.
bonusOne part, received: airdrops, referral bonuses and similar.
otherAnything else.

Which types, subtypes and wallets each provider produces is on its status page, under Data mapping: for example vezgo.com/status/coinbase-api.

Missing transactions​

If an account's history looks incomplete, check from and your pagination first. Other causes, such as API keys without permission to read transactions, are in the FAQ.