bitcain docs
API Reference

Orders

Order management - create, cancel, and track trading orders with risk management

List User Orders

GET
/api/v1/orders

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

portfolio_id?|

Filter by portfolio ID

order_status?|

Filter by order status

symbol?|

Filter by trading symbol (exact match)

start_date?|

Filter orders created after this date

end_date?|

Filter orders created before this date

limit?integer

Maximum number of orders to return

Default50
Range1 <= value <= 200
offset?integer

Number of orders to skip for pagination

Default0
Range0 <= value
cursor?|

Cursor for pagination (alternative to offset)

Response Body

application/json

application/json

curl -X GET "https://loading/api/v1/orders"
{}
Empty
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
Empty

Create Trading Order

POST
/api/v1/orders

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

trading_mode?string

Trading mode: 'paper' or 'live'

Default"live"
exchange?string

Exchange to route order to (e.g., 'binanceus', 'coinbase')

Default"binanceus"
source?string

Order source: 'manual', 'agent', 'strategy'

Default"manual"
agent_id?|

AI agent UUID (if source is 'agent')

Request Body

application/json

symbol*string
Lengthlength <= 20
side*string

Trade type enumeration.

Value in"buy" | "sell"
type*string

Order type enumeration.

Value in"market" | "limit" | "stop_loss" | "take_profit" | "stop_limit" | "trailing_stop" | "iceberg" | "oco"
quantity*|
price?||
portfolio_id?|
stop_price?||
time_in_force?string

Time in force enumeration.

Default"gtc"
Value in"gtc" | "ioc" | "fok" | "gtt"
expires_at?|
reduce_only?boolean
Defaultfalse
post_only?boolean
Defaultfalse
client_order_id?|
source?string

Order source enumeration.

Default"manual"
Value in"manual" | "agent" | "strategy"
agent_id?|

Response Body

application/json

application/json

curl -X POST "https://loading/api/v1/orders" \  -H "Content-Type: application/json" \  -d '{    "symbol": "string",    "side": "buy",    "type": "market",    "quantity": 0  }'
{}
Empty
Empty
Empty
Empty
Empty
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
Empty

Get Order Details

GET
/api/v1/orders/{order_id}

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

order_id*string
Formatuuid

Response Body

application/json

application/json

curl -X GET "https://loading/api/v1/orders/497f6eca-6276-4993-bfeb-53cbbbba6f08"
{}
Empty
Empty
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Update Order

PATCH
/api/v1/orders/{order_id}

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

order_id*string
Formatuuid

Request Body

application/json

quantity?||
price?||
stop_price?||
time_in_force?|
expires_at?|
status?|

Response Body

application/json

application/json

curl -X PATCH "https://loading/api/v1/orders/497f6eca-6276-4993-bfeb-53cbbbba6f08" \  -H "Content-Type: application/json" \  -d '{}'
{}
Empty
Empty
Empty
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Cancel Order

DELETE
/api/v1/orders/{order_id}

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

order_id*string
Formatuuid

Response Body

application/json

application/json

curl -X DELETE "https://loading/api/v1/orders/497f6eca-6276-4993-bfeb-53cbbbba6f08"
{}
Empty
Empty
Empty
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Retry Failed Order

POST
/api/v1/orders/{order_id}/retry

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Path Parameters

order_id*string
Formatuuid

Response Body

application/json

application/json

curl -X POST "https://loading/api/v1/orders/497f6eca-6276-4993-bfeb-53cbbbba6f08/retry"
{}
Empty
Empty
Empty
Empty
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}

Get Order History

GET
/api/v1/orders/history

Authorization

HTTPBearer
AuthorizationBearer <token>

In: header

Query Parameters

start_date?|

Filter orders from this date

end_date?|

Filter orders until this date

order_status?|

Filter by order status

limit?integer

Maximum number of orders to return

Default100
Range1 <= value <= 500

Response Body

application/json

application/json

curl -X GET "https://loading/api/v1/orders/history"
{}
Empty
{
  "detail": [
    {
      "loc": [
        "string"
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}