Bitget APIBitget API
UTAClassic
Legacy Doc
  • Overview
  • API Documentation
  • WebSocket
  • Agent Hub
  • SDK
  • Changelog
Copied to clipboard
CFD
    CFD Trade
      Place CFD OrderpostModify CFD OrderpostCancel CFD OrderpostCancel All CFD OrderspostClose CFD PositionspostClose All CFD PositionspostGet CFD Unfilled OrdersgetGet CFD Order HistorygetGet CFD Current Positionsget
CFD Trade
CFD Trade

CFD Trade

CFD — Trade


Place CFD Order

POST
https://api.bitget.com
/api/v3/cfd/trade/place-order

Rate limit: 1/sec/UID
Permission: UTA trade (read & write)

This endpoint is used to place an order on a CFD account.

Place CFD Order › Request Parameters

symbol
​string · required

Trading pair name

Example: XAUUSD
orderType
​string · required

Order type
limit: Limit order
market: Market order

Example: market
side
​string · required

Trade side
buy: Buy
sell: Sell

Example: buy
qty
​string · required

Order quantity

Example: 1
price
​string

Order price
Required when orderType=limit
The price must be an integer multiple of the trading pair's precision

takeProfit
​string

Take-profit price
The price must be an integer multiple of the trading pair's precision

stopLoss
​string

Stop-loss price
The price must be an integer multiple of the trading pair's precision

Place CFD Order › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object
trxId
​string

Request ID

POST/api/v3/cfd/trade/place-order
curl https://api.bitget.com/api/v3/cfd/trade/place-order \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "symbol": "XAUUSD", "orderType": "market", "side": "buy", "qty": "1" }'
Example Request Body
{ "symbol": "XAUUSD", "orderType": "market", "side": "buy", "qty": "1" }
json
application/json
Example Responses
{ "code": "00000", "msg": "success", "requestTime": 1740000000000, "data": { "trxId": "111111111111111111" } }
json
application/json

Modify CFD Order

POST
https://api.bitget.com
/api/v3/cfd/trade/modify-order

Rate limit: 1/sec/UID
Permission: UTA trade (read & write)

This endpoint is used to modify an order on a CFD account.

Modify CFD Order › Request Parameters

orderId
​string · required

Order ID

Example: 111111111111111111
price
​string

Order price
Required when orderType=limit

takeProfit
​string

Take-profit price

stopLoss
​string

Stop-loss price

Modify CFD Order › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object
orderId
​string

Order ID

POST/api/v3/cfd/trade/modify-order
curl https://api.bitget.com/api/v3/cfd/trade/modify-order \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "orderId": "111111111111111111", "price": "2620.00" }'
Example Request Body
{ "orderId": "111111111111111111", "price": "2620.00" }
json
application/json
Example Responses
{ "code": "00000", "msg": "success", "requestTime": 1740000000000, "data": { "orderId": "111111111111111111" } }
json
application/json

Cancel CFD Order

POST
https://api.bitget.com
/api/v3/cfd/trade/cancel-order

Rate limit: 1/sec/UID
Permission: UTA trade (read & write)

This endpoint is used to cancel an order on a CFD account.

Cancel CFD Order › Request Parameters

orderId
​string · required

Order ID

Example: 111111111111111111

Cancel CFD Order › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
data
​

null

POST/api/v3/cfd/trade/cancel-order
curl https://api.bitget.com/api/v3/cfd/trade/cancel-order \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "orderId": "111111111111111111" }'
Example Request Body
{ "orderId": "111111111111111111" }
json
application/json
Example Responses
{ "code": "00000", "msg": "success", "requestTime": 1740000000000, "data": null }
json
application/json

Cancel All CFD Orders

POST
https://api.bitget.com
/api/v3/cfd/trade/cancel-all

Rate limit: 1/sec/UID
Permission: UTA trade (read & write)

This endpoint is used to cancel all orders on a CFD account.

Cancel All CFD Orders › Request Parameters

symbol
​string

Trading pair name
If not provided, all orders are canceled
If symbol is provided, only orders for the specified trading pair are canceled

Cancel All CFD Orders › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
data
​

null

POST/api/v3/cfd/trade/cancel-all
curl https://api.bitget.com/api/v3/cfd/trade/cancel-all \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "symbol": "XAUUSD" }'
Example Request Body
{ "symbol": "XAUUSD" }
json
application/json
Example Responses
{ "code": "00000", "msg": "success", "requestTime": 1740000000000, "data": null }
json
application/json

Close CFD Positions

POST
https://api.bitget.com
/api/v3/cfd/trade/close-positions

Rate limit: 10/sec/UID
Permission: UTA trade (read & write)

This endpoint is used to close positions on a CFD account. Only market-price closing is currently supported.

Close CFD Positions › Request Parameters

positionId
​string · required

Position ID
Can be obtained via the position list endpoint

Example: 111111111111111111
qty
​string · required

Order quantity

Example: 1

Close CFD Positions › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
data
​

null

POST/api/v3/cfd/trade/close-positions
curl https://api.bitget.com/api/v3/cfd/trade/close-positions \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "positionId": "111111111111111111", "qty": "1" }'
Example Request Body
{ "positionId": "111111111111111111", "qty": "1" }
json
application/json
Example Responses
{ "code": "00000", "msg": "success", "requestTime": 1740000000000, "data": null }
json
application/json

Close All CFD Positions

