# Tax transactions

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

Lists tax-relevant transactions done by the user within the Bare Bitcoin platform.
 Note that this does NOT include any of the third party transactions imported into
 the platform tax calculator.

## Authentication

x-bb-api-key: Public part of your API key. Starts with `bb/public/`.

Or:

OAuth: Authorization: Bearer <access token>. Required scopes: api:tax:transactions:read.

[API keys and signing](https://barebitcoin.no/developers/authentication/api-keys)

## Parameters

### pageSize

query parameter · integer · int32

Items per page (max 200). When set to 0, all matching transactions are returned.

### after

query parameter · string · date-time

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.

### afterId

query parameter · 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.

### before

query parameter · string · date-time

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



## Examples

### API key

```sh
curl -X GET \
  https://api.bb.no/v1/tax/transactions \
  -H "x-bb-api-key: $BB_API_KEY"
```


### OAuth

```sh
curl -X GET \
  https://api.bb.no/v1/tax/transactions \
  -H "Authorization: Bearer $BB_TOKEN"
```



## Responses

### 200

OK

Example:

```json
{
  "transactions": [
    {
      "id": "tr_01HVXHG9PMDKR3YQV4Z8W5T2BN",
      "accountId": "acc_01HQZX3V9KJ4M2P8R6T0W5Y7BC",
      "type": "TAX_TRANSACTION_TYPE_BTC_BUY",
      "subType": "market",
      "createTime": "2024-02-01T10:22:36Z",
      "finalizeTime": "2024-02-01T10:41:05Z",
      "inAmount": "0.1",
      "inCurrency": "BTC",
      "outAmount": "65000",
      "outCurrency": "NOK",
      "feeAmount": "455",
      "feeCurrency": "NOK",
      "rateMarket": "645450",
      "isPayment": false,
      "paymentInfo": "f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16:bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4",
      "note": "Første kjøp",
      "usdnok": "10.45",
      "runningBalanceBtc": "1.8997585"
    }
  ],
  "hasMore": true,
  "nextAfter": "2024-02-01T10:22:36Z",
  "nextAfterId": "tr_01HVXHG9PMDKR3YQV4Z8W5T2BN"
}
```

[ListTaxTransactionsResponse](https://barebitcoin.no/developers/models/ListTaxTransactionsResponse).

Source: https://barebitcoin.no/developers/api/tax/transactions


## Model: ListTaxTransactionsResponse





### transactions

Type: array of TaxTransaction.





Items: [TaxTransaction](https://barebitcoin.no/developers/models/TaxTransaction).

### hasMore

Type: boolean.

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





### nextAfter

Type: string · date-time.

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





### nextAfterId

Type: string.

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





## Model: TaxTransaction





### id

Type: string.

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_ and adjustments abj_ or apj_. 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.





### accountId

Type: string.

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





### type

Type: string · enum.



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



### subType

Type: string.

Sub-type of the transaction. Which values apply depends on the type:
 trades carry the order type, bitcoin transfers the network, fiat deposits
 the payment method and adjustments the reason. 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, unspecified



### createTime

Type: string · date-time.







### finalizeTime

Type: string · date-time.

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





### inAmount

Type: string.

Stringified decimal number





### inCurrency

Type: string.







### outAmount

Type: string.

Stringified decimal number. Includes trade fees; withdrawal fees are
 additional.





### outCurrency

Type: string.







### feeAmount

Type: string.

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





### feeCurrency

Type: string.







### rateMarket

Type: string.

Stringified decimal number: the market rate in NOK per BTC at the time of
 the transaction.





### isPayment

Type: boolean.

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





### paymentInfo

Type: string.

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





### note

Type: string.

Free-form user-supplied description.





### usdnok

Type: string.

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





### runningBalanceBtc

Type: string.

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



