KUCOIN API - EU
SDK
Telegram
Kucoin
  1. Margin Trading
  • Introduction
  • Authentication
  • Enums Definitions
  • Terms Definitions
  • SDK
  • Rate Limit
  • Classic REST
    • Account Info
      • Account & Funding
        • Get Account Summary Info
        • Get KYC Regions
        • Get Apikey Info
        • Get Account Type - Spot
        • Get Account List - Spot
        • Get Account Detail - Spot
        • Get Account - Cross Margin
        • Get Account - Isolated Margin
        • Get Account Ledgers - Spot/Margin
        • Get Account Ledgers - Trade_hf
        • Get Account Ledgers - Margin_hf
      • Sub Account
        • Add sub-account
        • Add sub-account Margin Permission
        • Get sub-account List - Summary Info
        • Get sub-account Detail - Balance
        • Get sub-account List - Spot Balance (V2)
      • Sub Account API
        • Get sub-account API List
        • Add sub-account API
        • Modify sub-account API
        • Delete sub-account API
      • Deposit
        • Add Deposit Address (V3)
        • Get Deposit Address (V3)
        • Get Deposit History
      • Withdrawals
        • Get Withdrawal Quotas
        • Withdraw (V4)
        • Cancel Withdrawal
        • Get Withdrawal History
        • Get Withdrawal History By ID
      • Transfer
        • Get Transfer Quotas
        • Flex Transfer
      • Trade Fee
        • Get Basic Fee - Spot/Margin
        • Get Actual Fee - Spot/Margin
    • Spot Trading
      • Market Data
        • Get Announcements
        • Get Currency
        • Get All Currencies
        • Get Symbol
        • Get All Symbols
        • Get Ticker
        • Get All Tickers
        • Get Trade History
        • Get Klines
        • Get Part OrderBook
        • Get Full OrderBook
        • Get Call Auction Part OrderBook
        • Get Call Auction Info
        • Get Fiat Price
        • Get 24hr Stats
        • Get Market List
        • Get Client IP Address
        • Get Server Time
        • Get Service Status
      • Orders
        • Add Order
        • Add Order Sync
        • Add Order Test
        • Batch Add Orders
        • Batch Add Orders Sync
        • Cancel Order By OrderId
        • Cancel Order By OrderId Sync
        • Cancel Order By ClientOid
        • Cancel Order By ClientOid Sync
        • Cancel Partial Order
        • Cancel All Orders By Symbol
        • Cancel All Orders
        • Modify Order
        • Get Order By OrderId
        • Get Order By ClientOid
        • Get Symbols With Open Order
        • Get Open Orders
        • Get Open Orders By Page
        • Get Closed Orders
        • Get Trade History
        • Get DCP
        • Set DCP
        • Add Stop Order
        • Cancel Stop Order By ClientOid
        • Cancel Stop Order By OrderId
        • Batch Cancel Stop Orders
        • Get Stop Orders List
        • Get Stop Order By OrderId
        • Get Stop Order By ClientOid
        • Add OCO Order
        • Cancel OCO Order By OrderId
        • Cancel OCO Order By ClientOid
        • Batch Cancel OCO Order
        • Get OCO Order By OrderId
        • Get OCO Order By ClientOid
        • Get OCO Order Detail By OrderId
        • Get OCO Order List
    • Margin Trading
      • Market Data
        • Get Symbols - Cross Margin
        • Get Symbols - Isolated Margin
        • Get Mark Price Detail
        • Get Margin Config
        • Get Mark Price List
        • Get Margin Collateral Ratio
        • Get Market Available Inventory
      • Orders
        • Add Order
        • Add Order Test
        • Cancel Order By OrderId
        • Cancel Order By ClientOid
        • Cancel All Orders By Symbol
        • Get Symbols With Open Order
        • Get Open Orders
        • Get Closed Orders
        • Get Trade History
        • Get Order By OrderId
        • Get Order By ClientOid
      • Debit
        • Borrow
        • Get Borrow History
        • Repay
        • Get Repay History
        • Get Interest History
        • Modify Leverage
      • Risk Limit
        • Get Margin Risk Limit
    • Earn
      • Simple Earn
        • Purchase
        • Get Redeem Preview
        • Redeem
        • Get Savings Products
        • Get Promotion Products
        • Get Account Holding
    • Broker
      • Introduction
      • Broker Application
      • Instructions
      • Broker Pro
        • Introduction
        • Broker Fast API Service
        • Get Broker Rebate
        • Get Commission
        • Get User List
        • Get User Transactions
  • Classic Websocket
    • Base Info
      • Introduction
      • Get Public Token - Classic Spot/Margin
      • Get Private Token - Classic Spot/Margin
    • Spot Trading
      • Public Channels
        • Ticker
        • All Tickers
        • Orderbook - Level 1
        • Orderbook - Level 5
        • Orderbook - Level 50
        • Orderbook - Increment
        • Call Auction Orderbook - Level 50
        • Call Auction Data
        • Klines
        • Trade
        • Symbol Snapshot
        • Market Snapshot
      • Private Channels
        • Order V2
        • Order V1
        • Balance
        • Stop Order
    • Margin Trading
      • Public Channels
        • Index Price
        • Mark Price
      • Private Channels
        • Cross Margin Position
        • Isolated Margin Position
  • Error Code
    • HTTP
    • Spot
    • Margin
    • Earn
    • Websocket
  • Abandoned Endpoints
    • Introduction
    • Account & Funding
      • Get sub-account List - Summary Info (V1)
      • Get sub-account List - Spot Balance (V1)
      • Get Deposit Addresses (V2)
      • Get Deposit Addresses - V1
      • Get Deposit History - Old
      • Get Withdrawal History - Old
      • Add Deposit Address - V1
      • Withdraw - V1
    • Spot Trading
      • Orders
        • Add Order - Old
        • Add Order Test - Old
        • Batch Add Orders - Old
        • Cancel Order By OrderId - Old
        • Cancel Order By ClientOid - Old
        • Batch Cancel Order - Old
        • Get Orders List - Old
        • Get Recent Orders List - Old
        • Get Order By OrderId - Old
        • Get Order By ClientOid - Old
        • Get Trade History - Old
        • Get Recent Trade History - Old
    • Margin Trading
      • Get Account Detail - Margin
        GET
      • Add Order - V1
        POST
      • Add Order Test - V1
        POST
      • Get Account List - Isolated Margin - V1
        GET
      • Get Account Detail - Isolated Margin - V1
        GET
  • Developing
    • Introduction
  1. Margin Trading

