{
  "openapi": "3.0.3",
  "info": {
    "title": "Bare Bitcoin API",
    "description": "API for interacting with Bare Bitcoin. Most endpoints require authentication. Create API keys [here](https://barebitcoin.no/innlogget/profil/nokler). Read about API authentication [here](https://barebitcoin.no/developers/authentication).",
    "contact": {
      "url": "https://barebitcoin.no",
      "email": "barebitcoin@bb.no"
    },
    "version": "0.0.1"
  },
  "servers": [
    {
      "url": "https://api.bb.no",
      "description": "Prod environment"
    }
  ],
  "paths": {
    "/v1/deposit-destinations/bitcoin": {
      "get": {
        "tags": [
          "BitcoinTransferService"
        ],
        "summary": "Fetch bitcoin deposit destinations",
        "description": "Fetches bitcoin deposit destinations. These destinations are always valid,\n and can be used for receiving arbitrary amounts. Onchain addresses are refreshed\n every time a deposit is made, but all prior generated addresses are still valid.",
        "operationId": "BitcoinTransferService_DepositDestinations",
        "parameters": [
          {
            "name": "accountId",
            "in": "query",
            "description": "If empty, the default account is used.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DepositDestinationsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/deposit-destinations/bitcoin/invoice": {
      "post": {
        "tags": [
          "BitcoinTransferService"
        ],
        "summary": "Create a new Lightning invoice",
        "description": "Creates a new BOLT11 Lightning invoice. Lightning invoices are requests to receive a specific\n amount of bitcoin within a set amount of time. If you don't need a specific amount, consider\n using the destinations returned from /v1/deposit-destinations/bitcoin.",
        "operationId": "BitcoinTransferService_NewLightningInvoice",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewLightningInvoiceRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NewLightningInvoiceResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "oauth2": [
              "api:deposits:lightning:write"
            ]
          }
        ]
      }
    },
    "/v1/deposit-destinations/bitcoin/invoice/{id}": {
      "get": {
        "tags": [
          "BitcoinTransferService"
        ],
        "summary": "Fetch a Lightning invoice",
        "description": "Fetches a Lightning invoice the user created, and whether it is paid.",
        "operationId": "BitcoinTransferService_GetLightningInvoice",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Can be:\n 1. Deposit destination ID. Prefix: `ded_`.\n 2. The Lightning invoice itself.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetLightningInvoiceResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "oauth2": [
              "api:deposits:lightning:read"
            ]
          }
        ]
      }
    },
    "/v1/orders": {
      "get": {
        "tags": [
          "TradingService"
        ],
        "summary": "Fetch open orders",
        "description": "Fetches all open orders for the user. Open orders are orders that are\n not yet filled, and can be cancelled.",
        "operationId": "TradingService_OpenOrders",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OpenOrdersResponse"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "TradingService"
        ],
        "summary": "Place a new order",
        "description": "Places a new order. If the endpoint returns with a 200 status, the order\n is successfully placed. If you're creating a market order, a trade is\n also created, and its ID is included in the response. Requests are not\n idempotent: after a timeout, check open orders before retrying.",
        "operationId": "TradingService_NewOrder",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewOrderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NewOrderResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": [],
            "apiHmac": [],
            "apiNonce": []
          }
        ]
      }
    },
    "/v1/orders/{orderId}": {
      "delete": {
        "tags": [
          "TradingService"
        ],
        "summary": "Cancel an order",
        "description": "Cancel a pending order. If the order is already filled, an error will\n be returned. It is not possible to cancel market orders.",
        "operationId": "TradingService_CancelOrder",
        "parameters": [
          {
            "name": "orderId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {}
          }
        },
        "security": [
          {
            "apiKey": [],
            "apiHmac": [],
            "apiNonce": []
          }
        ]
      }
    },
    "/v1/price/nok": {
      "get": {
        "tags": [
          "PublicService"
        ],
        "summary": "Fetch BTCNOK",
        "description": "Fetches the current BTCNOK price at Bare Bitcoin: the mid price, bid, ask,\n and the buy and sell prices for card and bank payments.",
        "operationId": "PublicService_Price",
        "parameters": [
          {
            "name": "amount",
            "in": "query",
            "description": "Amount NOK to trade for. If empty, defaults to 5000 NOK.",
            "schema": {
              "type": "number",
              "format": "double"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceResponse"
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/v1/tax/balance": {
      "get": {
        "tags": [
          "TaxService"
        ],
        "summary": "Fetch balances",
        "description": "Fetches the user's current balances: the NOK balance, and the balance of\n each bitcoin account.",
        "operationId": "TaxService_GetTaxBalance",
        "parameters": [
          {
            "name": "includeDeleted",
            "in": "query",
            "description": "Include accounts that have previously been deleted. Useful for resolving\n the name of an account referenced by an older transaction.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetTaxBalanceResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "oauth2": [
              "api:accounts:bitcoin:read"
            ]
          }
        ]
      }
    },
    "/v1/tax/transactions": {
      "get": {
        "tags": [
          "TaxService"
        ],
        "summary": "List tax transactions",
        "description": "Lists tax-relevant transactions done by the user within the Bare Bitcoin\n platform, oldest first: trades, bitcoin deposits and withdrawals, NOK\n deposits and withdrawals, bonuses and adjustments. Note that this does NOT\n include any of the third party transactions imported into the platform tax\n calculator. When hasMore is true, pass nextAfter and nextAfterId as after\n and afterId to fetch the next page.",
        "operationId": "TaxService_ListTaxTransactions",
        "parameters": [
          {
            "name": "pageSize",
            "in": "query",
            "description": "Items per page (max 200). When set to 0, all matching transactions are\n returned, except through MCP, where it defaults to 50.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "Transactions are listed oldest first (required to compute running_balance_btc\n correctly), so pagination walks forward in time. Only return transactions\n created after this time. Can be used standalone to filter down to a start\n date; pass next_after from the previous response (together with\n next_after_id) to fetch the next page.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "afterId",
            "in": "query",
            "description": "Pagination cursor tiebreaker: when multiple transactions share the same\n create_time, this ID breaks the tie. Pass next_after_id from the previous\n response. Requires 'after'; supplying 'after_id' alone is rejected.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "before",
            "in": "query",
            "description": "Only return transactions created strictly before this time. Filter only,\n does not affect pagination direction.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListTaxTransactionsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "oauth2": [
              "api:tax:transactions:read"
            ]
          }
        ]
      }
    },
    "/v1/trades": {
      "get": {
        "tags": [
          "TradingService"
        ],
        "summary": "List trades",
        "description": "Lists the user's executed trades, newest first. When hasMore is true, pass\n nextBefore and nextBeforeId as before and beforeId to fetch the next page.",
        "operationId": "TradingService_ListTrades",
        "parameters": [
          {
            "name": "pageSize",
            "in": "query",
            "description": "Items per page (max 200). When set to 0, all matching trades are returned,\n except through MCP, where it defaults to 50.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "before",
            "in": "query",
            "description": "Trades are listed newest first, so pagination walks backward in time. Only\n return trades created before this time. Can be used standalone to filter\n down to an end date; pass next_before from the previous response (together\n with next_before_id) to fetch the next page.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "beforeId",
            "in": "query",
            "description": "Pagination cursor tiebreaker: when multiple trades share the same\n create_time, this ID breaks the tie. Pass next_before_id from the previous\n response. Requires 'before'; supplying 'before_id' alone is rejected.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListTradesResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "oauth2": [
              "api:trades:read"
            ]
          }
        ]
      }
    },
    "/v1/user/applications/consent/{clientId}": {
      "delete": {
        "tags": [
          "UserService"
        ],
        "summary": "Revoke consent for a specific OAuth2 application",
        "description": "Revokes the access you have given the OAuth2 application with this client ID, and invalidates its tokens. An application can only revoke its own consent, using one of its access tokens. API keys cannot revoke consent.",
        "operationId": "UserService_RevokeConsent",
        "parameters": [
          {
            "name": "clientId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {}
          }
        },
        "security": [
          {
            "oauth2": []
          }
        ]
      }
    },
    "/v1/user/bitcoin-accounts": {
      "get": {
        "tags": [
          "UserService"
        ],
        "summary": "Fetch bitcoin accounts",
        "description": "Lists the bitcoin accounts for the user. Each bitcoin account has a\n separate balance. Every bitcoin transaction (withdrawal, deposit, trade,\n bonus payout) affects the balance of exactly one bitcoin account.",
        "operationId": "UserService_ListBitcoinAccounts",
        "parameters": [
          {
            "name": "includeDeleted",
            "in": "query",
            "description": "Include accounts that have previously been deleted.",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListBitcoinAccountsResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": []
          },
          {
            "oauth2": [
              "api:accounts:bitcoin:read"
            ]
          }
        ]
      }
    },
    "/v1/user/fiat-account": {
      "get": {
        "tags": [
          "UserService"
        ],
        "summary": "Fetch user fiat information",
        "description": "Fetches the fiat account. The fiat account for a user holds their NOK\n balance. Every user has exactly one fiat account. Other sub-accounts for a user\n only pertains to bitcoin holdings.",
        "operationId": "UserService_GetFiatAccount",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetFiatAccountResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/volume": {
      "get": {
        "tags": [
          "PublicService"
        ],
        "summary": "Fetch volume statistics",
        "description": "Returns statistics about the volume of BTCNOK trades at Bare Bitcoin: the\n last 24 hours, 7, 30 and 365 days, all time, and the day, month and year\n of a date.",
        "operationId": "PublicService_Volume",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "description": "The date to fetch the volume for. If empty, defaults to today.\n Format: YYYY-MM-DD",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VolumeResponse"
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/v1/volume/historic": {
      "get": {
        "tags": [
          "PublicService"
        ],
        "summary": "Fetch historic volume statistics",
        "operationId": "PublicService_VolumeHistoric",
        "parameters": [
          {
            "name": "date",
            "in": "query",
            "description": "First day of the period to fetch volume for. The period runs until today.\n If empty, defaults to one month ago. Format: YYYY-MM-DD",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VolumeHistoricResponse"
                }
              }
            }
          }
        },
        "security": [
          {}
        ]
      }
    },
    "/v1/withdrawal-exchanges/bitcoin": {
      "get": {
        "tags": [
          "BitcoinTransferService"
        ],
        "summary": "List supported withdrawal exchanges",
        "description": "Lists the exchanges accepted in SendBitcoinRequest.tfr_info.exchange.",
        "operationId": "BitcoinTransferService_ListSupportedWithdrawalExchanges",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListSupportedWithdrawalExchangesResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/withdrawal-requirements/bitcoin": {
      "get": {
        "tags": [
          "BitcoinTransferService"
        ],
        "summary": "Check withdrawal requirements",
        "description": "Checks whether a withdrawal to this destination needs recipient information.\n SendBitcoin checks again when the withdrawal is submitted.",
        "operationId": "BitcoinTransferService_GetBitcoinWithdrawalRequirements",
        "parameters": [
          {
            "name": "destination",
            "in": "query",
            "description": "Required. Accepts the same formats as SendBitcoinRequest.destination.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetBitcoinWithdrawalRequirementsResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/withdrawals/bitcoin": {
      "post": {
        "tags": [
          "BitcoinTransferService"
        ],
        "summary": "Initiate withdrawal",
        "description": "Initiates a bitcoin withdrawal. The transaction is not completed until\n it is confirmed by the network it is sent onto. A success response from\n this endpoint means the transaction was successfully initiated, but\n does not guarantee completion. Supply an idempotency_key to prevent\n duplicate withdrawals after a timeout. Reusing a key returns HTTP 409\n (AlreadyExists), with the existing withdrawal ID in the error message.\n Requests can still fail validation before duplicate detection.\n Without a key, check your withdrawals before retrying.",
        "operationId": "BitcoinTransferService_SendBitcoin",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SendBitcoinRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SendBitcoinResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKey": [],
            "apiHmac": [],
            "apiNonce": []
          }
        ]
      }
    },
    "/v1/withdrawals/bitcoin/{withdrawalId}": {
      "get": {
        "tags": [
          "BitcoinTransferService"
        ],
        "summary": "Fetch withdrawal",
        "description": "Fetches a bitcoin withdrawal.",
        "operationId": "BitcoinTransferService_GetBitcoinWithdrawal",
        "parameters": [
          {
            "name": "withdrawalId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetBitcoinWithdrawalResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "BitcoinAccount": {
        "type": "object",
        "properties": {
          "id": {
            "example": "acc_01HQZX3V9KJ4M2P8R6T0W5Y7BC",
            "type": "string"
          },
          "availableBtc": {
            "example": 0.0245,
            "type": "number",
            "description": "The current BTC holdings that can be used for trading or withdrawals.",
            "format": "double"
          },
          "totalBtc": {
            "example": 0.0251,
            "type": "number",
            "description": "The BTC balance of the account.",
            "format": "double"
          },
          "totalNok": {
            "example": 26304.8,
            "type": "number",
            "description": "The NOK value of the BTC of the account, at the time of the request.",
            "format": "double"
          },
          "name": {
            "example": "Hovedkonto",
            "type": "string",
            "description": "The name of the account."
          },
          "createTime": {
            "example": "2024-06-03T08:15:42.103948Z",
            "type": "string",
            "description": "When this account was created.",
            "format": "date-time"
          },
          "deleteTime": {
            "example": "2025-11-14T09:03:11.482190Z",
            "type": "string",
            "description": "When this account was deleted.\n Empty if the account is not deleted.",
            "format": "date-time"
          }
        }
      },
      "DepositDestination": {
        "type": "object",
        "properties": {
          "destination": {
            "example": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
            "type": "string"
          },
          "network": {
            "example": "NETWORK_BITCOIN",
            "enum": [
              "NETWORK_BITCOIN",
              "NETWORK_LIGHTNING"
            ],
            "type": "string",
            "format": "enum"
          }
        }
      },
      "DepositDestinationsResponse": {
        "type": "object",
        "properties": {
          "onchainAddress": {
            "example": {
              "destination": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
              "network": "NETWORK_BITCOIN"
            },
            "allOf": [
              {
                "$ref": "#/components/schemas/DepositDestination"
              }
            ],
            "description": "Bitcoin address for on-chain deposits to the account."
          },
          "lightningAddress": {
            "example": {
              "destination": "aktiv-anker@bb.no",
              "network": "NETWORK_LIGHTNING"
            },
            "allOf": [
              {
                "$ref": "#/components/schemas/DepositDestination"
              }
            ],
            "description": "Lightning address (name@bb.no) that accepts payments of any amount to the\n account."
          },
          "lnurlPay": {
            "example": {
              "destination": "LNURL1DP68GURN8GHJ7CTSDYHXYC3WDEHJ7MRFVA58GMNFDENJ7MRWW4EXCTTSV9UN7CTRVDHH2MN584SKXC6LXQC5S526TQE4VW2TFG6Y6VJS8PFRV4PS2U64JD6ZGVN82UM9WG7N2C33VCEKXVN995UXZDRY956XVDNZ95UK2VNR95MKGVTPXP3RXCE5V56KVGK8387",
              "network": "NETWORK_LIGHTNING"
            },
            "allOf": [
              {
                "$ref": "#/components/schemas/DepositDestination"
              }
            ],
            "description": "LNURL-pay code that accepts Lightning payments to the account."
          }
        }
      },
      "GetBitcoinWithdrawalRequirementsResponse": {
        "type": "object",
        "properties": {
          "tfrInfoRequired": {
            "type": "boolean",
            "description": "Whether SendBitcoin needs tfr_info for this destination. Requirements can\n change, so SendBitcoin validates the request again when it is submitted."
          }
        }
      },
      "GetBitcoinWithdrawalResponse": {
        "type": "object",
        "properties": {
          "withdrawalId": {
            "example": "wi_01JA2B3C4D5E6F7G8H9J0K1M2N",
            "type": "string"
          },
          "destination": {
            "example": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
            "type": "string",
            "description": "The destination of the withdrawal."
          },
          "network": {
            "example": "NETWORK_BITCOIN",
            "enum": [
              "NETWORK_BITCOIN",
              "NETWORK_LIGHTNING"
            ],
            "type": "string",
            "description": "The network this withdrawal was sent on.",
            "format": "enum"
          },
          "amountBtc": {
            "example": 0.01,
            "type": "number",
            "description": "The amount of BTC that was withdrawn.",
            "format": "double"
          },
          "amountNok": {
            "example": 10480,
            "type": "number",
            "description": "The value of the BTC that was withdrawn, in NOK equivalent\n at time of withdrawal.",
            "format": "double"
          },
          "status": {
            "example": "WITHDRAWAL_STATUS_COMPLETED",
            "enum": [
              "WITHDRAWAL_STATUS_PENDING",
              "WITHDRAWAL_STATUS_COMPLETED",
              "WITHDRAWAL_STATUS_FAILED"
            ],
            "type": "string",
            "description": "The status of the withdrawal.",
            "format": "enum"
          },
          "createdAt": {
            "example": "2026-03-14T09:26:53.589793Z",
            "type": "string",
            "description": "The time the withdrawal was initiated.",
            "format": "date-time"
          },
          "sentAt": {
            "example": "2026-03-14T09:31:07.214552Z",
            "type": "string",
            "description": "The time the withdrawal was sent from the platform.",
            "format": "date-time"
          }
        }
      },
      "GetFiatAccountResponse": {
        "type": "object",
        "properties": {
          "availableNok": {
            "example": 12500.5,
            "type": "number",
            "description": "The current NOK holdings that can be used for trading or\n withdrawals.",
            "format": "double"
          }
        }
      },
      "GetLightningInvoiceResponse": {
        "type": "object",
        "properties": {
          "depositDestinationId": {
            "example": "ded_01JA3QW7E2R9T4Y6V8P0S1D3F5",
            "type": "string"
          },
          "invoice": {
            "example": "lnbc2500u1pvjluezsp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygspp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdq5xysxxatsyp3k7enxv4jsxqzpu9qrsgquk0rl77nj30yxdy8j9vdx85fkpmdla2087ne0xh8nhedh8w27kyke0lp53ut353s06fv3qfegext0eh0ymjpf39tuven09sam30g4vgpfna3rh",
            "type": "string"
          },
          "status": {
            "example": "INVOICE_STATUS_PAID",
            "enum": [
              "INVOICE_STATUS_UNPAID",
              "INVOICE_STATUS_PENDING",
              "INVOICE_STATUS_PAID",
              "INVOICE_STATUS_EXPIRED",
              "INVOICE_STATUS_CANCELED"
            ],
            "type": "string",
            "format": "enum"
          },
          "expiresAt": {
            "example": "2026-07-04T10:15:00Z",
            "type": "string",
            "description": "When the invoice stops being payable. This is the expiry encoded into the\n invoice itself, so a payer's wallet enforces it too.",
            "format": "date-time"
          },
          "amountReceivedMillisatoshi": {
            "example": "250000000",
            "type": "string",
            "description": "The amount the payer sent, in millisatoshis. Set only when the invoice is\n paid. It is never less than the amount encoded in the invoice, but can be\n more: Lightning nodes accept overpayment."
          },
          "paidAt": {
            "example": "2026-07-04T10:02:31Z",
            "type": "string",
            "description": "When the invoice was paid. Set only when the invoice is paid.",
            "format": "date-time"
          },
          "preimage": {
            "example": "0001020304050607080900010203040506070809000102030405060708090102",
            "type": "string",
            "description": "The payment preimage, hex encoded. Its SHA-256 hash is the payment hash\n encoded in the invoice, so it is proof of payment. Set only when the\n invoice is paid."
          }
        }
      },
      "GetTaxBalanceResponse": {
        "type": "object",
        "properties": {
          "balanceNok": {
            "example": "12500.5",
            "type": "string",
            "description": "Stringified decimal number: the user's NOK balance."
          },
          "bitcoinAccounts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxAccountBalance"
            }
          }
        }
      },
      "Info": {
        "type": "object",
        "properties": {
          "fullName": {
            "type": "string",
            "description": "Full name of the person, or registered name of the organisation, on the\n other side of the transfer. Required for both people and organisations."
          },
          "country": {
            "type": "string",
            "description": "Country of that person or organisation, as an ISO-3166-1 alpha-2 code."
          },
          "address": {
            "type": "string",
            "description": "Postal address of that person or organisation. For a withdrawal, the\n bitcoin address or invoice goes in SendBitcoinRequest.destination instead."
          },
          "nin": {
            "type": "string",
            "description": "National identity number of the person, or 9-digit Norwegian\n organisasjonsnummer of the organisation. Supply it for self-custody\n withdrawals. It can be omitted for withdrawals to an exchange."
          },
          "exchange": {
            "type": "string",
            "description": "Name of the exchange holding the account. For withdrawals, choose a name\n from ListSupportedWithdrawalExchanges. Leave empty for self-custody."
          },
          "selfCustody": {
            "type": "boolean",
            "description": "True when the destination is a wallet held outside an exchange. Otherwise\n set this to false and provide exchange."
          },
          "ownWallet": {
            "type": "boolean",
            "description": "True when the wallet or exchange account belongs to the Bare Bitcoin\n customer. False when it belongs to another person or organisation."
          }
        }
      },
      "ListBitcoinAccountsResponse": {
        "type": "object",
        "properties": {
          "accounts": {
            "example": [
              {
                "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"
              }
            ],
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/BitcoinAccount"
            }
          },
          "totalBtc": {
            "example": 0.0251,
            "type": "number",
            "description": "The total BTC balance of all accounts.",
            "format": "double"
          },
          "totalNok": {
            "example": 26304.8,
            "type": "number",
            "description": "The total NOK value of the BTC of all accounts,\n at the time of the request.",
            "format": "double"
          }
        }
      },
      "ListSupportedWithdrawalExchangesResponse": {
        "type": "object",
        "properties": {
          "exchanges": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SupportedWithdrawalExchange"
            }
          }
        }
      },
      "ListTaxTransactionsResponse": {
        "type": "object",
        "properties": {
          "transactions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaxTransaction"
            }
          },
          "hasMore": {
            "type": "boolean",
            "description": "True if there are more transactions available after the last one returned."
          },
          "nextAfter": {
            "example": "2024-02-01T10:22:36Z",
            "type": "string",
            "description": "Cursor for the next page: pass this as 'after' in the next request.",
            "format": "date-time"
          },
          "nextAfterId": {
            "example": "tr_01HVXHG9PMDKR3YQV4Z8W5T2BN",
            "type": "string",
            "description": "Tiebreaker for the cursor: pass this as 'after_id' in the next request."
          }
        }
      },
      "ListTradesResponse": {
        "type": "object",
        "properties": {
          "trades": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Trade"
            }
          },
          "hasMore": {
            "type": "boolean",
            "description": "Whether there are more trades to fetch."
          },
          "nextBefore": {
            "type": "string",
            "description": "Pass as 'before' in the next request to fetch the next page.",
            "format": "date-time"
          },
          "nextBeforeId": {
            "type": "string",
            "description": "Pass as 'before_id' in the next request to fetch the next page."
          }
        }
      },
      "NewLightningInvoiceRequest": {
        "type": "object",
        "properties": {
          "accountId": {
            "example": "acc_01HQZX3V9KJ4M2P8R6T0W5Y7BC",
            "type": "string",
            "description": "if empty, the default account is used."
          },
          "currency": {
            "example": "CURRENCY_NOK",
            "enum": [
              "CURRENCY_BTC",
              "CURRENCY_NOK"
            ],
            "type": "string",
            "description": "The currency the invoice is denominated in. Once created, the invoice\n is for a specific amount of bitcoin.",
            "format": "enum"
          },
          "amount": {
            "example": 2620,
            "type": "number",
            "description": "The amount of the invoice, in the requested currency. Setting to 0\n creates an invoice where any amount is accepted.",
            "format": "double"
          },
          "publicDescription": {
            "example": "Kaffe og kanelbolle",
            "type": "string",
            "description": "Public description of the invoice. The invoice commits to it through its\n description hash; the memo field is left empty, so most wallets do not\n show it to the payer."
          },
          "internalDescription": {
            "example": "faktura-1042",
            "type": "string",
            "description": "Free-form text description of the invoice. Can be used to correlate with\n your own systems. Only shown to the creator of this invoice, within the\n Bare Bitcoin systems."
          },
          "expirySeconds": {
            "example": 900,
            "type": "integer",
            "description": "How long the invoice stays payable, counted from when it is created. At\n least 60 seconds, at most 24 hours. If empty, the invoice expires after\n 24 hours.",
            "format": "uint32"
          }
        }
      },
      "NewLightningInvoiceResponse": {
        "type": "object",
        "properties": {
          "depositDestinationId": {
            "example": "ded_01JA3QW7E2R9T4Y6V8P0S1D3F5",
            "type": "string"
          },
          "invoice": {
            "example": "lnbc2500u1pvjluezsp5zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zyg3zygspp5qqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqqqsyqcyq5rqwzqfqypqdq5xysxxatsyp3k7enxv4jsxqzpu9qrsgquk0rl77nj30yxdy8j9vdx85fkpmdla2087ne0xh8nhedh8w27kyke0lp53ut353s06fv3qfegext0eh0ymjpf39tuven09sam30g4vgpfna3rh",
            "type": "string"
          },
          "expiresAt": {
            "example": "2026-07-04T10:15:00Z",
            "type": "string",
            "description": "When the invoice stops being payable. This is the expiry encoded into the\n invoice itself, so a payer's wallet enforces it too.",
            "format": "date-time"
          }
        }
      },
      "NewOrderRequest": {
        "type": "object",
        "properties": {
          "type": {
            "example": "ORDER_TYPE_MARKET",
            "enum": [
              "ORDER_TYPE_MARKET",
              "ORDER_TYPE_LIMIT"
            ],
            "type": "string",
            "format": "enum"
          },
          "direction": {
            "example": "DIRECTION_BUY",
            "enum": [
              "DIRECTION_BUY",
              "DIRECTION_SELL"
            ],
            "type": "string",
            "format": "enum"
          },
          "amount": {
            "example": 5000,
            "type": "number",
            "description": "Amount to spend. Must be positive. When buying, this is the amount in NOK.\n When selling, this is the amount in BTC.",
            "format": "double"
          },
          "accountId": {
            "example": "acc_01HQZX3V9KJ4M2P8R6T0W5Y7BC",
            "type": "string",
            "description": "The bitcoin account to use for this order. Empty for default account."
          },
          "description": {
            "example": "Månedlig sparing",
            "type": "string",
            "description": "Free-form text description of the order. Can be used to correlate with\n your own systems."
          },
          "price": {
            "example": 1040000,
            "type": "number",
            "description": "The price to buy or sell at. Only used for limit orders.",
            "format": "double"
          }
        }
      },
      "NewOrderResponse": {
        "type": "object",
        "properties": {
          "orderId": {
            "example": "or_01J9ZK4T7M2QXW8B3N5R6V1Y0C",
            "type": "string",
            "description": "ID of the created order."
          },
          "tradeId": {
            "example": "tr_01J9ZK4T7S8P2D6F4H0K3M5N7Q",
            "type": "string",
            "description": "If this was a market order, the order resulted in a trade. Empty if not\n market order."
          }
        }
      },
      "OpenOrdersResponse": {
        "type": "object",
        "properties": {
          "orders": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Order"
            }
          }
        }
      },
      "Order": {
        "type": "object",
        "properties": {
          "orderId": {
            "example": "or_01J9ZK4T7M2QXW8B3N5R6V1Y0C",
            "type": "string"
          },
          "type": {
            "example": "ORDER_TYPE_LIMIT",
            "enum": [
              "ORDER_TYPE_MARKET",
              "ORDER_TYPE_LIMIT"
            ],
            "type": "string",
            "format": "enum"
          },
          "direction": {
            "example": "DIRECTION_BUY",
            "enum": [
              "DIRECTION_BUY",
              "DIRECTION_SELL"
            ],
            "type": "string",
            "format": "enum"
          },
          "amount": {
            "example": 5000,
            "type": "number",
            "format": "double"
          },
          "createdAt": {
            "example": "2026-03-14T09:26:53.589793Z",
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PriceResponse": {
        "type": "object",
        "properties": {
          "price": {
            "example": 1048000,
            "type": "number",
            "description": "The mid price.",
            "format": "double"
          },
          "bid": {
            "example": 1046000,
            "type": "number",
            "description": "Current bid price, without fees.",
            "format": "double"
          },
          "ask": {
            "example": 1050000,
            "type": "number",
            "description": "Current ask price, without fees.",
            "format": "double"
          },
          "timestamp": {
            "example": "2026-03-14T09:26:53.589793Z",
            "type": "string",
            "description": "The time the price was fetched.",
            "format": "date-time"
          },
          "card": {
            "example": {
              "buy": 1088850,
              "sell": 1007298
            },
            "allOf": [
              {
                "$ref": "#/components/schemas/UserPrice"
              }
            ],
            "description": "Effective price, when paying with card."
          },
          "bank": {
            "example": {
              "buy": 1057350,
              "sell": 1038678
            },
            "allOf": [
              {
                "$ref": "#/components/schemas/UserPrice"
              }
            ],
            "description": "Effective price, when paying with bank transfer."
          }
        }
      },
      "SendBitcoinRequest": {
        "type": "object",
        "properties": {
          "destination": {
            "example": "bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh",
            "type": "string",
            "description": "The bitcoin destination to send funds to.\n Supported formats:\n - Bitcoin address (bech32, legacy-segwit, legacy)\n - Lightning invoice (bolt11)\n - Lightning address\n - Lightning LNURL"
          },
          "amountBtc": {
            "example": 0.01,
            "type": "number",
            "description": "The amount to send.\n This field is required for all destinations except Lightning invoices.\n If the destination is a Lightning invoice, the amount is derived from the\n invoice.",
            "format": "double"
          },
          "accountId": {
            "example": "acc_01HQZX3V9KJ4M2P8R6T0W5Y7BC",
            "type": "string",
            "description": "The ID of the account to send from. If empty, the default account is used."
          },
          "isPayment": {
            "example": false,
            "type": "boolean",
            "description": "Marks the transaction as a payment. This has consequences for how the\n transaction is exported for tax purposes. It has no effect on the\n bitcoin transaction itself."
          },
          "description": {
            "example": "Til hardware-lommebok",
            "type": "string",
            "description": "Free-form text description of the withdrawal. Can be used to correlate with\n your own systems."
          },
          "tfrInfo": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Info"
              }
            ],
            "description": "Information about the recipient under the travel rule. Call\n GetBitcoinWithdrawalRequirements to check whether it is needed for this\n destination. full_name and postal address are always required when supplied,\n including for an organisation."
          },
          "idempotencyKey": {
            "example": "0b943d76-3f66-4cb1-a088-95899d503402",
            "maxLength": 128,
            "type": "string",
            "description": "Optional, case-insensitive identifier of up to 128 characters for this\n withdrawal attempt.\n Unique per user across all accounts and API credentials. Omitted or empty\n disables duplicate protection. Use an opaque value such as a random UUID.\n Creating another withdrawal with a stored key returns HTTP 409\n (AlreadyExists), even if the inputs differ. Validation errors can occur\n before duplicate detection. Keys do not expire and remain used if the\n withdrawal fails or is cancelled. A request that fails before storing a\n withdrawal does not consume its key. Retries still need a fresh API nonce\n and HMAC. The conflict message includes the existing withdrawal ID."
          }
        }
      },
      "SendBitcoinResponse": {
        "type": "object",
        "properties": {
          "withdrawalId": {
            "example": "wi_01JA2B3C4D5E6F7G8H9J0K1M2N",
            "type": "string",
            "description": "The ID of the initiated withdrawal."
          },
          "network": {
            "example": "NETWORK_BITCOIN",
            "enum": [
              "NETWORK_BITCOIN",
              "NETWORK_LIGHTNING"
            ],
            "type": "string",
            "format": "enum"
          },
          "status": {
            "example": "WITHDRAWAL_STATUS_COMPLETED",
            "enum": [
              "WITHDRAWAL_STATUS_PENDING",
              "WITHDRAWAL_STATUS_COMPLETED",
              "WITHDRAWAL_STATUS_FAILED"
            ],
            "type": "string",
            "description": "The status of the withdrawal. The withdrawal might immediately succeed,\n if sending to another user of the Bare Bitcoin platform.",
            "format": "enum"
          }
        }
      },
      "SupportedWithdrawalExchange": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Pass this name as SendBitcoinRequest.tfr_info.exchange."
          }
        }
      },
      "TaxAccountBalance": {
        "type": "object",
        "properties": {
          "id": {
            "example": "acc_01HQZX3V9KJ4M2P8R6T0W5Y7BC",
            "type": "string"
          },
          "name": {
            "example": "Sparekonto",
            "type": "string"
          },
          "balanceBtc": {
            "example": "1.89975850",
            "type": "string",
            "description": "Stringified decimal number with 8 decimal places: the BTC balance of the\n account."
          },
          "deleteTime": {
            "example": "2025-11-14T09:03:11Z",
            "type": "string",
            "description": "When this account was deleted. Empty if the account is not deleted. Only\n ever set when the request asked for deleted accounts.",
            "format": "date-time"
          }
        }
      },
      "TaxTransaction": {
        "type": "object",
        "properties": {
          "id": {
            "example": "tr_01HVXHG9PMDKR3YQV4Z8W5T2BN",
            "type": "string",
            "description": "ID of the underlying transaction; its format depends on the type. Trades\n use the trade ID (tr_), bitcoin deposits de_, bonuses gb_, fiat withdrawals\n fpu_, adjustments abj_ or apj_, and costs the payment ID (in_ or pi_).\n Bitcoin withdrawals and card deposits use a UUID, which is not the\n withdrawal_id returned by the transfer endpoints. Bank deposits use the\n bank's reference."
          },
          "accountId": {
            "example": "acc_01HQZX3V9KJ4M2P8R6T0W5Y7BC",
            "type": "string",
            "description": "The bitcoin account the transaction belongs to. Empty for fiat deposits\n and fiat withdrawals, which are not tied to an account."
          },
          "type": {
            "enum": [
              "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"
            ],
            "type": "string",
            "description": "The kind of transaction, and the fields it fills. Each value has the\n prefix TAX_TRANSACTION_TYPE_.\n\n - BTC_BUY: a buy of BTC with NOK. In: BTC. Out: NOK. Fee: NOK, the trade\n   fee plus the payment method fee. Sub-type: \"market\", \"limit\" or \"manual\".\n - BTC_SELL: a sale of BTC for NOK. In: NOK. Out: BTC. Fee: BTC. Sub-type:\n   \"market\", \"limit\" or \"manual\".\n - BTC_WITHDRAWAL: BTC sent from the account. Out: BTC, without fees. Fee:\n   BTC, the network fee plus the service fee. Sub-type: \"onchain\",\n   \"lightning\", \"internal\" or \"internal-external\".\n - BTC_DEPOSIT: BTC received into the account. In: BTC. Sub-type:\n   \"onchain\", \"internal\", \"internal-external\", \"lightning-payment-request\",\n   \"lightning-address\" or \"lightning-lnurl\".\n - BTC_BONUS: BTC that Bare Bitcoin gave to the user. In: BTC. No sub-type.\n - FIAT_DEPOSIT: NOK paid in. In: NOK. Sub-type: \"bank\" or \"card\".\n - FIAT_WITHDRAWAL: NOK paid out to a bank account. Out: NOK. Fee: NOK,\n   when not zero. No sub-type.\n - BTC_ADJUSTMENT: a manual change to a BTC balance by Bare Bitcoin. No\n   trade occurred. In: BTC for an increase. Out: BTC for a decrease.\n   Sub-type: \"write_off\" for a debt that Bare Bitcoin will not collect,\n   \"correction\" for a wrong balance, or \"unspecified\".\n - FIAT_ADJUSTMENT: a manual change to the NOK balance by Bare Bitcoin. In:\n   NOK for an increase. Out: NOK for a decrease. Sub-types as for\n   BTC_ADJUSTMENT.\n - COST: a deductible cost paid in NOK. Out: NOK. Sub-type: \"bb_plus\".",
            "format": "enum"
          },
          "subType": {
            "example": "market",
            "enum": [
              "",
              "market",
              "limit",
              "manual",
              "onchain",
              "lightning",
              "internal",
              "internal-external",
              "lightning-payment-request",
              "lightning-address",
              "lightning-lnurl",
              "bank",
              "card",
              "write_off",
              "correction",
              "bb_plus",
              "unspecified"
            ],
            "type": "string",
            "description": "Sub-type of the transaction. The type field lists the sub-types of each\n type. Empty when the transaction has no sub-type."
          },
          "createTime": {
            "example": "2024-02-01T10:22:36Z",
            "type": "string",
            "format": "date-time"
          },
          "finalizeTime": {
            "example": "2024-02-01T10:41:05Z",
            "type": "string",
            "description": "Unset while the transaction is still pending, e.g. a bitcoin deposit\n that is not yet confirmed.",
            "format": "date-time"
          },
          "inAmount": {
            "example": "0.1",
            "type": "string",
            "description": "Stringified decimal number: the amount the user received. \"0\" when the\n type has no in side. The type field shows the sides of each type."
          },
          "inCurrency": {
            "example": "BTC",
            "type": "string",
            "description": "\"BTC\" or \"NOK\". Empty when the type has no in side."
          },
          "outAmount": {
            "example": "65000",
            "type": "string",
            "description": "Stringified decimal number: the amount the user paid. \"0\" when the type\n has no out side. Includes trade fees; withdrawal fees are additional."
          },
          "outCurrency": {
            "example": "NOK",
            "type": "string",
            "description": "\"BTC\" or \"NOK\". Empty when the type has no out side."
          },
          "feeAmount": {
            "example": "455",
            "type": "string",
            "description": "Stringified decimal number. When the fee is zero, fee_currency may be\n empty."
          },
          "feeCurrency": {
            "example": "NOK",
            "type": "string"
          },
          "rateMarket": {
            "example": "645450",
            "type": "string",
            "description": "Stringified decimal number: the market rate in NOK per BTC at the time of\n the transaction. \"0\" for fiat transfers, adjustments and costs."
          },
          "isPayment": {
            "example": false,
            "type": "boolean",
            "description": "Whether the transaction was a payment to a third party, as declared by\n the user. Only ever set for bitcoin withdrawals."
          },
          "paymentInfo": {
            "example": "f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16:bc1qw508d6qejxtdg4y5r3zarvary0c5xw7kv8f3t4",
            "type": "string",
            "description": "For bitcoin transfers: `<network ID>:<destination address>`. For bank\n fiat transfers: the counterparty bank account number. Empty for card\n deposits, trades and bonuses."
          },
          "note": {
            "example": "Første kjøp",
            "type": "string",
            "description": "Free-form user-supplied description."
          },
          "usdnok": {
            "example": "10.45",
            "type": "string",
            "description": "Stringified decimal number: the USD/NOK exchange rate at the time of the\n transaction, when known."
          },
          "runningBalanceBtc": {
            "example": "1.8997585",
            "type": "string",
            "description": "Stringified decimal number: the user's total BTC balance across all\n accounts after this transaction."
          }
        }
      },
      "Trade": {
        "type": "object",
        "properties": {
          "id": {
            "example": "tr_01HVXHG9PMDKR3YQV4Z8W5T2BN",
            "type": "string"
          },
          "accountId": {
            "example": "acc_01HQZX3V9KJ4M2P8R6T0W5Y7BC",
            "type": "string",
            "description": "The bitcoin account the trade belongs to."
          },
          "direction": {
            "enum": [
              "DIRECTION_BUY",
              "DIRECTION_SELL"
            ],
            "type": "string",
            "format": "enum"
          },
          "amountNok": {
            "example": "65000",
            "type": "string",
            "description": "Stringified decimal number: the NOK amount paid when buying, or received\n when selling."
          },
          "amountBtc": {
            "example": "0.10000000",
            "type": "string",
            "description": "Stringified decimal number with 8 decimal places: the BTC amount received\n when buying, or sold when selling."
          },
          "feeAmount": {
            "example": "455",
            "type": "string",
            "description": "Stringified decimal number. When the fee is zero, fee_currency may be\n empty."
          },
          "feeCurrency": {
            "example": "NOK",
            "type": "string"
          },
          "createTime": {
            "example": "2024-02-01T10:22:36Z",
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "UserPrice": {
        "type": "object",
        "properties": {
          "buy": {
            "example": 1057350,
            "type": "number",
            "format": "double"
          },
          "sell": {
            "example": 1038678,
            "type": "number",
            "format": "double"
          }
        },
        "description": "The prices a user can expect to pay for a given amount of BTCNOK,\n with a given payment method."
      },
      "VolumeHistoricResponse": {
        "type": "object",
        "properties": {
          "dailyVolume": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VolumeHistoricResponse_DailyVolume"
            }
          },
          "shareOfTotalVolume": {
            "example": {
              "Bare Bitcoin": 0.41,
              "Firi": 0.38,
              "NBX": 0.21
            },
            "type": "object",
            "additionalProperties": {
              "type": "number",
              "format": "double"
            },
            "description": "Each market's share of the total volume for the period in question."
          }
        }
      },
      "VolumeHistoricResponse_DailyVolume": {
        "type": "object",
        "properties": {
          "date": {
            "example": "2026-03-14",
            "type": "string",
            "description": "YYYY-MM-DD"
          },
          "stats": {
            "example": {
              "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
              }
            },
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/VolumeHistoricResponse_MarketStats"
            },
            "description": "Each market's volume for the day."
          }
        }
      },
      "VolumeHistoricResponse_MarketStats": {
        "type": "object",
        "properties": {
          "name": {
            "example": "Bare Bitcoin",
            "type": "string"
          },
          "color": {
            "example": "#FF8000",
            "type": "string"
          },
          "volumeNok": {
            "example": 4823117,
            "type": "number",
            "format": "double"
          },
          "volumeBtc": {
            "example": 4.61234567,
            "type": "number",
            "format": "double"
          },
          "shareOfTotalVolume": {
            "example": 0.41,
            "type": "number",
            "description": "Share of the total volume for the day in question.",
            "format": "double"
          }
        }
      },
      "VolumeResponse": {
        "type": "object",
        "properties": {
          "daily": {
            "example": {
              "amountNok": 4823117,
              "amountBtc": 4.61234567,
              "buyPercentage": 63,
              "numberOfTrades": 412
            },
            "allOf": [
              {
                "$ref": "#/components/schemas/VolumeStats"
              }
            ],
            "description": "Volume for the requested date, in Oslo time."
          },
          "monthly": {
            "example": {
              "amountNok": 98234511,
              "amountBtc": 93.81234567,
              "buyPercentage": 58,
              "numberOfTrades": 8731
            },
            "allOf": [
              {
                "$ref": "#/components/schemas/VolumeStats"
              }
            ],
            "description": "Volume for the calendar month containing the requested date."
          },
          "yearly": {
            "example": {
              "amountNok": 412345678,
              "amountBtc": 402.12345678,
              "buyPercentage": 61,
              "numberOfTrades": 37104
            },
            "allOf": [
              {
                "$ref": "#/components/schemas/VolumeStats"
              }
            ],
            "description": "Volume for the calendar year containing the requested date."
          },
          "last24h": {
            "example": {
              "amountNok": 5102334,
              "amountBtc": 4.87654321,
              "buyPercentage": 64,
              "numberOfTrades": 437
            },
            "allOf": [
              {
                "$ref": "#/components/schemas/VolumeStats"
              }
            ],
            "description": "Volume for the last 24 hours, regardless of the requested date."
          },
          "last7d": {
            "example": {
              "amountNok": 31245870,
              "amountBtc": 29.84512345,
              "buyPercentage": 61,
              "numberOfTrades": 2870
            },
            "allOf": [
              {
                "$ref": "#/components/schemas/VolumeStats"
              }
            ],
            "description": "Volume for the last 7 days, regardless of the requested date."
          },
          "last30d": {
            "example": {
              "amountNok": 262104523,
              "amountBtc": 376.41234567,
              "buyPercentage": 58,
              "numberOfTrades": 41907
            },
            "allOf": [
              {
                "$ref": "#/components/schemas/VolumeStats"
              }
            ],
            "description": "Volume for the last 30 days, regardless of the requested date."
          },
          "last365d": {
            "example": {
              "amountNok": 2412345678,
              "amountBtc": 2602.12345678,
              "buyPercentage": 60,
              "numberOfTrades": 437104
            },
            "allOf": [
              {
                "$ref": "#/components/schemas/VolumeStats"
              }
            ],
            "description": "Volume for the last 365 days, regardless of the requested date."
          },
          "allTime": {
            "example": {
              "amountNok": 5123456789,
              "amountBtc": 6102.12345678,
              "buyPercentage": 62,
              "numberOfTrades": 912345
            },
            "allOf": [
              {
                "$ref": "#/components/schemas/VolumeStats"
              }
            ],
            "description": "Volume for all trades at Bare Bitcoin."
          }
        }
      },
      "VolumeStats": {
        "type": "object",
        "properties": {
          "amountNok": {
            "example": 4823117,
            "type": "number",
            "format": "double"
          },
          "amountBtc": {
            "example": 4.61234567,
            "type": "number",
            "format": "double"
          },
          "buyPercentage": {
            "example": 63,
            "type": "number",
            "format": "double"
          },
          "numberOfTrades": {
            "example": 412,
            "type": "integer",
            "format": "int32"
          }
        }
      }
    },
    "securitySchemes": {
      "apiKey": {
        "type": "apiKey",
        "description": "Public part of your API key. Starts with `bb/public/`.",
        "name": "x-bb-api-key",
        "in": "header"
      },
      "apiNonce": {
        "type": "apiKey",
        "description": "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.",
        "name": "x-bb-api-nonce",
        "in": "header"
      },
      "apiHmac": {
        "type": "apiKey",
        "description": "HMAC authentication for the API request, constructed using the corresponding secret value from your API key.",
        "name": "x-bb-api-hmac",
        "in": "header"
      },
      "oauth2": {
        "type": "oauth2",
        "description": "OAuth2 access token obtained through the authorization code flow. Only available on a subset of endpoints. The required scope is listed per operation.",
        "flows": {
          "authorizationCode": {
            "authorizationUrl": "https://barebitcoin.no/oauth2/authorize",
            "tokenUrl": "https://barebitcoin.no/oauth2/token",
            "refreshUrl": "https://barebitcoin.no/oauth2/token",
            "scopes": {
              "api:accounts:bitcoin:read": "See balance and names of your bitcoin accounts",
              "api:trades:read": "See executed trades",
              "api:tax:transactions:read": "Read transactions relevant for tax calculation",
              "api:deposits:lightning:read": "See Lightning invoices and their payment status",
              "api:deposits:lightning:write": "Create Lightning invoices for payments to you"
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "apiKey": []
    }
  ],
  "tags": [
    {
      "name": "BitcoinTransferService",
      "description": "Transfer bitcoin in and out of the platform. Fetch information about past\n bitcoin transfers."
    },
    {
      "name": "PublicService",
      "description": "Public endpoints that don't require authentication"
    },
    {
      "name": "TaxService"
    },
    {
      "name": "TradingService",
      "description": "Execute and cancel orders. Fetch information about past orders."
    },
    {
      "name": "UserService",
      "description": "Fetch information the authenticated user and its bitcoin accounts."
    }
  ]
}