Skip to content
Bare BitcoinDevelopers

Search documentation

↑ ↓ Select · Enter Open · Escape Close

barebitcoin.no ↗
Menu

API reference / Tax

Tax transactions

Lists tax-relevant transactions done by the user within the Bare Bitcoin platform, oldest first: trades, bitcoin deposits and withdrawals, NOK deposits and withdrawals, bonuses and adjustments. Note that this does NOT include any of the third party transactions imported into the platform tax calculator. When hasMore is true, pass nextAfter and nextAfterId as after and afterId to fetch the next page.

View Markdown

GET https://api.bb.no/v1/tax/transactions

Authentication

API key

Send x-bb-api-key. No nonce or signature is required.

OAuth

Send an access token in Authorization: Bearer.

Required scopes:

api:tax:transactions:read
Authentication guide →

MCP

Also available as the MCP tool list_tax_transactions, which takes the parameters below as its arguments.

MCP server guide →

Parameters

pageSizequery · integer

Items per page (max 200). When set to 0, all matching transactions are returned, except through MCP, where it defaults to 50.

afterquery · string

Transactions are listed oldest first (required to compute running_balance_btc correctly), so pagination walks forward in time. Only return transactions created after this time. Can be used standalone to filter down to a start date; pass next_after from the previous response (together with next_after_id) to fetch the next page.

afterIdquery · string

Pagination cursor tiebreaker: when multiple transactions share the same create_time, this ID breaks the tie. Pass next_after_id from the previous response. Requires 'after'; supplying 'after_id' alone is rejected.

beforequery · string

Only return transactions created strictly before this time. Filter only, does not affect pagination direction.

Responses

200 · OK

application/json
ListTaxTransactionsResponse
Show fields
transactionsarray of TaxTransaction
Items:
TaxTransaction
Show fields
idstring

ID of the underlying transaction; its format depends on the type. Trades use the trade ID (tr_), bitcoin deposits de_, bonuses gb_, fiat withdrawals fpu_, adjustments abj_ or apj_, and costs the payment ID (in_ or pi_). Bitcoin withdrawals and card deposits use a UUID, which is not the withdrawal_id returned by the transfer endpoints. Bank deposits use the bank's reference.

Example: "tr_01HVXHG9PMDKR3YQV4Z8W5T2BN"

accountIdstring

The bitcoin account the transaction belongs to. Empty for fiat deposits and fiat withdrawals, which are not tied to an account.

Example: "acc_01HQZX3V9KJ4M2P8R6T0W5Y7BC"

typestring · enum

The kind of transaction, and the fields it fills. Each value has the prefix TAX_TRANSACTION_TYPE_. - BTC_BUY: a buy of BTC with NOK. In: BTC. Out: NOK. Fee: NOK, the trade fee plus the payment method fee. Sub-type: "market", "limit" or "manual". - BTC_SELL: a sale of BTC for NOK. In: NOK. Out: BTC. Fee: BTC. Sub-type: "market", "limit" or "manual". - BTC_WITHDRAWAL: BTC sent from the account. Out: BTC, without fees. Fee: BTC, the network fee plus the service fee. Sub-type: "onchain", "lightning", "internal" or "internal-external". - BTC_DEPOSIT: BTC received into the account. In: BTC. Sub-type: "onchain", "internal", "internal-external", "lightning-payment-request", "lightning-address" or "lightning-lnurl". - BTC_BONUS: BTC that Bare Bitcoin gave to the user. In: BTC. No sub-type. - FIAT_DEPOSIT: NOK paid in. In: NOK. Sub-type: "bank" or "card". - FIAT_WITHDRAWAL: NOK paid out to a bank account. Out: NOK. Fee: NOK, when not zero. No sub-type. - BTC_ADJUSTMENT: a manual change to a BTC balance by Bare Bitcoin. No trade occurred. In: BTC for an increase. Out: BTC for a decrease. Sub-type: "write_off" for a debt that Bare Bitcoin will not collect, "correction" for a wrong balance, or "unspecified". - FIAT_ADJUSTMENT: a manual change to the NOK balance by Bare Bitcoin. In: NOK for an increase. Out: NOK for a decrease. Sub-types as for BTC_ADJUSTMENT. - COST: a deductible cost paid in NOK. Out: NOK. Sub-type: "bb_plus".

Values: TAX_TRANSACTION_TYPE_BTC_BUY, TAX_TRANSACTION_TYPE_BTC_SELL, TAX_TRANSACTION_TYPE_BTC_WITHDRAWAL, TAX_TRANSACTION_TYPE_BTC_DEPOSIT, TAX_TRANSACTION_TYPE_BTC_BONUS, TAX_TRANSACTION_TYPE_FIAT_DEPOSIT, TAX_TRANSACTION_TYPE_FIAT_WITHDRAWAL, TAX_TRANSACTION_TYPE_BTC_ADJUSTMENT, TAX_TRANSACTION_TYPE_FIAT_ADJUSTMENT, TAX_TRANSACTION_TYPE_COST

subTypestring

Sub-type of the transaction. The type field lists the sub-types of each type. Empty when the transaction has no sub-type.

Values: , market, limit, manual, onchain, lightning, internal, internal-external, lightning-payment-request, lightning-address, lightning-lnurl, bank, card, write_off, correction, bb_plus, unspecified

Example: "market"

createTimestring · date-time

Example: "2024-02-01T10:22:36Z"

finalizeTimestring · date-time

Unset while the transaction is still pending, e.g. a bitcoin deposit that is not yet confirmed.

Example: "2024-02-01T10:41:05Z"

inAmountstring

Stringified decimal number: the amount the user received. "0" when the type has no in side. The type field shows the sides of each type.

Example: "0.1"

inCurrencystring

"BTC" or "NOK". Empty when the type has no in side.

Example: "BTC"

outAmountstring

Stringified decimal number: the amount the user paid. "0" when the type has no out side. Includes trade fees; withdrawal fees are additional.

Example: "65000"

outCurrencystring

"BTC" or "NOK". Empty when the type has no out side.

Example: "NOK"

feeAmountstring

Stringified decimal number. When the fee is zero, fee_currency may be empty.

Example: "455"

feeCurrencystring

Example: "NOK"

rateMarketstring

Stringified decimal number: the market rate in NOK per BTC at the time of the transaction. "0" for fiat transfers, adjustments and costs.

Example: "645450"

isPaymentboolean

Whether the transaction was a payment to a third party, as declared by the user. Only ever set for bitcoin withdrawals.

Example: false

paymentInfostring

For bitcoin transfers: `<network ID>:<destination address>`. For bank fiat transfers: the counterparty bank account number. Empty for card deposits, trades and bonuses.

Example: "f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16:bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4"

notestring

Free-form user-supplied description.

Example: "Første kjøp"

usdnokstring

Stringified decimal number: the USD/NOK exchange rate at the time of the transaction, when known.

Example: "10.45"

runningBalanceBtcstring

Stringified decimal number: the user's total BTC balance across all accounts after this transaction.

Example: "1.8997585"

hasMoreboolean

True if there are more transactions available after the last one returned.

nextAfterstring · date-time

Cursor for the next page: pass this as 'after' in the next request.

Example: "2024-02-01T10:22:36Z"

nextAfterIdstring

Tiebreaker for the cursor: pass this as 'after_id' in the next request.

Example: "tr_01HVXHG9PMDKR3YQV4Z8W5T2BN"