Package Information
Downloads: 0 weekly / 144 monthly
Latest Version: 1.0.0
Author: TK
Available Nodes
Documentation
n8n-nodes-tk-modify-orders
A custom n8n node package for the Bitget Exchange (Futures/Contracts).
Includes all parameters from the official Bitget API v2 for placing, modifying orders, and managing open positions.
Nodes Included
| Node | Operation |
|---|---|
| Bitget TK – Place Order | Place a new futures order (all order types, TP/SL presets, STP) |
| Bitget TK – Modify Open Order | Modify pending regular orders, trigger/plan orders, or TP/SL orders |
| Bitget TK – Modify Open Position | Change leverage, margin, margin mode, position mode, set TP/SL, flash close |
Installation
From npm (once published)
cd ~/.n8n/custom
npm install n8n-nodes-tk-modify-orders
Manual Installation (local development)
# 1. Clone / copy this folder to your n8n custom nodes directory
cp -r n8n-nodes-tk-modify-orders ~/.n8n/custom/
# 2. Install and build
cd ~/.n8n/custom/n8n-nodes-tk-modify-orders
npm install
npm run build
# 3. Restart n8n
Build from Source (TypeScript)
npm install
npm run build
Credentials Setup
In n8n, create a new credential of type Bitget TK API and fill in:
| Field | Description |
|---|---|
| API Key | Your Bitget API Key |
| Secret Key | Your Bitget Secret Key |
| Passphrase | The passphrase set when creating your API key |
Generate credentials at: Bitget → Settings → API Management
Node Reference
1. Bitget TK – Place Order
Endpoint: POST /api/v2/mix/order/place-order
| Parameter | Type | Required | Description |
|---|---|---|---|
| symbol | string | ✅ | e.g. BTCUSDT |
| productType | select | ✅ | USDT-FUTURES, COIN-FUTURES, USDC-FUTURES, SUSDT-FUTURES, SCOIN-FUTURES, SUSDC-FUTURES |
| marginMode | select | ✅ | isolated / crossed |
| marginCoin | string | ✅ | e.g. USDT |
| side | select | ✅ | buy / sell |
| tradeSide | select | — | open / close (hedge mode only) |
| orderType | select | ✅ | limit / market |
| size | string | ✅ | Order quantity |
| price | string | for limit | Limit price |
| force | select | — | gtc / ioc / fok / post_only |
| clientOid | string | — | Custom order ID (recommended) |
| reduceOnly | select | — | NO / YES |
| presetStopSurplusPrice | string | — | Preset TP trigger price |
| presetStopSurplusExecutePrice | string | — | Preset TP execute price |
| presetStopSurplusTriggerType | select | — | fill_price / mark_price / index_price |
| presetStopLossPrice | string | — | Preset SL trigger price |
| presetStopLossExecutePrice | string | — | Preset SL execute price |
| presetStopLossTriggerType | select | — | fill_price / mark_price / index_price |
| stpMode | select | — | Self-trade prevention: cancel_maker / cancel_taker / cancel_both |
2. Bitget TK – Modify Open Order
Choose the Order Operation:
A) Modify Regular Order
Endpoint: POST /api/v2/mix/order/modify-order
| Parameter | Description |
|---|---|
| symbol, productType, marginCoin | Identify the market |
| orderId / clientOid | Identify the order (at least one required) |
| newClientOid | Reassign a new client ID |
| newPrice | New limit price |
| newSize | New quantity |
| newPresetStopSurplusPrice | Update attached TP price |
| newPresetStopLossPrice | Update attached SL price |
B) Modify Trigger / Plan Order
Endpoint: POST /api/v2/mix/order/modify-plan-order
| Parameter | Description |
|---|---|
| planType | normal_plan (trigger) / track_plan (trailing stop) |
| orderId / clientOid | Identify the order |
| newSize | New quantity |
| newPrice | New execution price |
| newTriggerPrice | New trigger price |
| newTriggerType | fill_price / mark_price / index_price |
| newCallbackRatio | Trailing ratio (%) for track_plan |
| newStopSurplusTriggerPrice / Type / ExecutePrice | Attached TP modification |
| newStopLossTriggerPrice / Type / ExecutePrice | Attached SL modification |
C) Modify TP/SL Order
Endpoint: POST /api/v2/mix/order/modify-tpsl-order
| Parameter | Description |
|---|---|
| orderId / clientOid | Identify the order |
| triggerPrice | New trigger price |
| triggerType | fill_price / mark_price / index_price |
| executePrice | New execution price (0 = market) |
| size | New quantity |
| rangeRate | Trailing % for trailing TP/SL |
3. Bitget TK – Modify Open Position
Choose the Position Operation:
| Operation | Endpoint | Key Parameters |
|---|---|---|
| Change Leverage | POST /api/v2/mix/account/set-leverage |
symbol, productType, marginCoin, leverage, holdSide (long/short for hedge) |
| Adjust Position Margin | POST /api/v2/mix/account/set-margin |
symbol, productType, marginCoin, amount (+/-), holdSide |
| Change Margin Mode | POST /api/v2/mix/account/set-margin-mode |
symbol, productType, marginCoin, marginMode (isolated/crossed) |
| Change Position Mode | POST /api/v2/mix/account/set-position-mode |
productType, posMode (one_way_mode/hedge_mode) |
| Set Position TP/SL | POST /api/v2/mix/order/place-pos-tpsl |
symbol, holdSide, stopSurplus + stopLoss trigger/execute/type prices, custom clientOids |
| Place Single TP/SL | POST /api/v2/mix/order/place-tpsl-order |
planType, symbol, holdSide, triggerPrice, triggerType, executePrice, size, rangeRate |
| Flash Close Position | POST /api/v2/mix/order/close-positions |
symbol, productType, holdSide (or both), clientOid |
Position Mode Guide
One-Way Mode:
side=buy→ Opens long OR closes shortside=sell→ Opens short OR closes long- Use
reduceOnly=YESto force close-only
Hedge Mode:
side=buy+tradeSide=open→ Open longside=buy+tradeSide=close→ Close longside=sell+tradeSide=open→ Open shortside=sell+tradeSide=close→ Close short
Rate Limits
All endpoints: 10 requests/second per UID
API Reference
- Bitget API v2 Docs
- Place Order
- Modify Order
- Modify Trigger Order
- Modify TPSL Order
- Flash Close
- Set Leverage
- Set Margin
- Set Margin Mode
- Set Position Mode
- Place Pos TPSL
- Place TPSL Order
License
MIT