POST
https://api.bitget.com
/api/v3/cfd/trade/close-all-positions

Rate limit: 1/sec/UID
Permission: UTA trade (read & write)

This endpoint is used to close all positions on a CFD account.

Close All CFD Positions › Request Parameters

symbol
​string

Trading pair name
If not provided, all positions are closed
If symbol is provided, only positions for the specified trading pair are closed

Close All CFD Positions › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
data
​

null

POST/api/v3/cfd/trade/close-all-positions
curl https://api.bitget.com/api/v3/cfd/trade/close-all-positions \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "symbol": "XAUUSD" }'
Example Request Body
{ "symbol": "XAUUSD" }
json
application/json
Example Responses
{ "code": "00000", "msg": "success", "requestTime": 1740000000000, "data": null }
json
application/json

Get CFD Unfilled Orders

GET
https://api.bitget.com
/api/v3/cfd/trade/unfilled-order

Rate limit: 10/sec/UID
Permission: UTA trade (read-only)

This endpoint is used to query unfilled orders on a CFD account.

Get CFD Unfilled Orders › Request Parameters

symbol
​string · required

Trading pair name

Example: XAUUSD
subUid
​string

Sub-account UID
Used to query a sub-account's unfilled orders

Get CFD Unfilled Orders › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object[]
symbol
​string

Trading pair name

orderType
​string

Order type
limit: Limit order
market: Market order

side
​string

Trade side
buy: Buy
sell: Sell

price
​string

Order price

qty
​string

Order quantity

takeProfit
​string

Take-profit price

stopLoss
​string

Stop-loss price

trxId
​string

Request ID

orderId
​string

Order ID

GET/api/v3/cfd/trade/unfilled-order
curl 'https://api.bitget.com/api/v3/cfd/trade/unfilled-order?symbol=<string>'
Example Responses
{ "code": "00000", "msg": "success", "requestTime": 1740000000000, "data": [ { "symbol": "XAUUSD", "orderType": "limit", "side": "buy", "price": "2620.00", "qty": "1", "takeProfit": "2650.00", "stopLoss": "2600.00", "trxId": "111111111111111111", "orderId": "111111111111111112" } ] }
json
application/json

Get CFD Order History

GET
https://api.bitget.com
/api/v3/cfd/trade/history-order

Rate limit: 10/sec/UID
Permission: UTA trade (read-only)

This endpoint is used to query historical orders on a CFD account.

The query span per request must not exceed 30 days. The maximum lookback period is 90 days.

Get CFD Order History › Request Parameters

symbol
​string · required

Trading pair name

Example: XAUUSD
subUid
​string

Sub-account UID
Used to query a sub-account's historical orders

startTime
​string

Start time, Unix millisecond timestamp

Example: 1672410780000
endTime
​string

End time, Unix millisecond timestamp

Example: 1672410780000
limit
​string

Number of entries per page
Default: 10, range [1, 50]
For the first page, the number of entries returned may be greater than the specified limit

Example: 10
pageNo
​string

Page number

cursor
​string

Cursor
Not required for the first page
Required from the second page onward: pass the orderId of the last record from the previous page's response

Get CFD Order History › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object
​object[]

List

GET/api/v3/cfd/trade/history-order
curl 'https://api.bitget.com/api/v3/cfd/trade/history-order?symbol=<string>'
Example Responses
{ "code": "00000", "msg": "success", "requestTime": 1740000000000, "data": { "list": [ { "symbol": "XAUUSD", "orderType": "limit", "side": "buy", "price": "2620.00", "qty": "1", "cumExecQty": "1", "takeProfit": "2650.00", "stopLoss": "2600.00", "status": "filled", "trxId": "111111111111111111", "orderId": "111111111111111112" } ] } }
json
application/json

Get CFD Current Positions

GET
https://api.bitget.com
/api/v3/cfd/trade/current-positions

Rate limit: 10/sec/UID
Permission: UTA trade (read-only)

This endpoint is used to query real-time position information on a CFD account.

Get CFD Current Positions › Request Parameters

symbol
​string

Trading pair name
If not provided, current positions for all trading pairs are returned

Example: XAUUSD
subUid
​string

Sub-account UID
Used by a master account to query a sub-account's position list

Get CFD Current Positions › Response Parameters

200

Successful response

code
​string
msg
​string
requestTime
​integer
​object[]
positionId
​string

Position ID

symbol
​string

Trading pair name

orderType
​string

Order type
limit: Limit order
market: Market order

side
​string

Trade side
buy: Buy
sell: Sell

qty
​string

Order quantity

openPrice
​string

Opening price

takeProfit
​string

Take-profit price

stopLoss
​string

Stop-loss price

interest
​string

Overnight interest

unrealizedPnl
​string

Unrealized profit and loss

totalProfit
​string

Total profit
Total profit = Overnight interest + Unrealized profit and loss

GET/api/v3/cfd/trade/current-positions
curl https://api.bitget.com/api/v3/cfd/trade/current-positions
Example Responses
{ "code": "00000", "msg": "success", "requestTime": 1740000000000, "data": [ { "positionId": "111111111111111111", "symbol": "XAUUSD", "orderType": "limit", "side": "buy", "qty": "1", "openPrice": "2610.00", "takeProfit": "2650.00", "stopLoss": "2600.00", "interest": "0", "unrealizedPnl": "10.5", "totalProfit": "10.5" } ] }
json
application/json