Add Order Test - V1

POST
https://api.kucoin.eu/api/v1/margin/order/test
api-channel:Private
api-permission:Margin
api-rate-limit-pool:Spot
sdk-service:Margin
sdk-sub-service:Order
sdk-method-name:addOrderTestV1
api-rate-limit-weight:5
TIPS
It is recommended to use the POST /api/v3/hf/margin/order/test endpoint instead of this endpoint
Description
Order test endpoint: This endpoint’s request and return parameters are identical to the order endpoint, and can be used to verify whether the signature is correct, among other operations. After placing an order, the order will not enter the matching system, and the order cannot be queried.
Tips
Please note that once your order enters the order book, the system will freeze the handling fees for the order ahead of time.
Before placing orders, please be sure to fully understand the meaning of the parameters for each trading pair.
Tips
The maximum number of active orders per account is 2000, with a maximum of 200 active orders per trading pair.
Public order placement request parameters
ParamTypeMandatoryDescription
clientOidStringYesClient Order ID, unique identifier created by the user, the use of UUID is recommended
symbolStringYessymbol
sideStringYes‘buy’ or ‘sell’
typeStringNoOrder type ‘limit’ and ‘market’, default is limit
stpStringNoself trade prevention is divided into four strategies: ‘CN’, ‘CO’, ‘CB’, and ‘DC’
marginModelStringNoThe type of trading, including cross (cross mode) and isolated (isolated mode). It is set at cross by default.
autoBorrowbooleanNoWhen Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate.
autoRepaybooleanNoAutoPay allows returning borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount.
Additional Request Parameters Required by ‘limit’ Orders
ParamTypeMandatoryDescription
priceStringYesSpecify price for currency
sizeStringYesSpecify quantity for currency
timeInForceStringNoOrder timing strategy ‘GTC’, ‘GTT’, ‘IOC’, ‘FOK’ (the default is ‘GTC’)
cancelAfterlongNoCancel after ‘n’ seconds, the order timing strategy is ‘GTT’
postOnlybooleanNopassive order labels, this is disabled when the order timing strategy is ‘IOC’ or ‘FOK’
hiddenbooleanNoHidden or not (not shown in order book)
icebergbooleanNoWhether or not only visible portions of orders are shown in iceberg orders
visibleSizeStringNoMaximum visible quantity in iceberg orders
Additional request parameters required by ‘market’ orders
ParamTypeMandatoryDescription
sizeStringNo(Select one out of two: ‘size’ or ‘funds’)
fundsStringNo(Select one out of two: ‘size’ or ‘funds’)
Hidden Orders and Iceberg Orders (Hidden & Iceberg)
Hidden orders and iceberg orders can be set in advanced settings (iceberg orders are a special type of hidden order). When placing limit orders or stop limit orders, you can choose to execute according to either hidden orders or iceberg orders.
Hidden orders are not shown in order books.
Unlike hidden orders, iceberg orders are divided into visible and hidden portions. When engaging in iceberg orders, visible order sizes must be set. The minimum visible size for an iceberg order is 1/20 of the total order size.
When matching, the visible portions of iceberg orders are matched first. Once the visible portions are fully matched, hidden portions will emerge. This will continue until the order is fully filled.
Note:
The system will charge taker fees for hidden orders and iceberg orders.
If you simultaneously set iceberg orders and hidden orders, your order will default to an iceberg order for execution.
Hold
For limit price purchase orders, we will hold the amount of funds (price * size) required for your purchase order. Similarly, for limit price sell orders, we will also hold you sell order assets. When the transaction is executed, the service fees will be calculated. If you cancel a portion of a filled or unfilled order, then the remaining funds or amounts will be released and returned to your account. For market price buy/sell orders that require specific funds, we will hold the required funds in from your account. If only the size is specified, we may freeze (usually for a very short amount of time) all of the funds in your account prior to the order being filled or canceled.
Order Lifecycle
When an order placement request is successful (the matching engine receives the order) or denied (due to there being insufficient funds or illegal parameter values, etc.), the system will respond to the HTTP request. When an order is successfully placed, the order ID is returned. The order will be matched, which could result in it being fully or partially filled. When an order is fully or partially filled, the remaining portions of the order will be in an active state awaiting to be matched (this does not include IOC orders). Orders that are fully or partially filled (already canceled) will be put into the “done” state.
Users that have subscribed to the Market Data Channel can use the order ID (orderId) and client ID (clientOid) to identify messages.
Price Protection Mechanisms
Price protection mechanisms ae enabled for order placements. Rules are detailed below:
If the spot trading market order/limit order placed by the user can be directly matched with an order in the current order book, the system will judge whether deviation between the price corresponding to the transaction depth and the spread exceeds the threshold value (the threshold value can be obtained using the symbol API endpoint);
If it is exceeded, for limit orders, the order will be directly canceled;
If it is a market order, then the system will partially execute the order. The execution limit will be the order size within the price range corresponding to the threshold value. The remaining orders will not be filled.
For example: If the threshold value is 10%, when a user places a market price purchase order in the KCS/USDT trading market for 10,000 USDT (the selling price is currently 1.20000), the system will determine that after the order is completely filled, the final price will be 1.40000. (1.40000-1.20000)/1.20000=16.7%>10%. The threshold value is 1.32000. The user’s market price purchase order will be filled only to a maximum of 1.32000. The remaining order portions will not be matched with orders in the order book. Note: This feature may not be able to determine depth with complete accuracy. If your order is not completely filled, it may be because the portion exceeding the threshold value was not filled.

