Menu
API reference / Orders
Create an order
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.
POST https://api.bb.no/v1/orders
Authentication
Signed API key
Send x-bb-api-key. Also send x-bb-api-nonce and x-bb-api-hmac.
API-key permission: trading.
Parameters
No path or query parameters.
Request body
A request body is required.
application/json
Show fields
typestring · enumValues: ORDER_TYPE_MARKET, ORDER_TYPE_LIMIT
Example: "ORDER_TYPE_MARKET"
directionstring · enumValues: DIRECTION_BUY, DIRECTION_SELL
Example: "DIRECTION_BUY"
amountnumber · doubleAmount to spend. Must be positive. When buying, this is the amount in NOK. When selling, this is the amount in BTC.
Example: 5000
accountIdstringThe bitcoin account to use for this order. Empty for default account.
Example: "acc_01HQZX3V9KJ4M2P8R6T0W5Y7BC"
descriptionstringFree-form text description of the order. Can be used to correlate with your own systems.
Example: "Månedlig sparing"
pricenumber · doubleThe price to buy or sell at. Only used for limit orders.
Example: 1040000
Responses
200 · OK
application/jsonShow fields
orderIdstringID of the created order.
Example: "or_01J9ZK4T7M2QXW8B3N5R6V1Y0C"
tradeIdstringIf this was a market order, the order resulted in a trade. Empty if not market order.
Example: "tr_01J9ZK4T7S8P2D6F4H0K3M5N7Q"