Skip to content
Bare BitcoinDevelopers

Search documentation

↑ ↓ Select · Enter Open · Escape Close

barebitcoin.no ↗
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.

View Markdown

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.

Authentication guide →

Parameters

No path or query parameters.

Request body

A request body is required.

application/json

NewOrderRequest
Show fields
typestring · enum

Values: ORDER_TYPE_MARKET, ORDER_TYPE_LIMIT

Example: "ORDER_TYPE_MARKET"

directionstring · enum

Values: DIRECTION_BUY, DIRECTION_SELL

Example: "DIRECTION_BUY"

amountnumber · double

Amount to spend. Must be positive. When buying, this is the amount in NOK. When selling, this is the amount in BTC.

Example: 5000

accountIdstring

The bitcoin account to use for this order. Empty for default account.

Example: "acc_01HQZX3V9KJ4M2P8R6T0W5Y7BC"

descriptionstring

Free-form text description of the order. Can be used to correlate with your own systems.

Example: "Månedlig sparing"

pricenumber · double

The price to buy or sell at. Only used for limit orders.

Example: 1040000

Responses

200 · OK

application/json
NewOrderResponse
Show fields
orderIdstring

ID of the created order.

Example: "or_01J9ZK4T7M2QXW8B3N5R6V1Y0C"

tradeIdstring

If this was a market order, the order resulted in a trade. Empty if not market order.

Example: "tr_01J9ZK4T7S8P2D6F4H0K3M5N7Q"