Request

Body Params application/json

Example
//limit order
{
    "type": "limit",
    "symbol": "BTC-USDT",
    "side": "buy",
    "price": "50000",
    "size": "0.00001",
    "clientOid": "5c52e11203aa677f33e4193fb",
    "remark": "order remarks"
}

//market order 1
// {
//     "type": "market",
//     "symbol": "BTC-USDT",
//     "side": "buy",
//     "size": "0.00001",
//     "clientOid": "5c52e11203aa677f33e493fc",
//     "remark": "order remarks"
// }

//market order 2
// {
//     "type": "market",
//     "symbol": "BTC-USDT",
//     "side": "buy",
//     "funds": "1",
//     "clientOid": "5c52e11203aa677f33e493fc",
//     "remark": "order remarks"
// }

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.kucoin.eu/api/v1/margin/order/test' \
--header 'Content-Type: application/json' \
--data-raw '//limit order
{
    "type": "limit",
    "symbol": "BTC-USDT",
    "side": "buy",
    "price": "50000",
    "size": "0.00001",
    "clientOid": "5c52e11203aa677f33e4193fb",
    "remark": "order remarks"
}

//market order 1
// {
//     "type": "market",
//     "symbol": "BTC-USDT",
//     "side": "buy",
//     "size": "0.00001",
//     "clientOid": "5c52e11203aa677f33e493fc",
//     "remark": "order remarks"
// }

//market order 2
// {
//     "type": "market",
//     "symbol": "BTC-USDT",
//     "side": "buy",
//     "funds": "1",
//     "clientOid": "5c52e11203aa677f33e493fc",
//     "remark": "order remarks"
// }'

Responses

🟢200OK
application/json
Body

Example
{
    "code": "200000",
    "data": {
        "orderId": "671bb90194422f00073ff4f0",
        "loanApplyId": null,
        "borrowSize": null,
        "clientOid": null
    }
}
Modified at 2026-01-12 03:42:17
Previous
Add Order - V1
Next
Get Account List - Isolated Margin - V1