# API overview Bare Bitcoin public REST API. Production base URL: https://api.bb.no ## Bitcoin transfers Deposit destinations, invoices, and withdrawals. - [Deposit destinations](https://barebitcoin.no/developers/api/transfers/deposit-destinations): GET /v1/deposit-destinations/bitcoin - [Create Lightning invoice](https://barebitcoin.no/developers/api/transfers/create-lightning-invoice): POST /v1/deposit-destinations/bitcoin/invoice - [Get Lightning invoice](https://barebitcoin.no/developers/api/transfers/get-lightning-invoice): GET /v1/deposit-destinations/bitcoin/invoice/{id} - [Initiate withdrawal](https://barebitcoin.no/developers/api/transfers/initiate-withdrawal): POST /v1/withdrawals/bitcoin - [Get withdrawal](https://barebitcoin.no/developers/api/transfers/get-withdrawal): GET /v1/withdrawals/bitcoin/{withdrawalId} ## Market data Public price and volume data. No authentication required. - [BTC/NOK prices](https://barebitcoin.no/developers/api/market-data/price): GET /v1/price/nok - [Volume statistics](https://barebitcoin.no/developers/api/market-data/volume): GET /v1/volume - [Historical volume](https://barebitcoin.no/developers/api/market-data/historical-volume): GET /v1/volume/historic ## Orders Create orders and manage open orders. - [Open orders](https://barebitcoin.no/developers/api/orders/open-orders): GET /v1/orders - [Create an order](https://barebitcoin.no/developers/api/orders/create-order): POST /v1/orders - [Cancel an order](https://barebitcoin.no/developers/api/orders/cancel-order): DELETE /v1/orders/{orderId} ## Accounts and access Balances and application consent. - [List bitcoin accounts](https://barebitcoin.no/developers/api/accounts/bitcoin-accounts): GET /v1/user/bitcoin-accounts - [Fiat account](https://barebitcoin.no/developers/api/accounts/fiat-account): GET /v1/user/fiat-account - [Revoke consent](https://barebitcoin.no/developers/api/accounts/revoke-consent): DELETE /v1/user/applications/consent/{clientId} ## Tax Balances and transactions for tax reporting. - [Tax balances](https://barebitcoin.no/developers/api/tax/balances): GET /v1/tax/balance - [Tax transactions](https://barebitcoin.no/developers/api/tax/transactions): GET /v1/tax/transactions Source: https://barebitcoin.no/developers --- # Quickstart The production base URL is `https://api.bb.no`. Examples on this site do not run automatically. ## Fetch the current price Public market data does not require credentials. ```sh curl --fail-with-body 'https://api.bb.no/v1/price/nok' ``` See [BTC/NOK prices](https://barebitcoin.no/developers/api/market-data/price) for the response fields and the optional NOK amount parameter. ## Create an API key Sign in and open [API keys](https://barebitcoin.no/innlogget/profil/nokler). Create a key for this integration. Enable trading or withdrawal permissions only if your integration needs them. Keep the key and secret outside source control. ## Read your accounts Set `BB_API_KEY` in your environment to the complete key, including its `bb/public/` prefix. Listing accounts requires no nonce or signature. ```sh curl --fail-with-body 'https://api.bb.no/v1/user/bitcoin-accounts' \ -H "x-bb-api-key: $BB_API_KEY" ``` The response contains an array of [BitcoinAccount](https://barebitcoin.no/developers/models/BitcoinAccount) objects. Use the account ID when directing a transaction to a specific account. ## Next steps Read [API keys and signing](https://barebitcoin.no/developers/authentication/api-keys) before submitting orders or withdrawals. For an integration acting on behalf of other users, see [OAuth](https://barebitcoin.no/developers/authentication/oauth). Source: https://barebitcoin.no/developers/quickstart --- # Authentication Public price and volume endpoints need no credentials. Other endpoints list the authentication methods they accept. ## API keys Use an API key to access your own account. Send the complete key in `x-bb-api-key`. Keys can have trading and bitcoin withdrawal permissions and IP restrictions. Order creation, cancellation, and bitcoin withdrawals require a nonce and signature in addition to the API key. See [API keys and signing](https://barebitcoin.no/developers/authentication/api-keys). ## OAuth Use OAuth for supported third-party access. The endpoint lists the scopes that its access token needs. Send the token as `Authorization: Bearer `. OAuth is available only on the operations that list it. An API-key permission is not an OAuth scope. See the [OAuth guide](https://barebitcoin.no/developers/authentication/oauth). ## Selecting an authentication method Where an endpoint accepts alternatives, use one complete method. Do not combine bearer-token and API-key headers. Switching the method in the reference changes the corresponding request example. Source: https://barebitcoin.no/developers/authentication --- # API keys and signing Create a key in [API-key settings](https://barebitcoin.no/innlogget/profil/nokler). The key starts with `bb/public/`; the secret starts with `bb/apisecret/`. Both are credentials. Do not put them in public source code or URLs. ## Headers Read requests normally require only `x-bb-api-key`. Signed requests require all three headers: | Header | Value | | ---------------- | ------------------------------------------------------------------------- | | `x-bb-api-key` | Complete API key | | `x-bb-api-nonce` | Unsigned decimal integer greater than the last accepted nonce for the key | | `x-bb-api-hmac` | Base64-encoded HMAC-SHA256 signature | Enable trading permission for creating and cancelling orders. Enable bitcoin withdrawal permission for initiating withdrawals. ## Signature calculation ```text digest = SHA256(UTF8(decimalNonce) || rawRequestBodyBytes) message = UTF8(uppercaseMethod) || UTF8(uriPath) || digest signature = Base64(HMAC_SHA256(Base64Decode(completeSecret), message)) ``` Decode the complete secret, including its prefix. The signed path is the decoded URL path and excludes the query string. For a bodyless request, use zero body bytes. Serialize a JSON body once and send precisely those signed bytes. ## Nonce validation and retries Coordinate signed requests per key. A timestamp alone does not prevent collisions between concurrent requests or out-of-order arrival. The server can consume a nonce before an operation fails; the next attempt needs a larger nonce. After a timeout, inspect orders or withdrawals before retrying. A nonce is not an idempotency key, and repeating a request can create another transaction. ## Node.js signing helper Save the following as `bb-request.mjs`. Set `BB_API_KEY`, `BB_API_SECRET`, and a coordinated `BB_NONCE` in your environment. It sends requests to production only when explicitly executed. Replace example destination and path identifiers before use. ```js import { createHash, createHmac } from 'node:crypto'; import { readFile } from 'node:fs/promises'; export function signature(method, path, nonce, body, secret) { const digest = createHash('sha256').update(nonce).update(body).digest(); return createHmac('sha256', Buffer.from(secret, 'base64')) .update(method.toUpperCase()) .update(path) .update(digest) .digest('base64'); } // Importing the helper never sends a request. if (process.argv[1] && import.meta.url === new URL(process.argv[1], 'file:').href) { const [method, path, bodyFile] = process.argv.slice(2); const { BB_API_KEY: key, BB_API_SECRET: secret, BB_NONCE: nonce } = process.env; if (!key || !secret || !nonce || !/^\d+$/.test(nonce) || !method || !path?.startsWith('/v1/')) { throw new Error('Set BB_API_KEY, BB_API_SECRET, BB_NONCE; pass METHOD /v1/path [body.json].'); } const body = bodyFile ? await readFile(bodyFile) : Buffer.alloc(0); const url = new URL(path, 'https://api.bb.no'); const headers = { 'x-bb-api-key': key, 'x-bb-api-nonce': nonce, 'x-bb-api-hmac': signature(method, decodeURIComponent(url.pathname), nonce, body, secret), ...(bodyFile ? { 'Content-Type': 'application/json' } : {}), }; const response = await fetch(url, { method, headers, body: bodyFile ? body : undefined, redirect: 'error', }); const result = await response.text(); if (!response.ok) throw new Error(`HTTP ${response.status}: ${result}`); console.log(result); } ``` For a bodyless cancellation: ```sh node bb-request.mjs DELETE '/v1/orders/REPLACE_ORDER_ID' ``` For an order, save the request body to `body.json`, then run: ```sh node bb-request.mjs POST '/v1/orders' body.json ``` ## Signing fixture For method `POST`, path `/v1/orders`, nonce `1733314678`, synthetic secret `bb/apisecret/ZZavHDgVRyGowg8blKfPDDRlN3+6h0/vOUA`, and these exact body bytes: ```json { "type": "ORDER_TYPE_MARKET", "direction": "DIRECTION_BUY", "amount": 100 } ``` The expected signature is `e6pQ5w9AqVhwHRWXuwS7ZwzRd0kH2GYpHSmtP0cTlSU=`. This is a test fixture, not a usable account credential. ## Go signing helper This function constructs a signed request without sending it. Pass the body bytes you intend to send, the complete secret, and a coordinated nonce. Execute the returned request with an HTTP client that has a timeout and rejects redirects. ```go package signing import ( "bytes" "crypto/hmac" "crypto/sha256" "encoding/base64" "fmt" "net/http" "strings" ) func SignedRequest(method, path, key, secret, nonce string, body []byte) (*http.Request, error) { if !strings.HasPrefix(path, "/v1/") { return nil, fmt.Errorf("path must start with /v1/") } secretBytes, err := base64.StdEncoding.DecodeString(secret) if err != nil { return nil, fmt.Errorf("decode API secret: %w", err) } req, err := http.NewRequest(strings.ToUpper(method), "https://api.bb.no"+path, bytes.NewReader(body)) if err != nil { return nil, fmt.Errorf("create request: %w", err) } digest := sha256.Sum256(append([]byte(nonce), body...)) message := append([]byte(req.Method+req.URL.Path), digest[:]...) mac := hmac.New(sha256.New, secretBytes) if _, err := mac.Write(message); err != nil { return nil, fmt.Errorf("sign request: %w", err) } req.Header.Set("x-bb-api-key", key) req.Header.Set("x-bb-api-nonce", nonce) req.Header.Set("x-bb-api-hmac", base64.StdEncoding.EncodeToString(mac.Sum(nil))) if len(body) > 0 { req.Header.Set("Content-Type", "application/json") } return req, nil } ``` Source: https://barebitcoin.no/developers/authentication/api-keys --- # OAuth OAuth provides access to supported operations on behalf of another user. Contact Bare Bitcoin to arrange client registration and your redirect URI. Registration is not self-service in these docs. ## Authorization code flow Direct the user to `https://api.bb.no/oauth2/v0/authorize` with `response_type=code`, your registered `client_id`, `redirect_uri`, requested `scope`, and an unpredictable `state` value. Validate the returned state before exchanging the authorization code. Use PKCE with an S256 challenge for public clients; keep the verifier for the token exchange. Exchange the code by POSTing form-encoded parameters to `https://api.bb.no/oauth2/v0/token`: `grant_type=authorization_code`, `code`, `client_id`, `redirect_uri`, and the PKCE `code_verifier` when used. Confidential clients also send their registered `client_secret` in the form body. Never put a client secret in browser code. ## Access and refresh tokens Send the access token in the `Authorization: Bearer` header. Use the token response's expiry information; do not assume an access token remains valid indefinitely. Refresh using a form-encoded POST to the token endpoint with `grant_type=refresh_token`, `refresh_token`, and your client authentication. Persist replacement tokens returned by the server. ## Scopes Request only the scopes your integration needs. | Scope | Grants | Endpoints | | --- | --- | --- | | `api:accounts:bitcoin:read` | See balance and names of your bitcoin accounts | [List bitcoin accounts](https://barebitcoin.no/developers/api/accounts/bitcoin-accounts), [Tax balances](https://barebitcoin.no/developers/api/tax/balances) | | `api:trades:read` | See executed trades | None | | `api:tax:transactions:read` | Read transactions relevant for tax calculation | [Tax transactions](https://barebitcoin.no/developers/api/tax/transactions) | | `api:deposits:lightning:read` | See Lightning invoices and their payment status | [Get Lightning invoice](https://barebitcoin.no/developers/api/transfers/get-lightning-invoice) | | `api:deposits:lightning:write` | Create Lightning invoices for payments to you | [Create Lightning invoice](https://barebitcoin.no/developers/api/transfers/create-lightning-invoice) | ## Revoking consent [Revoke consent](https://barebitcoin.no/developers/api/accounts/revoke-consent) removes access for the specified application. It accepts an API key or any OAuth2 access token. Source: https://barebitcoin.no/developers/authentication/oauth --- # Deposit destinations GET https://api.bb.no/v1/deposit-destinations/bitcoin Fetches bitcoin deposit destinations. These destinations are always valid, and can be used for receiving arbitrary amounts. Onchain addresses are refreshed every time a deposit is made, but all prior generated addresses are still valid. ## Authentication x-bb-api-key: Public part of your API key. Starts with `bb/public/`. [API keys and signing](https://barebitcoin.no/developers/authentication/api-keys) ## Parameters ### accountId query parameter · string If empty, the default account is used. ## Examples ### API key ```sh curl -X GET \ https://api.bb.no/v1/deposit-destinations/bitcoin \ -H "x-bb-api-key: $BB_API_KEY" ``` ## Responses ### 200 OK Example: ```json { "onchainAddress": { "destination": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh", "network": "NETWORK_BITCOIN" }, "lightningAddress": { "destination": "aktiv-anker@bb.no", "network": "NETWORK_LIGHTNING" }, "lnurlPay": { "destination": "LNURL1DP68GURN8GHJ7CTSDYHXYC3WDEHJ7MRFVA58GMNFDENJ7MRWW4EXCTTSV9UN7CTRVDHH2MN584SKXC6LXQC5S526TQE4VW2TFG6Y6VJS8PFRV4PS2U64JD6ZGVN82UM9WG7N2C33VCEKXVN995UXZDRY956XVDNZ95UK2VNR95MKGVTPXP3RXCE5V56KVGK8387", "network": "NETWORK_LIGHTNING" } } ``` [DepositDestinationsResponse](https://barebitcoin.no/developers/models/DepositDestinationsResponse). Source: https://barebitcoin.no/developers/api/transfers/deposit-destinations --- # Create Lightning invoice POST https://api.bb.no/v1/deposit-destinations/bitcoin/invoice Creates a new BOLT11 Lightning invoice. Lightning invoices are requests to receive a specific amount of bitcoin within a set amount of time. If you don't need a specific amount, consider using the destinations returned from /v1/deposit-destinations/bitcoin. ## Authentication x-bb-api-key: Public part of your API key. Starts with `bb/public/`. Or: OAuth: Authorization: Bearer . Required scopes: api:deposits:lightning:write. [API keys and signing](https://barebitcoin.no/developers/authentication/api-keys) ## Parameters None. ## Request body [NewLightningInvoiceRequest](https://barebitcoin.no/developers/models/NewLightningInvoiceRequest). ## Examples ### API key ```sh curl -X POST \ https://api.bb.no/v1/deposit-destinations/bitcoin/invoice \ -H "Content-Type: application/json" \ -H "x-bb-api-key: $BB_API_KEY" \ -d '{ "currency": "CURRENCY_NOK", "amount": 100 }' ``` ### OAuth ```sh curl -X POST \ https://api.bb.no/v1/deposit-destinations/bitcoin/invoice \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $BB_TOKEN" \ -d '{ "currency": "CURRENCY_NOK", "amount": 100 }' ``` ## Responses ### 200 OK Example: ```json { "depositDestinationId": "ded_01JA3QW7E2R9T4Y6V8P0S1D3F5", "invoice": "lnbc2500u1pvjluezsp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygspp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdq5xysxxatsyp3k7enxv4jsxqzpu9qrsgquk0rl77nj30yxdy8j9vdx85fkpmdla2087ne0xh8nhedh8w27kyke0lp53ut353s06fv3qfegext0eh0ymjpf39tuven09sam30g4vgpfna3rh" } ``` [NewLightningInvoiceResponse](https://barebitcoin.no/developers/models/NewLightningInvoiceResponse). Source: https://barebitcoin.no/developers/api/transfers/create-lightning-invoice --- # Get Lightning invoice GET https://api.bb.no/v1/deposit-destinations/bitcoin/invoice/{id} Fetches a Lightning invoice. ## Authentication x-bb-api-key: Public part of your API key. Starts with `bb/public/`. Or: OAuth: Authorization: Bearer . Required scopes: api:deposits:lightning:read. [API keys and signing](https://barebitcoin.no/developers/authentication/api-keys) ## Parameters ### id path parameter · string · required Can be: 1. Deposit destination ID. Prefix: `ded_`. 2. The Lightning invoice itself. ## Examples ### API key ```sh curl -X GET \ https://api.bb.no/v1/deposit-destinations/bitcoin/invoice/REPLACE_ID \ -H "x-bb-api-key: $BB_API_KEY" ``` ### OAuth ```sh curl -X GET \ https://api.bb.no/v1/deposit-destinations/bitcoin/invoice/REPLACE_ID \ -H "Authorization: Bearer $BB_TOKEN" ``` ## Responses ### 200 OK Example: ```json { "depositDestinationId": "ded_01JA3QW7E2R9T4Y6V8P0S1D3F5", "invoice": "lnbc2500u1pvjluezsp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygspp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdq5xysxxatsyp3k7enxv4jsxqzpu9qrsgquk0rl77nj30yxdy8j9vdx85fkpmdla2087ne0xh8nhedh8w27kyke0lp53ut353s06fv3qfegext0eh0ymjpf39tuven09sam30g4vgpfna3rh", "status": "INVOICE_STATUS_PAID" } ``` [GetLightningInvoiceResponse](https://barebitcoin.no/developers/models/GetLightningInvoiceResponse). Source: https://barebitcoin.no/developers/api/transfers/get-lightning-invoice --- # Initiate withdrawal POST https://api.bb.no/v1/withdrawals/bitcoin Initiates a bitcoin withdrawal. The transaction is not completed until it is confirmed by the network it is sent onto. A success response from this endpoint means the transaction was successfully initiated, but does not guarantee completion. Requests are not idempotent: after a timeout, check your withdrawals before retrying. ## Authentication x-bb-api-key: Public part of your API key. Starts with `bb/public/`. x-bb-api-hmac: HMAC authentication for the API request, constructed using the corresponding secret value from your API key. x-bb-api-nonce: Nonce value. Used to ensure correct ordering of all API requests, as well as prevent attackers from being able to replay old requests. Can be set to any value, but needs to increase for each request. Recommendation is to use the current Unix timestamp in milliseconds. API-key permission: bitcoin withdrawals. [API keys and signing](https://barebitcoin.no/developers/authentication/api-keys) ## Parameters None. ## Request body [SendBitcoinRequest](https://barebitcoin.no/developers/models/SendBitcoinRequest). ## Examples ### Signed API key ```sh curl -X POST \ https://api.bb.no/v1/withdrawals/bitcoin \ -H "Content-Type: application/json" \ -H "x-bb-api-key: $BB_API_KEY" \ -H "x-bb-api-nonce: $BB_NONCE" \ -H "x-bb-api-hmac: $BB_HMAC" \ -d '{ "amountBtc": 0.0001, "destination": "REPLACE_WITH_BITCOIN_ADDRESS_OR_INVOICE", "tfrInfo": { "fullName": "REPLACE_WITH_RECIPIENT_NAME", "country": "NO", "address": "REPLACE_WITH_RECIPIENT_ADDRESS", "selfCustody": true } }' ``` ## Responses ### 200 OK Example: ```json { "withdrawalId": "wi_01JA2B3C4D5E6F7G8H9J0K1M2N", "network": "NETWORK_BITCOIN", "status": "WITHDRAWAL_STATUS_COMPLETED" } ``` [SendBitcoinResponse](https://barebitcoin.no/developers/models/SendBitcoinResponse). Source: https://barebitcoin.no/developers/api/transfers/initiate-withdrawal --- # Get withdrawal GET https://api.bb.no/v1/withdrawals/bitcoin/{withdrawalId} Fetches a bitcoin withdrawal. ## Authentication x-bb-api-key: Public part of your API key. Starts with `bb/public/`. [API keys and signing](https://barebitcoin.no/developers/authentication/api-keys) ## Parameters ### withdrawalId path parameter · string · required ## Examples ### API key ```sh curl -X GET \ https://api.bb.no/v1/withdrawals/bitcoin/REPLACE_WITHDRAWALID \ -H "x-bb-api-key: $BB_API_KEY" ``` ## Responses ### 200 OK Example: ```json { "withdrawalId": "wi_01JA2B3C4D5E6F7G8H9J0K1M2N", "destination": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh", "network": "NETWORK_BITCOIN", "amountBtc": 0.01, "amountNok": 10480, "status": "WITHDRAWAL_STATUS_COMPLETED", "createdAt": "2026-03-14T09:26:53.589793Z", "sentAt": "2026-03-14T09:31:07.214552Z" } ``` [GetBitcoinWithdrawalResponse](https://barebitcoin.no/developers/models/GetBitcoinWithdrawalResponse). Source: https://barebitcoin.no/developers/api/transfers/get-withdrawal --- # BTC/NOK prices GET https://api.bb.no/v1/price/nok Fetches the current BTCNOK price. ## Authentication No authentication required. [API keys and signing](https://barebitcoin.no/developers/authentication/api-keys) ## Parameters ### amount query parameter · number · double Amount NOK to trade for. If empty, defaults to 5000 NOK. ## Examples ### Public ```sh curl -X GET \ https://api.bb.no/v1/price/nok ``` ## Responses ### 200 OK Example: ```json { "price": 1048000, "bid": 1046000, "ask": 1050000, "timestamp": "2026-03-14T09:26:53.589793Z", "card": { "buy": 1088850, "sell": 1007298 }, "bank": { "buy": 1057350, "sell": 1038678 } } ``` [PriceResponse](https://barebitcoin.no/developers/models/PriceResponse). Source: https://barebitcoin.no/developers/api/market-data/price --- # Volume statistics GET https://api.bb.no/v1/volume Returns statistics about the volume of BTCNOK trades. ## Authentication No authentication required. [API keys and signing](https://barebitcoin.no/developers/authentication/api-keys) ## Parameters ### date query parameter · string The date to fetch the volume for. If empty, defaults to today. Format: YYYY-MM-DD ## Examples ### Public ```sh curl -X GET \ https://api.bb.no/v1/volume ``` ## Responses ### 200 OK Example: ```json { "daily": { "amountNok": 4823117, "amountBtc": 4.61234567, "buyPercentage": 63, "numberOfTrades": 412 }, "monthly": { "amountNok": 98234511, "amountBtc": 93.81234567, "buyPercentage": 58, "numberOfTrades": 8731 }, "yearly": { "amountNok": 412345678, "amountBtc": 402.12345678, "buyPercentage": 61, "numberOfTrades": 37104 }, "last24h": { "amountNok": 5102334, "amountBtc": 4.87654321, "buyPercentage": 64, "numberOfTrades": 437 } } ``` [VolumeResponse](https://barebitcoin.no/developers/models/VolumeResponse). Source: https://barebitcoin.no/developers/api/market-data/volume --- # Historical volume GET https://api.bb.no/v1/volume/historic ## Authentication No authentication required. [API keys and signing](https://barebitcoin.no/developers/authentication/api-keys) ## Parameters ### date query parameter · string First day of the period to fetch volume for. The period runs until today. If empty, defaults to one month ago. Format: YYYY-MM-DD ## Examples ### Public ```sh curl -X GET \ https://api.bb.no/v1/volume/historic ``` ## Responses ### 200 OK Example: ```json { "dailyVolume": [ { "date": "2026-03-14", "stats": { "Bare Bitcoin": { "name": "Bare Bitcoin", "color": "#FF8000", "volumeNok": 4823117, "volumeBtc": 4.61234567, "shareOfTotalVolume": 0.41 }, "Firi": { "name": "Firi", "color": "#3538D4", "volumeNok": 4471342, "volumeBtc": 4.27566219, "shareOfTotalVolume": 0.38 }, "NBX": { "name": "NBX", "color": "#BEED5E", "volumeNok": 2470411, "volumeBtc": 2.36295, "shareOfTotalVolume": 0.21 } } } ], "shareOfTotalVolume": { "Bare Bitcoin": 0.41, "Firi": 0.38, "NBX": 0.21 } } ``` [VolumeHistoricResponse](https://barebitcoin.no/developers/models/VolumeHistoricResponse). Source: https://barebitcoin.no/developers/api/market-data/historical-volume --- # Open orders GET https://api.bb.no/v1/orders Fetches all open orders for the user. Open orders are orders that are not yet filled, and can be cancelled. ## Authentication x-bb-api-key: Public part of your API key. Starts with `bb/public/`. [API keys and signing](https://barebitcoin.no/developers/authentication/api-keys) ## Parameters None. ## Examples ### API key ```sh curl -X GET \ https://api.bb.no/v1/orders \ -H "x-bb-api-key: $BB_API_KEY" ``` ## Responses ### 200 OK Example: ```json { "orders": [ { "orderId": "or_01J9ZK4T7M2QXW8B3N5R6V1Y0C", "type": "ORDER_TYPE_LIMIT", "direction": "DIRECTION_BUY", "amount": 5000, "createdAt": "2026-03-14T09:26:53.589793Z" } ] } ``` [OpenOrdersResponse](https://barebitcoin.no/developers/models/OpenOrdersResponse). Source: https://barebitcoin.no/developers/api/orders/open-orders --- # Create an order POST https://api.bb.no/v1/orders Places a new order. If the endpoint returns with a 200 status, the order is successfully placed. If you're creating a market order, a trade is also created, and its ID is included in the response. Requests are not idempotent: after a timeout, check open orders before retrying. ## Authentication x-bb-api-key: Public part of your API key. Starts with `bb/public/`. x-bb-api-hmac: HMAC authentication for the API request, constructed using the corresponding secret value from your API key. x-bb-api-nonce: Nonce value. Used to ensure correct ordering of all API requests, as well as prevent attackers from being able to replay old requests. Can be set to any value, but needs to increase for each request. Recommendation is to use the current Unix timestamp in milliseconds. API-key permission: trading. [API keys and signing](https://barebitcoin.no/developers/authentication/api-keys) ## Parameters None. ## Request body [NewOrderRequest](https://barebitcoin.no/developers/models/NewOrderRequest). ## Examples ### Signed API key ```sh curl -X POST \ https://api.bb.no/v1/orders \ -H "Content-Type: application/json" \ -H "x-bb-api-key: $BB_API_KEY" \ -H "x-bb-api-nonce: $BB_NONCE" \ -H "x-bb-api-hmac: $BB_HMAC" \ -d '{ "type": "ORDER_TYPE_MARKET", "direction": "DIRECTION_BUY", "amount": 100 }' ``` ## Responses ### 200 OK Example: ```json { "orderId": "or_01J9ZK4T7M2QXW8B3N5R6V1Y0C", "tradeId": "tr_01J9ZK4T7S8P2D6F4H0K3M5N7Q" } ``` [NewOrderResponse](https://barebitcoin.no/developers/models/NewOrderResponse). Source: https://barebitcoin.no/developers/api/orders/create-order --- # Cancel an order DELETE https://api.bb.no/v1/orders/{orderId} Cancel a pending order. If the order is already filled, an error will be returned. It is not possible to cancel market orders. ## Authentication x-bb-api-key: Public part of your API key. Starts with `bb/public/`. x-bb-api-hmac: HMAC authentication for the API request, constructed using the corresponding secret value from your API key. x-bb-api-nonce: Nonce value. Used to ensure correct ordering of all API requests, as well as prevent attackers from being able to replay old requests. Can be set to any value, but needs to increase for each request. Recommendation is to use the current Unix timestamp in milliseconds. API-key permission: trading. [API keys and signing](https://barebitcoin.no/developers/authentication/api-keys) ## Parameters ### orderId path parameter · string · required ## Examples ### Signed API key ```sh curl -X DELETE \ https://api.bb.no/v1/orders/REPLACE_ORDERID \ -H "x-bb-api-key: $BB_API_KEY" \ -H "x-bb-api-nonce: $BB_NONCE" \ -H "x-bb-api-hmac: $BB_HMAC" ``` ## Responses ### 200 OK Source: https://barebitcoin.no/developers/api/orders/cancel-order --- # List bitcoin accounts GET https://api.bb.no/v1/user/bitcoin-accounts Lists the bitcoin accounts for the user. Each bitcoin account has a separate balance. Every bitcoin transaction (withdrawal, deposit, trade, bonus payout) affects the balance of exactly one bitcoin account. ## Authentication x-bb-api-key: Public part of your API key. Starts with `bb/public/`. Or: OAuth: Authorization: Bearer . Required scopes: api:accounts:bitcoin:read. [API keys and signing](https://barebitcoin.no/developers/authentication/api-keys) ## Parameters ### includeDeleted query parameter · boolean Include accounts that have previously been deleted. ## Examples ### API key ```sh curl -X GET \ https://api.bb.no/v1/user/bitcoin-accounts \ -H "x-bb-api-key: $BB_API_KEY" ``` ### OAuth ```sh curl -X GET \ https://api.bb.no/v1/user/bitcoin-accounts \ -H "Authorization: Bearer $BB_TOKEN" ``` ## Responses ### 200 OK Example: ```json { "accounts": [ { "id": "acc_01HQZX3V9KJ4M2P8R6T0W5Y7BC", "availableBtc": 0.0145, "totalBtc": 0.0151, "totalNok": 15824.8, "name": "Hovedkonto", "createTime": "2024-06-03T08:15:42.103948Z" }, { "id": "acc_01J2M8RK4XHV7T3N9QW6B5Y0ZD", "availableBtc": 0.01, "totalBtc": 0.01, "totalNok": 10480, "name": "Sparekonto", "createTime": "2025-01-09T19:02:11.734120Z" } ], "totalBtc": 0.0251, "totalNok": 26304.8 } ``` [ListBitcoinAccountsResponse](https://barebitcoin.no/developers/models/ListBitcoinAccountsResponse). Source: https://barebitcoin.no/developers/api/accounts/bitcoin-accounts --- # Fiat account GET https://api.bb.no/v1/user/fiat-account Fetches the fiat account. The fiat account for a user holds their NOK balance. Every user has exactly one fiat account. Other sub-accounts for a user only pertains to bitcoin holdings. ## Authentication x-bb-api-key: Public part of your API key. Starts with `bb/public/`. [API keys and signing](https://barebitcoin.no/developers/authentication/api-keys) ## Parameters None. ## Examples ### API key ```sh curl -X GET \ https://api.bb.no/v1/user/fiat-account \ -H "x-bb-api-key: $BB_API_KEY" ``` ## Responses ### 200 OK Example: ```json { "availableNok": 12500.5 } ``` [GetFiatAccountResponse](https://barebitcoin.no/developers/models/GetFiatAccountResponse). Source: https://barebitcoin.no/developers/api/accounts/fiat-account --- # Revoke consent DELETE https://api.bb.no/v1/user/applications/consent/{clientId} Revokes the access you have given the OAuth2 application with this client ID. ## Authentication x-bb-api-key: Public part of your API key. Starts with `bb/public/`. Or: OAuth: Authorization: Bearer . Any OAuth2 access token is accepted. [API keys and signing](https://barebitcoin.no/developers/authentication/api-keys) ## Parameters ### clientId path parameter · string · required ## Examples ### API key ```sh curl -X DELETE \ https://api.bb.no/v1/user/applications/consent/REPLACE_CLIENTID \ -H "x-bb-api-key: $BB_API_KEY" ``` ### OAuth ```sh curl -X DELETE \ https://api.bb.no/v1/user/applications/consent/REPLACE_CLIENTID \ -H "Authorization: Bearer $BB_TOKEN" ``` ## Responses ### 200 OK Source: https://barebitcoin.no/developers/api/accounts/revoke-consent --- # Tax balances GET https://api.bb.no/v1/tax/balance Fetches the user's current balances: the NOK balance, and the balance of each bitcoin account. ## Authentication x-bb-api-key: Public part of your API key. Starts with `bb/public/`. Or: OAuth: Authorization: Bearer . Required scopes: api:accounts:bitcoin:read. [API keys and signing](https://barebitcoin.no/developers/authentication/api-keys) ## Parameters ### includeDeleted query parameter · boolean Include accounts that have previously been deleted. Useful for resolving the name of an account referenced by an older transaction. ## Examples ### API key ```sh curl -X GET \ https://api.bb.no/v1/tax/balance \ -H "x-bb-api-key: $BB_API_KEY" ``` ### OAuth ```sh curl -X GET \ https://api.bb.no/v1/tax/balance \ -H "Authorization: Bearer $BB_TOKEN" ``` ## Responses ### 200 OK Example: ```json { "balanceNok": "12500.5", "bitcoinAccounts": [ { "id": "acc_01HQZX3V9KJ4M2P8R6T0W5Y7BC", "name": "Sparekonto", "balanceBtc": "1.89975850", "deleteTime": "2025-11-14T09:03:11Z" } ] } ``` [GetTaxBalanceResponse](https://barebitcoin.no/developers/models/GetTaxBalanceResponse). Source: https://barebitcoin.no/developers/api/tax/balances --- # 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 . 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 --- # Models - [BitcoinAccount](https://barebitcoin.no/developers/models/BitcoinAccount) - [DepositDestination](https://barebitcoin.no/developers/models/DepositDestination) - [DepositDestinationsResponse](https://barebitcoin.no/developers/models/DepositDestinationsResponse) - [GetBitcoinWithdrawalResponse](https://barebitcoin.no/developers/models/GetBitcoinWithdrawalResponse) - [GetFiatAccountResponse](https://barebitcoin.no/developers/models/GetFiatAccountResponse) - [GetLightningInvoiceResponse](https://barebitcoin.no/developers/models/GetLightningInvoiceResponse) - [GetTaxBalanceResponse](https://barebitcoin.no/developers/models/GetTaxBalanceResponse) - [Info](https://barebitcoin.no/developers/models/Info) - [ListBitcoinAccountsResponse](https://barebitcoin.no/developers/models/ListBitcoinAccountsResponse) - [ListTaxTransactionsResponse](https://barebitcoin.no/developers/models/ListTaxTransactionsResponse) - [NewLightningInvoiceRequest](https://barebitcoin.no/developers/models/NewLightningInvoiceRequest) - [NewLightningInvoiceResponse](https://barebitcoin.no/developers/models/NewLightningInvoiceResponse) - [NewOrderRequest](https://barebitcoin.no/developers/models/NewOrderRequest) - [NewOrderResponse](https://barebitcoin.no/developers/models/NewOrderResponse) - [OpenOrdersResponse](https://barebitcoin.no/developers/models/OpenOrdersResponse) - [Order](https://barebitcoin.no/developers/models/Order) - [PriceResponse](https://barebitcoin.no/developers/models/PriceResponse) - [SendBitcoinRequest](https://barebitcoin.no/developers/models/SendBitcoinRequest) - [SendBitcoinResponse](https://barebitcoin.no/developers/models/SendBitcoinResponse) - [TaxAccountBalance](https://barebitcoin.no/developers/models/TaxAccountBalance) - [TaxTransaction](https://barebitcoin.no/developers/models/TaxTransaction) - [UserPrice](https://barebitcoin.no/developers/models/UserPrice) - [VolumeHistoricResponse](https://barebitcoin.no/developers/models/VolumeHistoricResponse) - [VolumeHistoricResponse_DailyVolume](https://barebitcoin.no/developers/models/VolumeHistoricResponse_DailyVolume) - [VolumeHistoricResponse_MarketStats](https://barebitcoin.no/developers/models/VolumeHistoricResponse_MarketStats) - [VolumeResponse](https://barebitcoin.no/developers/models/VolumeResponse) - [VolumeStats](https://barebitcoin.no/developers/models/VolumeStats) Source: https://barebitcoin.no/developers/models --- # BitcoinAccount object ### id Type: string. ### availableBtc Type: number · double. The current BTC holdings that can be used for trading or withdrawals. ### totalBtc Type: number · double. The BTC balance of the account. ### totalNok Type: number · double. The NOK value of the BTC of the account, at the time of the request. ### name Type: string. The name of the account. ### createTime Type: string · date-time. When this account was created. ### deleteTime Type: string · date-time. When this account was deleted. Empty if the account is not deleted. ## Used by - [ListBitcoinAccountsResponse](https://barebitcoin.no/developers/models/ListBitcoinAccountsResponse) Source: https://barebitcoin.no/developers/models/BitcoinAccount --- # DepositDestination object ### destination Type: string. ### network Type: string · enum. Values: NETWORK_BITCOIN, NETWORK_LIGHTNING ## Used by - [DepositDestinationsResponse](https://barebitcoin.no/developers/models/DepositDestinationsResponse) Source: https://barebitcoin.no/developers/models/DepositDestination --- # DepositDestinationsResponse object ### onchainAddress Type: DepositDestination. Bitcoin address for on-chain deposits to the account. Bitcoin address for on-chain deposits to the account. [DepositDestination](https://barebitcoin.no/developers/models/DepositDestination). ### lightningAddress Type: DepositDestination. Lightning address (name@bb.no) that accepts payments of any amount to the account. Lightning address (name@bb.no) that accepts payments of any amount to the account. [DepositDestination](https://barebitcoin.no/developers/models/DepositDestination). ### lnurlPay Type: DepositDestination. LNURL-pay code that accepts Lightning payments to the account. LNURL-pay code that accepts Lightning payments to the account. [DepositDestination](https://barebitcoin.no/developers/models/DepositDestination). ## Used by - [Deposit destinations · responses](https://barebitcoin.no/developers/api/transfers/deposit-destinations#responses) Source: https://barebitcoin.no/developers/models/DepositDestinationsResponse --- # GetBitcoinWithdrawalResponse object ### withdrawalId Type: string. ### destination Type: string. The destination of the withdrawal. ### network Type: string · enum. The network this withdrawal was sent on. Values: NETWORK_BITCOIN, NETWORK_LIGHTNING ### amountBtc Type: number · double. The amount of BTC that was withdrawn. ### amountNok Type: number · double. The value of the BTC that was withdrawn, in NOK equivalent at time of withdrawal. ### status Type: string · enum. The status of the withdrawal. Values: WITHDRAWAL_STATUS_PENDING, WITHDRAWAL_STATUS_COMPLETED, WITHDRAWAL_STATUS_FAILED ### createdAt Type: string · date-time. The time the withdrawal was initiated. ### sentAt Type: string · date-time. The time the withdrawal was sent from the platform. ## Used by - [Get withdrawal · responses](https://barebitcoin.no/developers/api/transfers/get-withdrawal#responses) Source: https://barebitcoin.no/developers/models/GetBitcoinWithdrawalResponse --- # GetFiatAccountResponse object ### availableNok Type: number · double. The current NOK holdings that can be used for trading or withdrawals. ## Used by - [Fiat account · responses](https://barebitcoin.no/developers/api/accounts/fiat-account#responses) Source: https://barebitcoin.no/developers/models/GetFiatAccountResponse --- # GetLightningInvoiceResponse object ### depositDestinationId Type: string. ### invoice Type: string. ### status Type: string · enum. Values: INVOICE_STATUS_UNPAID, INVOICE_STATUS_PENDING, INVOICE_STATUS_PAID, INVOICE_STATUS_EXPIRED, INVOICE_STATUS_CANCELED ## Used by - [Get Lightning invoice · responses](https://barebitcoin.no/developers/api/transfers/get-lightning-invoice#responses) Source: https://barebitcoin.no/developers/models/GetLightningInvoiceResponse --- # GetTaxBalanceResponse object ### balanceNok Type: string. Stringified decimal number: the user's NOK balance. ### bitcoinAccounts Type: array of TaxAccountBalance. Items: [TaxAccountBalance](https://barebitcoin.no/developers/models/TaxAccountBalance). ## Used by - [Tax balances · responses](https://barebitcoin.no/developers/api/tax/balances#responses) Source: https://barebitcoin.no/developers/models/GetTaxBalanceResponse --- # Info object ### fullName Type: string. Recipient name. For an organisation this is its registered name. Required for a private individual; optional for an organisation, which is identified by the organisasjonsnummer in nin. ### country Type: string. ISO-3166-1 alpha-2 country code ### address Type: string. ### nin Type: string. The recipient's fødselsnummer, or a 9-digit organisasjonsnummer when the recipient is an organisation. Only required if the TFR config said so. ### exchange Type: string. ### selfCustody Type: boolean. ## Used by - [SendBitcoinRequest](https://barebitcoin.no/developers/models/SendBitcoinRequest) Source: https://barebitcoin.no/developers/models/Info --- # ListBitcoinAccountsResponse object ### accounts Type: array of BitcoinAccount. Items: [BitcoinAccount](https://barebitcoin.no/developers/models/BitcoinAccount). ### totalBtc Type: number · double. The total BTC balance of all accounts. ### totalNok Type: number · double. The total NOK value of the BTC of all accounts, at the time of the request. ## Used by - [List bitcoin accounts · responses](https://barebitcoin.no/developers/api/accounts/bitcoin-accounts#responses) Source: https://barebitcoin.no/developers/models/ListBitcoinAccountsResponse --- # ListTaxTransactionsResponse object ### 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. ## Used by - [Tax transactions · responses](https://barebitcoin.no/developers/api/tax/transactions#responses) Source: https://barebitcoin.no/developers/models/ListTaxTransactionsResponse --- # NewLightningInvoiceRequest object ### accountId Type: string. if empty, the default account is used. ### currency Type: string · enum. The currency the invoice is denominated in. Once created, the invoice is for a specific amount of bitcoin. Values: CURRENCY_BTC, CURRENCY_NOK ### amount Type: number · double. The amount of the invoice, in the requested currency. Setting to 0 creates an invoice where any amount is accepted. ### publicDescription Type: string. Public description of the invoice. The invoice commits to it through its description hash; the memo field is left empty, so most wallets do not show it to the payer. ### internalDescription Type: string. Free-form text description of the invoice. Can be used to correlate with your own systems. Only shown to the creator of this invoice, within the Bare Bitcoin systems. ## Used by - [Create Lightning invoice · request](https://barebitcoin.no/developers/api/transfers/create-lightning-invoice#request) Source: https://barebitcoin.no/developers/models/NewLightningInvoiceRequest --- # NewLightningInvoiceResponse object ### depositDestinationId Type: string. ### invoice Type: string. ## Used by - [Create Lightning invoice · responses](https://barebitcoin.no/developers/api/transfers/create-lightning-invoice#responses) Source: https://barebitcoin.no/developers/models/NewLightningInvoiceResponse --- # NewOrderRequest object ### type Type: string · enum. Values: ORDER_TYPE_MARKET, ORDER_TYPE_LIMIT ### direction Type: string · enum. Values: DIRECTION_BUY, DIRECTION_SELL ### amount Type: number · double. Amount to spend. Must be positive. When buying, this is the amount in NOK. When selling, this is the amount in BTC. ### accountId Type: string. The bitcoin account to use for this order. Empty for default account. ### description Type: string. Free-form text description of the order. Can be used to correlate with your own systems. ### price Type: number · double. The price to buy or sell at. Only used for limit orders. ## Used by - [Create an order · request](https://barebitcoin.no/developers/api/orders/create-order#request) Source: https://barebitcoin.no/developers/models/NewOrderRequest --- # NewOrderResponse object ### orderId Type: string. ID of the created order. ### tradeId Type: string. If this was a market order, the order resulted in a trade. Empty if not market order. ## Used by - [Create an order · responses](https://barebitcoin.no/developers/api/orders/create-order#responses) Source: https://barebitcoin.no/developers/models/NewOrderResponse --- # OpenOrdersResponse object ### orders Type: array of Order. Items: [Order](https://barebitcoin.no/developers/models/Order). ## Used by - [Open orders · responses](https://barebitcoin.no/developers/api/orders/open-orders#responses) Source: https://barebitcoin.no/developers/models/OpenOrdersResponse --- # Order object ### orderId Type: string. ### type Type: string · enum. Values: ORDER_TYPE_MARKET, ORDER_TYPE_LIMIT ### direction Type: string · enum. Values: DIRECTION_BUY, DIRECTION_SELL ### amount Type: number · double. ### createdAt Type: string · date-time. ## Used by - [OpenOrdersResponse](https://barebitcoin.no/developers/models/OpenOrdersResponse) Source: https://barebitcoin.no/developers/models/Order --- # PriceResponse object ### price Type: number · double. The mid price. ### bid Type: number · double. Current bid price, without fees. ### ask Type: number · double. Current ask price, without fees. ### timestamp Type: string · date-time. The time the price was fetched. ### card Type: UserPrice. Effective price, when paying with card. Effective price, when paying with card. [UserPrice](https://barebitcoin.no/developers/models/UserPrice). ### bank Type: UserPrice. Effective price, when paying with bank transfer. Effective price, when paying with bank transfer. [UserPrice](https://barebitcoin.no/developers/models/UserPrice). ## Used by - [BTC/NOK prices · responses](https://barebitcoin.no/developers/api/market-data/price#responses) Source: https://barebitcoin.no/developers/models/PriceResponse --- # SendBitcoinRequest object ### destination Type: string. The bitcoin destination to send funds to. Supported formats: - Bitcoin address (bech32, legacy-segwit, legacy) - Lightning invoice (bolt11) - Lightning address - Lightning LNURL ### amountBtc Type: number · double. The amount to send. This field is required for all destinations except Lightning invoices. If the destination is a Lightning invoice, the amount is derived from the invoice. ### accountId Type: string. The ID of the account to send from. If empty, the default account is used. ### isPayment Type: boolean. Marks the transaction as a payment. This has consequences for how the transaction is exported for tax purposes. It has no effect on the bitcoin transaction itself. ### description Type: string. Free-form text description of the withdrawal. Can be used to correlate with your own systems. ### tfrInfo Type: Info. The recipient of this transaction, per EU's travel rule. Required for all withdrawals to new destinations. full_name and address are always required, also when the recipient is an organisation. The recipient of this transaction, per EU's travel rule. Required for all withdrawals to new destinations. full_name and address are always required, also when the recipient is an organisation. [Info](https://barebitcoin.no/developers/models/Info). ## Used by - [Initiate withdrawal · request](https://barebitcoin.no/developers/api/transfers/initiate-withdrawal#request) Source: https://barebitcoin.no/developers/models/SendBitcoinRequest --- # SendBitcoinResponse object ### withdrawalId Type: string. The ID of the initiated withdrawal. ### network Type: string · enum. Values: NETWORK_BITCOIN, NETWORK_LIGHTNING ### status Type: string · enum. The status of the withdrawal. The withdrawal might immediately succeed, if sending to another user of the Bare Bitcoin platform. Values: WITHDRAWAL_STATUS_PENDING, WITHDRAWAL_STATUS_COMPLETED, WITHDRAWAL_STATUS_FAILED ## Used by - [Initiate withdrawal · responses](https://barebitcoin.no/developers/api/transfers/initiate-withdrawal#responses) Source: https://barebitcoin.no/developers/models/SendBitcoinResponse --- # TaxAccountBalance object ### id Type: string. ### name Type: string. ### balanceBtc Type: string. Stringified decimal number with 8 decimal places: the BTC balance of the account. ### deleteTime Type: string · date-time. When this account was deleted. Empty if the account is not deleted. Only ever set when the request asked for deleted accounts. ## Used by - [GetTaxBalanceResponse](https://barebitcoin.no/developers/models/GetTaxBalanceResponse) Source: https://barebitcoin.no/developers/models/TaxAccountBalance --- # TaxTransaction object ### 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: `:`. 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. ## Used by - [ListTaxTransactionsResponse](https://barebitcoin.no/developers/models/ListTaxTransactionsResponse) Source: https://barebitcoin.no/developers/models/TaxTransaction --- # UserPrice object The prices a user can expect to pay for a given amount of BTCNOK, with a given payment method. ### buy Type: number · double. ### sell Type: number · double. ## Used by - [PriceResponse](https://barebitcoin.no/developers/models/PriceResponse) Source: https://barebitcoin.no/developers/models/UserPrice --- # VolumeHistoricResponse object ### dailyVolume Type: array of VolumeHistoricResponse_DailyVolume. Items: [VolumeHistoricResponse_DailyVolume](https://barebitcoin.no/developers/models/VolumeHistoricResponse_DailyVolume). ### shareOfTotalVolume Type: map of number · double. Each market's share of the total volume for the period in question. Values: ## Used by - [Historical volume · responses](https://barebitcoin.no/developers/api/market-data/historical-volume#responses) Source: https://barebitcoin.no/developers/models/VolumeHistoricResponse --- # VolumeHistoricResponse_DailyVolume object ### date Type: string. YYYY-MM-DD ### stats Type: map of VolumeHistoricResponse_MarketStats. Each market's volume for the day. Values: [VolumeHistoricResponse_MarketStats](https://barebitcoin.no/developers/models/VolumeHistoricResponse_MarketStats). ## Used by - [VolumeHistoricResponse](https://barebitcoin.no/developers/models/VolumeHistoricResponse) Source: https://barebitcoin.no/developers/models/VolumeHistoricResponse_DailyVolume --- # VolumeHistoricResponse_MarketStats object ### name Type: string. ### color Type: string. ### volumeNok Type: number · double. ### volumeBtc Type: number · double. ### shareOfTotalVolume Type: number · double. Share of the total volume for the day in question. ## Used by - [VolumeHistoricResponse_DailyVolume](https://barebitcoin.no/developers/models/VolumeHistoricResponse_DailyVolume) Source: https://barebitcoin.no/developers/models/VolumeHistoricResponse_MarketStats --- # VolumeResponse object ### daily Type: VolumeStats. Volume for the requested date, in Oslo time. Volume for the requested date, in Oslo time. [VolumeStats](https://barebitcoin.no/developers/models/VolumeStats). ### monthly Type: VolumeStats. Volume for the calendar month containing the requested date. Volume for the calendar month containing the requested date. [VolumeStats](https://barebitcoin.no/developers/models/VolumeStats). ### yearly Type: VolumeStats. Volume for the calendar year containing the requested date. Volume for the calendar year containing the requested date. [VolumeStats](https://barebitcoin.no/developers/models/VolumeStats). ### last24h Type: VolumeStats. Volume for the last 24 hours, regardless of the requested date. Volume for the last 24 hours, regardless of the requested date. [VolumeStats](https://barebitcoin.no/developers/models/VolumeStats). ## Used by - [Volume statistics · responses](https://barebitcoin.no/developers/api/market-data/volume#responses) Source: https://barebitcoin.no/developers/models/VolumeResponse --- # VolumeStats object ### amountNok Type: number · double. ### amountBtc Type: number · double. ### buyPercentage Type: number · double. ### numberOfTrades Type: integer · int32. ## Used by - [VolumeResponse](https://barebitcoin.no/developers/models/VolumeResponse) Source: https://barebitcoin.no/developers/models/VolumeStats