{ "openapi": "3.0.1", "info": { "title": "margin", "description": "", "version": "1.0.0" }, "tags": [], "paths": { "/api/v3/margin/symbols": { "get": { "summary": "Get Symbols - Cross Margin", "deprecated": false, "description": "This endpoint allows querying the configuration of cross margin symbol.", "tags": [], "parameters": [ { "name": "symbol", "in": "query", "description": "If not provided, all cross margin symbol will be queried. If provided, only the specified symbol will be queried.", "required": false, "schema": { "type": "string", "example": [ "BTC-USDT", "ETH-USDT", "KCS-USDT" ] } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "object", "properties": { "timestamp": { "type": "integer", "format": "int64" }, "items": { "type": "array", "items": { "type": "object", "properties": { "symbol": { "type": "string", "description": "symbol" }, "name": { "type": "string", "description": "Symbol name" }, "enableTrading": { "type": "boolean", "description": "Whether trading is enabled: True for enabled; false for disabled" }, "market": { "type": "string", "description": "Trading market" }, "baseCurrency": { "type": "string", "description": "Base currency, e.g. BTC." }, "quoteCurrency": { "type": "string", "description": "Quote currency, e.g. USDT." }, "baseIncrement": { "type": "string", "description": "Quantity increment: The quantity for an order must be a positive integer multiple of this increment. Here, the size refers to the quantity of the base currency for the order. For example, for the ETH-USDT trading pair, if the baseIncrement is 0.0000001, the order quantity can be 1.0000001 but not 1.00000001." }, "baseMinSize": { "type": "string", "description": "The minimum order quantity required to place an order." }, "quoteIncrement": { "type": "string", "description": "Quote increment: The funds for a market order must be a positive integer multiple of this increment. The funds refer to the quote currency amount. For example, for the ETH-USDT trading pair, if the quoteIncrement is 0.000001, the amount of USDT for the order can be 3000.000001 but not 3000.0000001." }, "quoteMinSize": { "type": "string", "description": "The minimum order funds required to place a market order." }, "baseMaxSize": { "type": "string", "description": "The maximum order size required to place an order." }, "quoteMaxSize": { "type": "string", "description": "The maximum order funds required to place a market order." }, "priceIncrement": { "type": "string", "description": "Price increment: The price of an order must be a positive integer multiple of this increment. For example, for the ETH-USDT trading pair, if the priceIncrement is 0.01, the order price can be 3000.01 but not 3000.001.\n\nSpecifies the min. order price as well as the price increment.This also applies to quote currency." }, "feeCurrency": { "type": "string", "description": "The currency of charged fees." }, "priceLimitRate": { "type": "string", "description": "Threshold for price protection" }, "minFunds": { "type": "string", "description": "The minimum trading amounts" } }, "required": [ "symbol", "name", "enableTrading", "market", "baseCurrency", "quoteCurrency", "baseIncrement", "baseMinSize", "quoteIncrement", "quoteMinSize", "baseMaxSize", "quoteMaxSize", "priceIncrement", "feeCurrency", "priceLimitRate", "minFunds" ] } } }, "required": [ "timestamp", "items" ] } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470189", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Public", "x-api-permission": "NULL", "x-api-rate-limit-pool": "Public", "x-sdk-service": "Margin", "x-sdk-sub-service": "Market", "x-sdk-method-name": "getCrossMarginSymbols", "x-sdk-method-description": "This endpoint allows querying the configuration of cross margin symbol.", "x-api-rate-limit-weight": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"timestamp\\\": 1729665839353,\\n \\\"items\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"name\\\": \\\"BTC-USDT\\\",\\n \\\"enableTrading\\\": true,\\n \\\"market\\\": \\\"USDS\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"quoteCurrency\\\": \\\"USDT\\\",\\n \\\"baseIncrement\\\": \\\"0.00000001\\\",\\n \\\"baseMinSize\\\": \\\"0.00001\\\",\\n \\\"baseMaxSize\\\": \\\"10000000000\\\",\\n \\\"quoteIncrement\\\": \\\"0.000001\\\",\\n \\\"quoteMinSize\\\": \\\"0.1\\\",\\n \\\"quoteMaxSize\\\": \\\"99999999\\\",\\n \\\"priceIncrement\\\": \\\"0.1\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"priceLimitRate\\\": \\\"0.1\\\",\\n \\\"minFunds\\\": \\\"0.1\\\"\\n }\\n ]\\n }\\n}", "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\"}", "operationId": "001" } }, "/api/v3/etf/info": { "get": { "summary": "Get ETF Info", "deprecated": false, "description": "This interface returns leveraged token information.", "tags": [], "parameters": [ { "name": "currency", "in": "query", "description": "ETF Currency: If empty, query all currencies\n", "required": false, "schema": { "type": "string" } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "array", "items": { "type": "object", "properties": { "currency": { "type": "string", "description": "ETF Currency" }, "netAsset": { "type": "string", "description": "Net worth" }, "targetLeverage": { "type": "string", "description": "Target leverage" }, "actualLeverage": { "type": "string", "description": "Actual leverage" }, "issuedSize": { "type": "string", "description": "The amount of currency issued" }, "basket": { "type": "string", "description": "Basket information" } }, "required": [ "currency", "netAsset", "targetLeverage", "actualLeverage", "issuedSize", "basket" ] } } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470191", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Public", "x-api-permission": "NULL", "x-api-rate-limit-pool": "Public", "x-sdk-service": "Margin", "x-sdk-sub-service": "Market", "x-sdk-method-name": "getETFInfo", "x-sdk-method-description": "This interface returns leveraged token information.", "x-api-rate-limit-weight": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"currency\\\": \\\"BTCUP\\\",\\n \\\"netAsset\\\": \\\"33.846\\\",\\n \\\"targetLeverage\\\": \\\"2-4\\\",\\n \\\"actualLeverage\\\": \\\"2.1648\\\",\\n \\\"issuedSize\\\": \\\"107134.87655291\\\",\\n \\\"basket\\\": \\\"118.324559 XBTUSDTM\\\"\\n }\\n ]\\n}", "x-request-example": "{\\\"currency\\\": \\\"BTCUP\\\"}", "operationId": "002" } }, "/api/v1/mark-price/{symbol}/current": { "get": { "summary": "Get Mark Price Detail", "deprecated": false, "description": "This endpoint returns the current Mark price for specified margin trading pairs.", "tags": [], "parameters": [ { "name": "symbol", "in": "path", "description": "symbol", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "object", "properties": { "symbol": { "type": "string", "description": "symbol" }, "timePoint": { "type": "integer", "description": "Timestamp (milliseconds)", "format": "int64" }, "value": { "type": "number", "description": "Mark price" } }, "required": [ "symbol", "timePoint", "value" ] } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470193", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Public", "x-api-permission": "NULL", "x-api-rate-limit-pool": "Public", "x-sdk-service": "Margin", "x-sdk-sub-service": "Market", "x-sdk-method-name": "getMarkPriceDetail", "x-sdk-method-description": "This endpoint returns the current Mark price for specified margin trading pairs.", "x-api-rate-limit-weight": 2, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbol\\\": \\\"USDT-BTC\\\",\\n \\\"timePoint\\\": 1729676888000,\\n \\\"value\\\": 1.5045E-5\\n }\\n}", "x-request-example": "{\\\"symbol\\\": \\\"USDT-BTC\\\"}", "operationId": "003" } }, "/api/v1/margin/config": { "get": { "summary": "Get Margin Config", "deprecated": false, "description": "Request the configure info of the cross margin via this endpoint.", "tags": [], "parameters": [], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "object", "properties": { "currencyList": { "type": "array", "items": { "type": "string" }, "description": "Available currencies for margin trade" }, "maxLeverage": { "type": "integer", "description": "Max. leverage available" }, "warningDebtRatio": { "type": "string", "description": "The warning debt ratio of the forced liquidation" }, "liqDebtRatio": { "type": "string", "description": "The debt ratio of the forced liquidation" } }, "required": [ "currencyList", "maxLeverage", "warningDebtRatio", "liqDebtRatio" ] } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470190", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Public", "x-api-permission": "NULL", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Market", "x-sdk-method-name": "getMarginConfig", "x-sdk-method-description": "Request the configure info of the cross margin via this endpoint.", "x-api-rate-limit-weight": 25, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"maxLeverage\\\": 5,\\n \\\"warningDebtRatio\\\": \\\"0.95\\\",\\n \\\"liqDebtRatio\\\": \\\"0.97\\\",\\n \\\"currencyList\\\": [\\n \\\"VRA\\\",\\n \\\"APT\\\",\\n \\\"IOTX\\\",\\n \\\"SHIB\\\",\\n \\\"KDA\\\",\\n \\\"BCHSV\\\",\\n \\\"NEAR\\\",\\n \\\"CLV\\\",\\n \\\"AUDIO\\\",\\n \\\"AIOZ\\\",\\n \\\"FLOW\\\",\\n \\\"WLD\\\",\\n \\\"COMP\\\",\\n \\\"MEME\\\",\\n \\\"SLP\\\",\\n \\\"STX\\\",\\n \\\"ZRO\\\",\\n \\\"QI\\\",\\n \\\"PYTH\\\",\\n \\\"RUNE\\\",\\n \\\"DGB\\\",\\n \\\"IOST\\\",\\n \\\"SUI\\\",\\n \\\"BCH\\\",\\n \\\"CAKE\\\",\\n \\\"DOT\\\",\\n \\\"OMG\\\",\\n \\\"POL\\\",\\n \\\"GMT\\\",\\n \\\"1INCH\\\",\\n \\\"RSR\\\",\\n \\\"NKN\\\",\\n \\\"BTC\\\",\\n \\\"AR\\\",\\n \\\"ARB\\\",\\n \\\"TON\\\",\\n \\\"LISTA\\\",\\n \\\"AVAX\\\",\\n \\\"SEI\\\",\\n \\\"FTM\\\",\\n \\\"ERN\\\",\\n \\\"BB\\\",\\n \\\"BTT\\\",\\n \\\"JTO\\\",\\n \\\"ONE\\\",\\n \\\"RLC\\\",\\n \\\"ANKR\\\",\\n \\\"SUSHI\\\",\\n \\\"CATI\\\",\\n \\\"ALGO\\\",\\n \\\"PEPE2\\\",\\n \\\"ATOM\\\",\\n \\\"LPT\\\",\\n \\\"BIGTIME\\\",\\n \\\"CFX\\\",\\n \\\"DYM\\\",\\n \\\"VELO\\\",\\n \\\"XPR\\\",\\n \\\"SNX\\\",\\n \\\"JUP\\\",\\n \\\"MANA\\\",\\n \\\"API3\\\",\\n \\\"PYR\\\",\\n \\\"ROSE\\\",\\n \\\"GLMR\\\",\\n \\\"SATS\\\",\\n \\\"TIA\\\",\\n \\\"GALAX\\\",\\n \\\"SOL\\\",\\n \\\"DAO\\\",\\n \\\"FET\\\",\\n \\\"ETC\\\",\\n \\\"MKR\\\",\\n \\\"WOO\\\",\\n \\\"DODO\\\",\\n \\\"OGN\\\",\\n \\\"BNB\\\",\\n \\\"ICP\\\",\\n \\\"BLUR\\\",\\n \\\"ETH\\\",\\n \\\"ZEC\\\",\\n \\\"NEO\\\",\\n \\\"CELO\\\",\\n \\\"REN\\\",\\n \\\"MANTA\\\",\\n \\\"LRC\\\",\\n \\\"STRK\\\",\\n \\\"ADA\\\",\\n \\\"STORJ\\\",\\n \\\"REQ\\\",\\n \\\"TAO\\\",\\n \\\"VET\\\",\\n \\\"FITFI\\\",\\n \\\"USDT\\\",\\n \\\"DOGE\\\",\\n \\\"HBAR\\\",\\n \\\"SXP\\\",\\n \\\"NEIROCTO\\\",\\n \\\"CHR\\\",\\n \\\"ORDI\\\",\\n \\\"DASH\\\",\\n \\\"PEPE\\\",\\n \\\"ONDO\\\",\\n \\\"ILV\\\",\\n \\\"WAVES\\\",\\n \\\"CHZ\\\",\\n \\\"DOGS\\\",\\n \\\"XRP\\\",\\n \\\"CTSI\\\",\\n \\\"JASMY\\\",\\n \\\"FLOKI\\\",\\n \\\"TRX\\\",\\n \\\"KAVA\\\",\\n \\\"SAND\\\",\\n \\\"C98\\\",\\n \\\"UMA\\\",\\n \\\"NOT\\\",\\n \\\"IMX\\\",\\n \\\"WIF\\\",\\n \\\"ENA\\\",\\n \\\"EGLD\\\",\\n \\\"BOME\\\",\\n \\\"LTC\\\",\\n \\\"USDC\\\",\\n \\\"METIS\\\",\\n \\\"WIN\\\",\\n \\\"THETA\\\",\\n \\\"FXS\\\",\\n \\\"ENJ\\\",\\n \\\"CRO\\\",\\n \\\"AEVO\\\",\\n \\\"INJ\\\",\\n \\\"LTO\\\",\\n \\\"CRV\\\",\\n \\\"GRT\\\",\\n \\\"DYDX\\\",\\n \\\"FLUX\\\",\\n \\\"ENS\\\",\\n \\\"WAX\\\",\\n \\\"MASK\\\",\\n \\\"POND\\\",\\n \\\"UNI\\\",\\n \\\"AAVE\\\",\\n \\\"LINA\\\",\\n \\\"TLM\\\",\\n \\\"BONK\\\",\\n \\\"QNT\\\",\\n \\\"LDO\\\",\\n \\\"ALICE\\\",\\n \\\"XLM\\\",\\n \\\"LINK\\\",\\n \\\"CKB\\\",\\n \\\"LUNC\\\",\\n \\\"YFI\\\",\\n \\\"ETHW\\\",\\n \\\"XTZ\\\",\\n \\\"LUNA\\\",\\n \\\"OP\\\",\\n \\\"SUPER\\\",\\n \\\"EIGEN\\\",\\n \\\"KSM\\\",\\n \\\"ELON\\\",\\n \\\"EOS\\\",\\n \\\"FIL\\\",\\n \\\"ZETA\\\",\\n \\\"SKL\\\",\\n \\\"BAT\\\",\\n \\\"APE\\\",\\n \\\"HMSTR\\\",\\n \\\"YGG\\\",\\n \\\"MOVR\\\",\\n \\\"PEOPLE\\\",\\n \\\"KCS\\\",\\n \\\"AXS\\\",\\n \\\"ARPA\\\",\\n \\\"ZIL\\\"\\n ]\\n }\\n}", "operationId": "004" } }, "/api/v3/mark-price/all-symbols": { "get": { "summary": "Get Mark Price List", "deprecated": false, "description": "This endpoint returns the current Mark price for all margin trading pairs.", "tags": [], "parameters": [], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "array", "items": { "type": "object", "properties": { "symbol": { "type": "string", "description": "symbol" }, "timePoint": { "type": "integer", "description": "Timestamp (milliseconds)", "format": "int64" }, "value": { "type": "number", "description": "Mark price" } }, "required": [ "symbol", "timePoint", "value" ] } } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470192", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Public", "x-api-permission": "NULL", "x-api-rate-limit-pool": "Public", "x-sdk-service": "Margin", "x-sdk-sub-service": "Market", "x-sdk-method-name": "getMarkPriceList", "x-sdk-method-description": "This endpoint returns the current Mark price for all margin trading pairs.", "x-api-rate-limit-weight": 10, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"USDT-BTC\\\",\\n \\\"timePoint\\\": 1729676522000,\\n \\\"value\\\": 1.504E-5\\n },\\n {\\n \\\"symbol\\\": \\\"USDC-BTC\\\",\\n \\\"timePoint\\\": 1729676522000,\\n \\\"value\\\": 1.5049024E-5\\n }\\n ]\\n}", "operationId": "005" } }, "/api/v1/isolated/symbols": { "get": { "summary": "Get Symbols - Isolated Margin", "deprecated": false, "description": "This endpoint allows querying the configuration of isolated margin symbol.", "tags": [], "parameters": [], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "array", "items": { "type": "object", "properties": { "symbol": { "type": "string", "description": "symbol" }, "symbolName": { "type": "string", "description": "Symbol name" }, "baseCurrency": { "type": "string", "description": "Base currency, e.g. BTC." }, "quoteCurrency": { "type": "string", "description": "Quote currency, e.g. USDT." }, "maxLeverage": { "type": "integer", "description": "Max. leverage of this symbol" }, "flDebtRatio": { "type": "string" }, "tradeEnable": { "type": "boolean" }, "autoRenewMaxDebtRatio": { "type": "string" }, "baseBorrowEnable": { "type": "boolean" }, "quoteBorrowEnable": { "type": "boolean" }, "baseTransferInEnable": { "type": "boolean" }, "quoteTransferInEnable": { "type": "boolean" }, "baseBorrowCoefficient": { "type": "string" }, "quoteBorrowCoefficient": { "type": "string" } }, "required": [ "symbol", "symbolName", "baseCurrency", "quoteCurrency", "maxLeverage", "flDebtRatio", "tradeEnable", "autoRenewMaxDebtRatio", "baseBorrowEnable", "quoteBorrowEnable", "baseTransferInEnable", "quoteTransferInEnable", "baseBorrowCoefficient", "quoteBorrowCoefficient" ] } } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470194", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Public", "x-api-permission": "NULL", "x-api-rate-limit-pool": "Public", "x-sdk-service": "Margin", "x-sdk-sub-service": "Market", "x-sdk-method-name": "getIsolatedMarginSymbols", "x-sdk-method-description": "This endpoint allows querying the configuration of isolated margin symbol.", "x-api-rate-limit-weight": 3, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"symbolName\\\": \\\"BTC-USDT\\\",\\n \\\"baseCurrency\\\": \\\"BTC\\\",\\n \\\"quoteCurrency\\\": \\\"USDT\\\",\\n \\\"maxLeverage\\\": 10,\\n \\\"flDebtRatio\\\": \\\"0.97\\\",\\n \\\"tradeEnable\\\": true,\\n \\\"autoRenewMaxDebtRatio\\\": \\\"0.96\\\",\\n \\\"baseBorrowEnable\\\": true,\\n \\\"quoteBorrowEnable\\\": true,\\n \\\"baseTransferInEnable\\\": true,\\n \\\"quoteTransferInEnable\\\": true,\\n \\\"baseBorrowCoefficient\\\": \\\"1\\\",\\n \\\"quoteBorrowCoefficient\\\": \\\"1\\\"\\n }\\n ]\\n}", "operationId": "006" } }, "/api/v3/hf/margin/order": { "post": { "summary": "Add Order", "deprecated": false, "description": "Place order in the Cross-margin or Isolated-margin trading system. You can place two major types of order: Limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", "tags": [], "parameters": [], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "object", "properties": { "orderId": { "type": "string", "description": "The unique order ID generated by the trading system, which can be used later for further actions such as canceling the order." }, "loanApplyId": { "type": "string", "description": "Borrow order ID. The field is returned only after placing the order under the mode of Auto-Borrow." }, "borrowSize": { "type": "string", "description": "Borrowed amount. The field is returned only after placing the order under the mode of Auto-Borrow." }, "clientOid": { "type": "string", "description": "The user self-defined order ID." } }, "required": [ "orderId", "borrowSize", "clientOid", "loanApplyId" ] } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470204", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "Margin", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Order", "x-sdk-method-name": "addOrder", "x-sdk-method-description": "Place order in the Cross-margin or Isolated-margin trading system. You can place two major types of order: Limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", "x-api-rate-limit-weight": 2, "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "clientOid": { "type": "string", "description": "Client Order ID: The ClientOid field is a unique ID created by the user (we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", "example": [ "5c52e11203aa677f33e493fb" ] }, "side": { "type": "string", "description": "Specify if the order is to 'buy' or 'sell'.", "enum": [ "buy", "sell" ], "x-api-enum": [ { "value": "buy", "name": "", "description": "" }, { "value": "sell", "name": "", "description": "" } ], "example": [ "buy" ] }, "symbol": { "type": "string", "description": "symbol", "example": [ "BTC-USDT", "ETH-USDT", "KCS-USDT" ] }, "type": { "type": "string", "description": "Specify if the order is a 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price; you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", "enum": [ "limit", "market" ], "default": "limit", "x-api-enum": [ { "value": "limit", "name": "", "description": "" }, { "value": "market", "name": "", "description": "" } ] }, "stp": { "type": "string", "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC", "enum": [ "DC", "CO", "CN", "CB" ], "x-api-enum": [ { "value": "DC", "name": "", "description": "" }, { "value": "CO", "name": "", "description": "" }, { "value": "CN", "name": "", "description": "" }, { "value": "CB", "name": "", "description": "" } ] }, "price": { "type": "string", "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." }, "size": { "type": "string", "description": "Specify quantity for order.\n\nWhen **type** is limited, size refers to the amount of trading targets (the asset name written in front) for the trading pair. The Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" }, "timeInForce": { "type": "string", "description": "[Time in force](https://www.kucoin.com/docs-new/api-5176570) is a special strategy used during trading", "enum": [ "GTC", "GTT", "IOC", "FOK" ], "default": "GTC", "x-api-enum": [ { "value": "GTC", "name": "", "description": "" }, { "value": "GTT", "name": "", "description": "" }, { "value": "IOC", "name": "", "description": "" }, { "value": "FOK", "name": "", "description": "" } ] }, "postOnly": { "type": "boolean", "default": false, "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" }, "hidden": { "type": "boolean", "description": "[Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book)", "default": false }, "iceberg": { "type": "boolean", "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146)", "default": false }, "visibleSize": { "type": "string", "description": "Maximum visible quantity in iceberg orders" }, "cancelAfter": { "type": "integer", "format": "int64", "description": "Cancel after n seconds, the order timing strategy is GTT" }, "funds": { "type": "string", "description": "When **type** is market, select one out of two: size or funds" }, "isIsolated": { "type": "boolean", "description": "True - isolated margin; false - cross margin. Default is false", "default": false }, "autoBorrow": { "type": "boolean", "description": "When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate.", "default": false }, "autoRepay": { "type": "boolean", "description": "AutoPay allows the return of borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount.", "default": false } }, "required": [ "symbol", "side", "clientOid" ] }, "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n" } } }, "x-response-example": "{\\n \\\"success\\\": true,\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671663e02188630007e21c9c\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e1493fb\\\",\\n \\\"borrowSize\\\": \\\"10.2\\\",\\n \\\"loanApplyId\\\": \\\"600656d9a33ac90009de4f6f\\\"\\n }\\n}", "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}", "operationId": "007" } }, "/api/v3/hf/margin/order/test": { "post": { "summary": "Add Order Test", "deprecated": false, "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.", "tags": [], "parameters": [], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "object", "properties": { "orderId": { "type": "string", "description": "The unique order ID generated by the trading system, which can be used later for further actions such as canceling the order." }, "loanApplyId": { "type": "string", "description": "Borrowed amount. The field is returned only after placing the order under the mode of Auto-Borrow." }, "borrowSize": { "type": "number", "description": "ID of the borrowing response. The field is returned only after placing the order under the mode of Auto-Borrow." }, "clientOid": { "type": "string", "description": "The user self-defined order ID." } }, "required": [ "orderId", "borrowSize", "clientOid", "loanApplyId" ] } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470205", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "Margin", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Order", "x-sdk-method-name": "addOrderTest", "x-sdk-method-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.", "x-api-rate-limit-weight": 2, "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "clientOid": { "type": "string", "description": "Client Order ID: The ClientOid field is a unique ID created by the user (we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", "example": [ "5c52e11203aa677f33e493fb" ] }, "side": { "type": "string", "description": "Specify if the order is to 'buy' or 'sell'.", "enum": [ "buy", "sell" ], "x-api-enum": [ { "value": "buy", "name": "", "description": "" }, { "value": "sell", "name": "", "description": "" } ], "example": [ "buy" ] }, "symbol": { "type": "string", "description": "symbol", "example": [ "BTC-USDT", "ETH-USDT", "KCS-USDT" ] }, "type": { "type": "string", "description": "Specify if the order is a 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price; you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", "enum": [ "limit", "market" ], "default": "limit", "x-api-enum": [ { "value": "limit", "name": "", "description": "" }, { "value": "market", "name": "", "description": "" } ] }, "stp": { "type": "string", "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC", "enum": [ "DC", "CO", "CN", "CB" ], "x-api-enum": [ { "value": "DC", "name": "", "description": "" }, { "value": "CO", "name": "", "description": "" }, { "value": "CN", "name": "", "description": "" }, { "value": "CB", "name": "", "description": "" } ] }, "price": { "type": "string", "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." }, "size": { "type": "string", "description": "Specify quantity for order.\n\nWhen **type** is limited, size refers to the amount of trading targets (the asset name written in front) for the trading pair. The Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" }, "timeInForce": { "type": "string", "description": "[Time in force](https://www.kucoin.com/docs-new/api-5176570) is a special strategy used during trading", "enum": [ "GTC", "GTT", "IOC", "FOK" ], "default": "GTC", "x-api-enum": [ { "value": "GTC", "name": "", "description": "" }, { "value": "GTT", "name": "", "description": "" }, { "value": "IOC", "name": "", "description": "" }, { "value": "FOK", "name": "", "description": "" } ] }, "postOnly": { "type": "boolean", "default": false, "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" }, "hidden": { "type": "boolean", "description": "[Hidden order](https://www.kucoin.com/docs-new/doc-338146) or not (not shown in order book)", "default": false }, "iceberg": { "type": "boolean", "description": "Whether or not only visible portions of orders are shown in [Iceberg orders](https://www.kucoin.com/docs-new/doc-338146)", "default": false }, "visibleSize": { "type": "string", "description": "Maximum visible quantity in iceberg orders" }, "cancelAfter": { "type": "integer", "format": "int64", "description": "Cancel after n seconds, the order timing strategy is GTT" }, "funds": { "type": "string", "description": "When **type** is market, select one out of two: size or funds" }, "isIsolated": { "type": "boolean", "description": "True - isolated margin; false - cross margin. Default is false", "default": false }, "autoBorrow": { "type": "boolean", "description": "When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate.", "default": false }, "autoRepay": { "type": "boolean", "description": "AutoPay allows the return of borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount.", "default": false } }, "required": [ "symbol", "side", "clientOid" ] }, "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e493fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n" } } }, "x-response-example": "{\\n \\\"success\\\": true,\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"5bd6e9286d99522a52e458de\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"borrowSize\\\": 10.2,\\n \\\"loanApplyId\\\": \\\"600656d9a33ac90009de4f6f\\\"\\n }\\n}", "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\", \\\"remark\\\": \\\"order remarks\\\"}", "operationId": "008" } }, "/api/v3/hf/margin/orders/{orderId}": { "delete": { "summary": "Cancel Order By OrderId", "deprecated": false, "description": "This endpoint can be used to cancel a margin order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to Websocket.", "tags": [], "parameters": [ { "name": "symbol", "in": "query", "description": "symbol", "required": true, "schema": { "type": "string", "example": [ "BTC-USDT", "ETH-USDT", "KCS-USDT" ] } }, { "name": "orderId", "in": "path", "description": "The unique order id generated by the trading system", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "object", "properties": { "orderId": { "type": "string", "description": "Order id" } }, "required": [ "orderId" ] } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470195", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "Margin", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Order", "x-sdk-method-name": "cancelOrderByOrderId", "x-sdk-method-description": "This endpoint can be used to cancel a margin order by orderId. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to Websocket.", "x-api-rate-limit-weight": 2, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderId\\\":\\\"671663e02188630007e21c9c\\\"}}", "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"671663e02188630007e21c9c\\\"}", "operationId": "009" }, "get": { "summary": "Get Order By OrderId", "deprecated": false, "description": "This endpoint can be used to obtain information for a single Margin order using the order ID. After the user successfully places an order, the order is in the Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "tags": [], "parameters": [ { "name": "symbol", "in": "query", "description": "symbol", "required": true, "schema": { "type": "string", "example": [ "BTC-USDT", "ETH-USDT", "KCS-USDT" ] } }, { "name": "orderId", "in": "path", "description": "The unique order id generated by the trading system", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "object", "properties": { "id": { "type": "string", "description": "The unique order id generated by the trading system" }, "symbol": { "type": "string", "description": "symbol", "example": [ "BTC-USDT", "ETH-USDT", "KCS-USDT" ] }, "opType": { "type": "string" }, "type": { "type": "string", "description": "Specify if the order is a 'limit' order or 'market' order. ", "enum": [ "limit", "market" ], "x-api-enum": [ { "value": "limit", "name": "", "description": "" }, { "value": "market", "name": "", "description": "" } ] }, "side": { "type": "string", "description": "Buy or sell", "enum": [ "buy", "sell" ], "x-api-enum": [ { "value": "buy", "name": "", "description": "" }, { "value": "sell", "name": "", "description": "" } ] }, "price": { "type": "string", "description": "Order Price" }, "size": { "type": "string", "description": "Order Size" }, "funds": { "type": "string", "description": "Order Funds" }, "dealSize": { "type": "string", "description": "Number of filled transactions" }, "dealFunds": { "type": "string", "description": "Funds of filled transactions" }, "fee": { "type": "string", "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" }, "feeCurrency": { "type": "string", "description": "Currency used to calculate trading fee" }, "stp": { "type": "string", "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC", "enum": [ "DC", "CO", "CN", "CB" ], "x-api-enum": [ { "value": "DC", "name": "", "description": "" }, { "value": "CO", "name": "", "description": "" }, { "value": "CN", "name": "", "description": "" }, { "value": "CB", "name": "", "description": "" } ] }, "stop": { "type": "string" }, "stopTriggered": { "type": "boolean" }, "stopPrice": { "type": "string" }, "timeInForce": { "type": "string", "description": "Time in force", "enum": [ "GTC", "GTT", "IOC", "FOK" ], "x-api-enum": [ { "value": "GTC", "name": "", "description": "" }, { "value": "GTT", "name": "", "description": "" }, { "value": "IOC", "name": "", "description": "" }, { "value": "FOK", "name": "", "description": "" } ] }, "postOnly": { "type": "boolean", "description": "Whether it’s a postOnly order." }, "hidden": { "type": "boolean", "description": "Whether it’s a hidden order." }, "iceberg": { "type": "boolean", "description": "Whether it’s a iceberg order." }, "visibleSize": { "type": "string", "description": "Visible size of iceberg order in order book." }, "cancelAfter": { "type": "integer", "description": "A GTT timeInForce that expires in n seconds" }, "channel": { "type": "string" }, "clientOid": { "type": "string", "description": "Client Order Id, unique identifier created by the user" }, "remark": { "type": "string", "description": "Order placement remarks" }, "tags": { "type": "string", "description": "Order tag" }, "cancelExist": { "type": "boolean", "description": "Whether there is a cancellation record for the order." }, "createdAt": { "type": "integer", "format": "int64" }, "lastUpdatedAt": { "type": "integer", "format": "int64" }, "tradeType": { "type": "string", "description": "Trade type, redundancy param" }, "inOrderBook": { "type": "boolean", "description": "Whether to enter the orderbook: True: enter the orderbook; False: do not enter the orderbook" }, "cancelledSize": { "type": "string", "description": "Number of canceled transactions" }, "cancelledFunds": { "type": "string", "description": "Funds of canceled transactions" }, "remainSize": { "type": "string", "description": "Number of remain transactions" }, "remainFunds": { "type": "string", "description": "Funds of remain transactions" }, "tax": { "type": "string", "description": "Users in some regions have this field" }, "active": { "type": "boolean", "description": "Order status: true-The status of the order is active; false-The status of the order is done" } }, "required": [ "id", "symbol", "opType", "type", "side", "price", "size", "funds", "dealSize", "dealFunds", "fee", "feeCurrency", "stopTriggered", "stopPrice", "timeInForce", "postOnly", "hidden", "iceberg", "visibleSize", "cancelAfter", "channel", "clientOid", "remark", "cancelExist", "createdAt", "lastUpdatedAt", "tradeType", "inOrderBook", "cancelledSize", "cancelledFunds", "remainSize", "remainFunds", "tax", "active" ] } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470202", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "General", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Order", "x-sdk-method-name": "getOrderByOrderId", "x-sdk-method-description": "This endpoint can be used to obtain information for a single Margin order using the order ID. After the user successfully places an order, the order is in the Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "x-api-rate-limit-weight": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"671667306afcdb000723107f\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"stop\\\": null,\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729521456248,\\n \\\"lastUpdatedAt\\\": 1729651011877,\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"inOrderBook\\\": true,\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0.00001\\\",\\n \\\"remainFunds\\\": \\\"0.5\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"active\\\": true\\n }\\n}", "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderId\\\": \\\"671667306afcdb000723107f\\\"}", "operationId": "016" } }, "/api/v3/hf/margin/orders/client-order/{clientOid}": { "delete": { "summary": "Cancel Order By ClientOid", "deprecated": false, "description": "This endpoint can be used to cancel a margin order by clientOid. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to Websocket.", "tags": [], "parameters": [ { "name": "symbol", "in": "query", "description": "symbol", "required": true, "schema": { "type": "string", "example": [ "BTC-USDT", "ETH-USDT", "KCS-USDT" ] } }, { "name": "clientOid", "in": "path", "description": "Client Order Id, unique identifier created by the user", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "object", "properties": { "clientOid": { "type": "string", "description": "Client Order Id, unique identifier created by the user" } }, "required": [ "clientOid" ] } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470201", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "Margin", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Order", "x-sdk-method-name": "cancelOrderByClientOid", "x-sdk-method-description": "This endpoint can be used to cancel a margin order by clientOid. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to Websocket.", "x-api-rate-limit-weight": 2, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"clientOid\\\":\\\"5c52e11203aa677f33e1493fb\\\"}}", "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e1493fb\\\"}", "operationId": "010" }, "get": { "summary": "Get Order By ClientOid", "deprecated": false, "description": "This endpoint can be used to obtain information for a single Margin order using the client order ID. After the user successfully places an order, the order is in the Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "tags": [], "parameters": [ { "name": "symbol", "in": "query", "description": "symbol", "required": true, "schema": { "type": "string", "example": [ "BTC-USDT", "ETH-USDT", "KCS-USDT" ] } }, { "name": "clientOid", "in": "path", "description": "Client Order Id, unique identifier created by the user", "required": true, "schema": { "type": "string" } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "object", "properties": { "id": { "type": "string", "description": "The unique order id generated by the trading system" }, "symbol": { "type": "string", "description": "symbol", "example": [ "BTC-USDT", "ETH-USDT", "KCS-USDT" ] }, "opType": { "type": "string" }, "type": { "type": "string", "description": "Specify if the order is a 'limit' order or 'market' order. ", "enum": [ "limit", "market" ], "x-api-enum": [ { "value": "limit", "name": "", "description": "" }, { "value": "market", "name": "", "description": "" } ] }, "side": { "type": "string", "description": "Buy or sell", "enum": [ "buy", "sell" ], "x-api-enum": [ { "value": "buy", "name": "", "description": "" }, { "value": "sell", "name": "", "description": "" } ] }, "price": { "type": "string", "description": "Order Price" }, "size": { "type": "string", "description": "Order Size" }, "funds": { "type": "string", "description": "Order Funds" }, "dealSize": { "type": "string", "description": "Number of filled transactions" }, "dealFunds": { "type": "string", "description": "Funds of filled transactions" }, "fee": { "type": "string", "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" }, "feeCurrency": { "type": "string", "description": "Currency used to calculate trading fee" }, "stp": { "type": "string", "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC", "enum": [ "DC", "CO", "CN", "CB" ], "x-api-enum": [ { "value": "DC", "name": "", "description": "" }, { "value": "CO", "name": "", "description": "" }, { "value": "CN", "name": "", "description": "" }, { "value": "CB", "name": "", "description": "" } ] }, "stop": { "type": "string" }, "stopTriggered": { "type": "boolean" }, "stopPrice": { "type": "string" }, "timeInForce": { "type": "string", "description": "Time in force", "enum": [ "GTC", "GTT", "IOC", "FOK" ], "x-api-enum": [ { "value": "GTC", "name": "", "description": "" }, { "value": "GTT", "name": "", "description": "" }, { "value": "IOC", "name": "", "description": "" }, { "value": "FOK", "name": "", "description": "" } ] }, "postOnly": { "type": "boolean", "description": "Whether it’s a postOnly order." }, "hidden": { "type": "boolean", "description": "Whether it’s a hidden order." }, "iceberg": { "type": "boolean", "description": "Whether it’s a iceberg order." }, "visibleSize": { "type": "string", "description": "Visible size of iceberg order in order book." }, "cancelAfter": { "type": "integer", "description": "A GTT timeInForce that expires in n seconds" }, "channel": { "type": "string" }, "clientOid": { "type": "string", "description": "Client Order Id, unique identifier created by the user" }, "remark": { "type": "string", "description": "Order placement remarks" }, "tags": { "type": "string", "description": "Order tag" }, "cancelExist": { "type": "boolean", "description": "Whether there is a cancellation record for the order." }, "createdAt": { "type": "integer", "format": "int64" }, "lastUpdatedAt": { "type": "integer", "format": "int64" }, "tradeType": { "type": "string", "description": "Trade type, redundancy param" }, "inOrderBook": { "type": "boolean", "description": "Whether to enter the orderbook: True: enter the orderbook; False: do not enter the orderbook" }, "cancelledSize": { "type": "string", "description": "Number of canceled transactions" }, "cancelledFunds": { "type": "string", "description": "Funds of canceled transactions" }, "remainSize": { "type": "string", "description": "Number of remain transactions" }, "remainFunds": { "type": "string", "description": "Funds of remain transactions" }, "tax": { "type": "string", "description": "Users in some regions have this field" }, "active": { "type": "boolean", "description": "Order status: true-The status of the order is active; false-The status of the order is done" } }, "required": [ "id", "symbol", "opType", "type", "side", "price", "size", "funds", "dealSize", "dealFunds", "fee", "feeCurrency", "stopTriggered", "stopPrice", "timeInForce", "postOnly", "hidden", "iceberg", "visibleSize", "cancelAfter", "channel", "clientOid", "cancelExist", "createdAt", "lastUpdatedAt", "tradeType", "inOrderBook", "cancelledSize", "cancelledFunds", "remainSize", "remainFunds", "tax", "active" ] } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470203", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "General", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Order", "x-sdk-method-name": "getOrderByClientOid", "x-sdk-method-description": "This endpoint can be used to obtain information for a single Margin order using the client order ID. After the user successfully places an order, the order is in the Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "x-api-rate-limit-weight": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"id\\\": \\\"671667306afcdb000723107f\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"stop\\\": null,\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"createdAt\\\": 1729521456248,\\n \\\"lastUpdatedAt\\\": 1729651011877,\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"inOrderBook\\\": true,\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0.00001\\\",\\n \\\"remainFunds\\\": \\\"0.5\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"active\\\": true\\n }\\n}", "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\"}", "operationId": "017" } }, "/api/v3/hf/margin/orders": { "delete": { "summary": "Cancel All Orders By Symbol", "deprecated": false, "description": "This interface can cancel all open Margin orders by symbol. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to Websocket.", "tags": [], "parameters": [ { "name": "symbol", "in": "query", "description": "symbol", "required": true, "schema": { "type": "string", "example": [ "BTC-USDT", "ETH-USDT", "KCS-USDT" ] } }, { "name": "tradeType", "in": "query", "description": "Transaction type: MARGIN_TRADE - cross margin trade, MARGIN_ISOLATED_TRADE - isolated margin trade", "required": true, "schema": { "type": "string", "enum": [ "MARGIN_TRADE", "MARGIN_ISOLATED_TRADE" ], "x-api-enum": [ { "value": "MARGIN_TRADE", "name": "", "description": "" }, { "value": "MARGIN_ISOLATED_TRADE", "name": "", "description": "" } ] } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "string" } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470197", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "Margin", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Order", "x-sdk-method-name": "cancelAllOrdersBySymbol", "x-sdk-method-description": "This interface can cancel all open Margin orders by symbol. This endpoint only sends cancellation requests. The results of the requests must be obtained by checking the order status or subscribing to Websocket.", "x-api-rate-limit-weight": 5, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":\\\"success\\\"}", "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\"}", "operationId": "011" } }, "/api/v3/hf/margin/order/active/symbols": { "get": { "summary": "Get Symbols With Open Order", "deprecated": false, "description": "This interface can query all Margin symbols that have active orders.", "tags": [], "parameters": [ { "name": "tradeType", "in": "query", "description": "Cross Margin: MARGIN_TRADE, Isolated Margin: MARGIN_ISOLATED_TRADE\n", "required": true, "schema": { "type": "string", "enum": [ "MARGIN_TRADE", "MARGIN_ISOLATED_TRADE" ], "x-api-enum": [ { "value": "MARGIN_TRADE", "name": "", "description": "" }, { "value": "MARGIN_ISOLATED_TRADE", "name": "", "description": "" } ] } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "object", "properties": { "symbolSize": { "type": "integer", "description": "Symbol Size" }, "symbols": { "type": "array", "items": { "type": "string" }, "description": "The symbol that has active orders" } }, "required": [ "symbolSize", "symbols" ] } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470196", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "Margin", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Order", "x-sdk-method-name": "getSymbolsWithOpenOrder", "x-sdk-method-description": "This interface can query all Margin symbols that have active orders.", "x-api-rate-limit-weight": 4, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"symbolSize\\\": 1,\\n \\\"symbols\\\": [\\n \\\"BTC-USDT\\\"\\n ]\\n }\\n}", "x-request-example": "{\\\"tradeType\\\": \\\"MARGIN_TRADE\\\"}", "operationId": "012" } }, "/api/v3/hf/margin/orders/active": { "get": { "summary": "Get Open Orders", "deprecated": false, "description": "This interface is to obtain all Margin active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in the Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "tags": [], "parameters": [ { "name": "symbol", "in": "query", "description": "symbol", "required": true, "schema": { "type": "string", "example": [ "BTC-USDT", "ETH-USDT", "KCS-USDT" ] } }, { "name": "tradeType", "in": "query", "description": "Order type: MARGIN_TRADE - cross margin trading order, MARGIN_ISOLATED_TRADE - isolated margin trading order", "required": true, "schema": { "type": "string", "enum": [ "MARGIN_TRADE", "MARGIN_ISOLATED_TRADE" ], "x-api-enum": [ { "value": "MARGIN_TRADE", "name": "", "description": "" }, { "value": "MARGIN_ISOLATED_TRADE", "name": "", "description": "" } ] } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "The unique order id generated by the trading system" }, "symbol": { "type": "string", "description": "symbol", "example": [ "BTC-USDT", "ETH-USDT", "KCS-USDT" ] }, "opType": { "type": "string" }, "type": { "type": "string", "description": "Specify if the order is a 'limit' order or 'market' order. ", "enum": [ "limit", "market" ], "x-api-enum": [ { "value": "limit", "name": "", "description": "" }, { "value": "market", "name": "", "description": "" } ] }, "side": { "type": "string", "description": "Buy or sell", "enum": [ "buy", "sell" ], "x-api-enum": [ { "value": "buy", "name": "", "description": "" }, { "value": "sell", "name": "", "description": "" } ] }, "price": { "type": "string", "description": "Order Price" }, "size": { "type": "string", "description": "Order Size" }, "funds": { "type": "string", "description": "Order Funds" }, "dealSize": { "type": "string", "description": "Number of filled transactions" }, "dealFunds": { "type": "string", "description": "Funds of filled transactions" }, "fee": { "type": "string", "description": "Trading fee" }, "feeCurrency": { "type": "string", "description": "Currency used to calculate trading fee" }, "stp": { "type": "string", "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC", "enum": [ "DC", "CO", "CN", "CB" ], "x-api-enum": [ { "value": "DC", "name": "", "description": "" }, { "value": "CO", "name": "", "description": "" }, { "value": "CN", "name": "", "description": "" }, { "value": "CB", "name": "", "description": "" } ] }, "stop": { "type": "string" }, "stopTriggered": { "type": "boolean" }, "stopPrice": { "type": "string" }, "timeInForce": { "type": "string", "description": "Time in force", "enum": [ "GTC", "GTT", "IOC", "FOK" ], "x-api-enum": [ { "value": "GTC", "name": "", "description": "" }, { "value": "GTT", "name": "", "description": "" }, { "value": "IOC", "name": "", "description": "" }, { "value": "FOK", "name": "", "description": "" } ] }, "postOnly": { "type": "boolean", "description": "Whether it’s a postOnly order." }, "hidden": { "type": "boolean", "description": "Whether it’s a hidden order." }, "iceberg": { "type": "boolean", "description": "Whether it’s a iceberg order." }, "visibleSize": { "type": "string", "description": "Visible size of iceberg order in order book." }, "cancelAfter": { "type": "integer", "description": "A GTT timeInForce that expires in n seconds" }, "channel": { "type": "string" }, "clientOid": { "type": "string", "description": "Client Order Id, unique identifier created by the user" }, "remark": { "type": "string", "description": "Order placement remarks" }, "tags": { "type": "string", "description": "Order tag" }, "cancelExist": { "type": "boolean", "description": "Whether there is a cancellation record for the order." }, "createdAt": { "type": "integer", "format": "int64" }, "lastUpdatedAt": { "type": "integer", "format": "int64" }, "tradeType": { "type": "string", "description": "Trade type, redundancy param" }, "inOrderBook": { "type": "boolean", "description": "Whether to enter the orderbook: True: enter the orderbook; False: do not enter the orderbook" }, "cancelledSize": { "type": "string", "description": "Number of canceled transactions" }, "cancelledFunds": { "type": "string", "description": "Funds of canceled transactions" }, "remainSize": { "type": "string", "description": "Number of remain transactions" }, "remainFunds": { "type": "string", "description": "Funds of remain transactions" }, "tax": { "type": "string", "description": "Users in some regions have this field" }, "active": { "type": "boolean", "description": "Order status: true-The status of the order is active; false-The status of the order is done" } }, "required": [ "stopPrice", "id", "symbol", "opType", "type", "side", "price", "size", "funds", "dealSize", "dealFunds", "fee", "feeCurrency", "stopTriggered", "timeInForce", "postOnly", "hidden", "iceberg", "visibleSize", "cancelAfter", "channel", "clientOid", "cancelExist", "tradeType", "inOrderBook", "cancelledSize", "cancelledFunds", "remainSize", "remainFunds", "active", "createdAt", "lastUpdatedAt", "tax" ] } } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470198", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "General", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Order", "x-sdk-method-name": "getOpenOrders", "x-sdk-method-description": "This interface is to obtain all Margin active order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in the Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "x-api-rate-limit-weight": 4, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"id\\\": \\\"671667306afcdb000723107f\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0.00001\\\",\\n \\\"remainFunds\\\": \\\"0.5\\\",\\n \\\"cancelledSize\\\": \\\"0\\\",\\n \\\"cancelledFunds\\\": \\\"0\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"stop\\\": null,\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": false,\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"inOrderBook\\\": true,\\n \\\"active\\\": true,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729521456248,\\n \\\"lastUpdatedAt\\\": 1729521460940\\n }\\n ]\\n}", "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\"}", "operationId": "013" } }, "/api/v3/hf/margin/orders/done": { "get": { "summary": "Get Closed Orders", "deprecated": false, "description": "This interface is to obtain all Margin closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in the Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "tags": [], "parameters": [ { "name": "symbol", "in": "query", "description": "symbol", "required": true, "schema": { "type": "string", "example": [ "BTC-USDT", "ETH-USDT", "KCS-USDT" ] } }, { "name": "tradeType", "in": "query", "description": "Transaction type: MARGIN_TRADE - cross margin trade, MARGIN_ISOLATED_TRADE - isolated margin trade", "required": true, "schema": { "type": "string", "enum": [ "MARGIN_TRADE", "MARGIN_ISOLATED_TRADE" ], "x-api-enum": [ { "value": "MARGIN_TRADE", "name": "", "description": "" }, { "value": "MARGIN_ISOLATED_TRADE", "name": "", "description": "" } ] } }, { "name": "side", "in": "query", "description": "Specify if the order is to 'buy' or 'sell'.", "required": false, "schema": { "type": "string", "enum": [ "buy", "sell" ], "x-api-enum": [ { "value": "buy", "name": "", "description": "" }, { "value": "sell", "name": "", "description": "" } ] } }, { "name": "type", "in": "query", "description": "Specify if the order is a 'limit' order or 'market' order. ", "required": false, "schema": { "type": "string", "enum": [ "limit", "market" ], "x-api-enum": [ { "value": "limit", "name": "", "description": "" }, { "value": "market", "name": "", "description": "" } ] } }, { "name": "lastId", "in": "query", "description": "The ID of the last set of data from the previous data batch. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId, which can be used as a query parameter to look up new data from the next page.", "required": false, "schema": { "type": "integer", "format": "int64" } }, { "name": "limit", "in": "query", "description": "Default20, Max100", "required": false, "schema": { "type": "integer", "default": 20, "minimum": 1, "maximum": 100 } }, { "name": "startAt", "in": "query", "description": "Start time (milliseconds)", "required": false, "schema": { "type": "integer", "format": "int64" } }, { "name": "endAt", "in": "query", "description": "End time (milliseconds)", "required": false, "schema": { "type": "integer", "format": "int64" } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "object", "properties": { "lastId": { "type": "integer", "description": "The ID of the last set of data from the previous data batch. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId, which can be used as a query parameter to look up new data from the next page.", "format": "int64" }, "items": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "string", "description": "The unique order id generated by the trading system" }, "symbol": { "type": "string", "description": "symbol", "example": [ "BTC-USDT", "ETH-USDT", "KCS-USDT" ] }, "opType": { "type": "string" }, "type": { "type": "string", "description": "Specify if the order is a 'limit' order or 'market' order. ", "enum": [ "limit", "market" ], "x-api-enum": [ { "value": "limit", "name": "", "description": "" }, { "value": "market", "name": "", "description": "" } ] }, "side": { "type": "string", "description": "Buy or sell" }, "price": { "type": "string", "description": "Order Price" }, "size": { "type": "string", "description": "Order Size" }, "funds": { "type": "string", "description": "Order Funds" }, "dealSize": { "type": "string", "description": "Number of filled transactions" }, "dealFunds": { "type": "string", "description": "Funds of filled transactions" }, "fee": { "type": "string", "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" }, "feeCurrency": { "type": "string", "description": "Currency used to calculate trading fee" }, "stp": { "type": "string", "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into these strategies: CN, CO, CB , and DC", "enum": [ "DC", "CO", "CN", "CB" ], "x-api-enum": [ { "value": "DC", "name": "", "description": "" }, { "value": "CO", "name": "", "description": "" }, { "value": "CN", "name": "", "description": "" }, { "value": "CB", "name": "", "description": "" } ] }, "stop": { "type": "string" }, "stopTriggered": { "type": "boolean" }, "stopPrice": { "type": "string" }, "timeInForce": { "type": "string", "description": "Time in force", "enum": [ "GTC", "GTT", "IOC", "FOK" ], "x-api-enum": [ { "value": "GTC", "name": "", "description": "" }, { "value": "GTT", "name": "", "description": "" }, { "value": "IOC", "name": "", "description": "" }, { "value": "FOK", "name": "", "description": "" } ] }, "postOnly": { "type": "boolean", "description": "Whether it’s a postOnly order." }, "hidden": { "type": "boolean", "description": "Whether it’s a hidden order." }, "iceberg": { "type": "boolean", "description": "Whether it’s a iceberg order." }, "visibleSize": { "type": "string", "description": "Visible size of iceberg order in order book." }, "cancelAfter": { "type": "integer", "description": "A GTT timeInForce that expires in n seconds" }, "channel": { "type": "string" }, "clientOid": { "type": "string", "description": "Client Order Id, unique identifier created by the user" }, "remark": { "type": "string", "description": "Order placement remarks" }, "tags": { "type": "string", "description": "Order tag" }, "cancelExist": { "type": "boolean", "description": "Whether there is a cancellation record for the order." }, "createdAt": { "type": "integer", "format": "int64" }, "lastUpdatedAt": { "type": "integer", "format": "int64" }, "tradeType": { "type": "string", "description": "Trade type, redundancy param" }, "inOrderBook": { "type": "boolean", "description": "Whether to enter the orderbook: True: enter the orderbook; False: do not enter the orderbook" }, "cancelledSize": { "type": "string", "description": "Number of canceled transactions" }, "cancelledFunds": { "type": "string", "description": "Funds of canceled transactions" }, "remainSize": { "type": "string", "description": "Number of remain transactions" }, "remainFunds": { "type": "string", "description": "Funds of remain transactions" }, "tax": { "type": "string", "description": "Users in some regions have this field" }, "active": { "type": "boolean", "description": "Order status: true-The status of the order is active; false-The status of the order is done" } }, "required": [ "id", "symbol", "opType", "type", "side", "price", "size", "funds", "dealSize", "dealFunds", "fee", "feeCurrency", "stopTriggered", "stopPrice", "timeInForce", "postOnly", "hidden", "iceberg", "visibleSize", "cancelAfter", "channel", "clientOid", "cancelExist", "createdAt", "lastUpdatedAt", "tradeType", "inOrderBook", "cancelledSize", "cancelledFunds", "remainSize", "remainFunds", "tax", "active" ] } } }, "required": [ "lastId", "items" ] } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470199", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "General", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Order", "x-sdk-method-name": "getClosedOrders", "x-sdk-method-description": "This interface is to obtain all Margin closed order lists, and the return value of the active order interface is the paged data of all uncompleted order lists. The returned data is sorted in descending order according to the latest update time of the order. After the user successfully places an order, the order is in the Active state, and the user can use inOrderBook to determine whether the order has entered the order. Canceled or fully filled orders are marked as completed Done status.", "x-api-rate-limit-weight": 10, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"lastId\\\": 136112949351,\\n \\\"items\\\": [\\n {\\n \\\"id\\\": \\\"6716491f6afcdb00078365c8\\\",\\n \\\"clientOid\\\": \\\"5c52e11203aa677f33e493fb\\\",\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"opType\\\": \\\"DEAL\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"price\\\": \\\"50000\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.5\\\",\\n \\\"dealSize\\\": \\\"0\\\",\\n \\\"dealFunds\\\": \\\"0\\\",\\n \\\"remainSize\\\": \\\"0\\\",\\n \\\"remainFunds\\\": \\\"0\\\",\\n \\\"cancelledSize\\\": \\\"0.00001\\\",\\n \\\"cancelledFunds\\\": \\\"0.5\\\",\\n \\\"fee\\\": \\\"0\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stp\\\": null,\\n \\\"stop\\\": null,\\n \\\"stopTriggered\\\": false,\\n \\\"stopPrice\\\": \\\"0\\\",\\n \\\"timeInForce\\\": \\\"GTC\\\",\\n \\\"postOnly\\\": false,\\n \\\"hidden\\\": false,\\n \\\"iceberg\\\": false,\\n \\\"visibleSize\\\": \\\"0\\\",\\n \\\"cancelAfter\\\": 0,\\n \\\"channel\\\": \\\"API\\\",\\n \\\"remark\\\": null,\\n \\\"tags\\\": null,\\n \\\"cancelExist\\\": true,\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"inOrderBook\\\": false,\\n \\\"active\\\": false,\\n \\\"tax\\\": \\\"0\\\",\\n \\\"createdAt\\\": 1729513759162,\\n \\\"lastUpdatedAt\\\": 1729521126597\\n }\\n ]\\n }\\n}", "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 20, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}", "operationId": "014" } }, "/api/v3/hf/margin/fills": { "get": { "summary": "Get Trade History", "deprecated": false, "description": "This endpoint can be used to obtain a list of the latest Margin transaction details. The returned data is sorted in descending order according to the latest update time of the order.", "tags": [], "parameters": [ { "name": "symbol", "in": "query", "description": "symbol", "required": true, "schema": { "type": "string", "example": [ "BTC-USDT", "ETH-USDT", "KCS-USDT" ] } }, { "name": "tradeType", "in": "query", "description": "Trade type: MARGIN_TRADE - cross margin trade, MARGIN_ISOLATED_TRADE - isolated margin trade", "required": true, "schema": { "type": "string", "enum": [ "MARGIN_TRADE", "MARGIN_ISOLATED_TRADE" ], "x-api-enum": [ { "value": "MARGIN_TRADE", "name": "", "description": "" }, { "value": "MARGIN_ISOLATED_TRADE", "name": "", "description": "" } ] } }, { "name": "orderId", "in": "query", "description": "The unique order id generated by the trading system\n(If orderId is specified, please ignore the other query parameters)", "required": false, "schema": { "type": "string" } }, { "name": "side", "in": "query", "description": "Specify if the order is to 'buy' or 'sell'.", "required": false, "schema": { "type": "string", "enum": [ "buy", "sell" ], "x-api-enum": [ { "value": "buy", "name": "", "description": "" }, { "value": "sell", "name": "", "description": "" } ] } }, { "name": "type", "in": "query", "description": "Specify if the order is a 'limit' order or 'market' order. ", "required": false, "schema": { "type": "string", "enum": [ "limit", "market" ], "x-api-enum": [ { "value": "limit", "name": "", "description": "" }, { "value": "market", "name": "", "description": "" } ] } }, { "name": "lastId", "in": "query", "description": "The ID of the last set of data from the previous data batch. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId, which can be used as a query parameter to look up new data from the next page.", "required": false, "schema": { "type": "integer", "format": "int64" } }, { "name": "limit", "in": "query", "description": "Default20, Max100", "required": false, "schema": { "type": "integer", "default": 20, "minimum": 1, "maximum": 100 } }, { "name": "startAt", "in": "query", "description": "Start time (milliseconds)", "required": false, "schema": { "type": "integer", "format": "int64" } }, { "name": "endAt", "in": "query", "description": "End time (milliseconds)", "required": false, "schema": { "type": "integer", "format": "int64" } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "object", "properties": { "items": { "type": "array", "items": { "type": "object", "properties": { "id": { "type": "integer", "description": "ID of transaction detail", "format": "int64" }, "symbol": { "type": "string", "description": "symbol", "example": [ "BTC-USDT", "ETH-USDT", "KCS-USDT" ] }, "tradeId": { "type": "integer", "description": "Trade ID, symbol latitude increment", "format": "int64" }, "orderId": { "type": "string", "description": "The unique order id generated by the trading system" }, "counterOrderId": { "type": "string", "description": "Counterparty order ID" }, "side": { "type": "string", "description": "Buy or sell", "enum": [ "buy", "sell" ], "x-api-enum": [ { "value": "buy", "name": "", "description": "" }, { "value": "sell", "name": "", "description": "" } ] }, "liquidity": { "type": "string", "description": "Liquidity type: taker or maker", "enum": [ "taker", "maker" ], "x-api-enum": [ { "value": "taker", "name": "", "description": "" }, { "value": "maker", "name": "", "description": "" } ] }, "forceTaker": { "type": "boolean" }, "price": { "type": "string", "description": "Order Price" }, "size": { "type": "string", "description": "Order Size" }, "funds": { "type": "string", "description": "Order Funds" }, "fee": { "type": "string", "description": "[Handling fees](https://www.kucoin.com/docs-new/api-5327739)" }, "feeRate": { "type": "string", "description": "Fee rate\n" }, "feeCurrency": { "type": "string", "description": "Currency used to calculate trading fee" }, "stop": { "type": "string", "description": "Take Profit and Stop Loss type, currently HFT does not support the Take Profit and Stop Loss type, so it is empty" }, "tradeType": { "type": "string", "description": "Trade type, redundancy param" }, "tax": { "type": "string", "description": "Users in some regions have this field" }, "taxRate": { "type": "string", "description": "Tax Rate: Users in some regions must query this field" }, "type": { "type": "string", "description": "Specify if the order is a 'limit' order or 'market' order. ", "enum": [ "limit", "market" ], "x-api-enum": [ { "value": "limit", "name": "", "description": "" }, { "value": "market", "name": "", "description": "" } ] }, "createdAt": { "type": "integer", "format": "int64" } }, "required": [ "id", "symbol", "tradeId", "orderId", "counterOrderId", "side", "liquidity", "forceTaker", "price", "size", "funds", "fee", "feeRate", "feeCurrency", "stop", "tradeType", "tax", "taxRate", "type", "createdAt" ] } }, "lastId": { "type": "integer", "description": "The ID of the last set of data from the previous data batch. By default, the latest information is given.\nlastId is used to filter data and paginate. If lastId is not entered, the default is a maximum of 100 returned data items. The return results include lastId, which can be used as a query parameter to look up new data from the next page.", "format": "int64" } }, "required": [ "items", "lastId" ] } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470200", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "General", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Order", "x-sdk-method-name": "getTradeHistory", "x-sdk-method-description": "This endpoint can be used to obtain a list of the latest Margin transaction details. The returned data is sorted in descending order according to the latest update time of the order.", "x-api-rate-limit-weight": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"items\\\": [\\n {\\n \\\"id\\\": 137891621991,\\n \\\"symbol\\\": \\\"BTC-USDT\\\",\\n \\\"tradeId\\\": 11040911994273793,\\n \\\"orderId\\\": \\\"671868085584bc0007d85f46\\\",\\n \\\"counterOrderId\\\": \\\"67186805b7cbdf00071621f9\\\",\\n \\\"side\\\": \\\"buy\\\",\\n \\\"liquidity\\\": \\\"taker\\\",\\n \\\"forceTaker\\\": false,\\n \\\"price\\\": \\\"67141.6\\\",\\n \\\"size\\\": \\\"0.00001\\\",\\n \\\"funds\\\": \\\"0.671416\\\",\\n \\\"fee\\\": \\\"0.000671416\\\",\\n \\\"feeRate\\\": \\\"0.001\\\",\\n \\\"feeCurrency\\\": \\\"USDT\\\",\\n \\\"stop\\\": \\\"\\\",\\n \\\"tradeType\\\": \\\"MARGIN_TRADE\\\",\\n \\\"tax\\\": \\\"0\\\",\\n \\\"taxRate\\\": \\\"0\\\",\\n \\\"type\\\": \\\"limit\\\",\\n \\\"createdAt\\\": 1729652744998\\n }\\n ],\\n \\\"lastId\\\": 137891621991\\n }\\n}", "x-request-example": "{\\\"symbol\\\": \\\"BTC-USDT\\\", \\\"tradeType\\\": \\\"MARGIN_TRADE\\\", \\\"orderId\\\": \\\"example_string_default_value\\\", \\\"side\\\": \\\"buy\\\", \\\"type\\\": \\\"limit\\\", \\\"lastId\\\": 254062248624417, \\\"limit\\\": 100, \\\"startAt\\\": 1728663338000, \\\"endAt\\\": 1728692138000}", "operationId": "015" } }, "/api/v3/margin/borrow": { "post": { "summary": "Borrow", "deprecated": false, "description": "This API endpoint is used to initiate an application for cross or isolated margin borrowing.", "tags": [], "parameters": [], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "object", "properties": { "orderNo": { "type": "string", "description": "Borrow Order ID" }, "actualSize": { "type": "string", "description": "Actual borrowed amount" } }, "required": [ "orderNo", "actualSize" ] } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470206", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "Margin", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Debit", "x-sdk-method-name": "borrow", "x-sdk-method-description": "This API endpoint is used to initiate an application for cross or isolated margin borrowing.", "x-api-rate-limit-weight": 15, "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "currency": { "type": "string", "description": "currency", "example": [ "BTC", "ETH", "USDT" ] }, "size": { "type": "number", "description": "Borrow amount" }, "timeInForce": { "type": "string", "enum": [ "IOC", "FOK" ], "description": "timeInForce: IOC, FOK", "x-api-enum": [ { "value": "IOC", "name": "", "description": "" }, { "value": "FOK", "name": "", "description": "" } ] }, "symbol": { "type": "string", "description": "symbol, mandatory for isolated margin account", "example": [ "BTC-USDT", "ETH-USDT", "KCS-USDT" ] }, "isIsolated": { "type": "boolean", "description": "true-isolated, false-cross; default is false", "default": false }, "isHf": { "type": "boolean", "description": "true: high frequency borrowing, false: low frequency borrowing; default false", "default": false } }, "required": [ "currency", "size", "timeInForce" ] }, "example": "{\n \"currency\": \"USDT\",\n \"size\": 10,\n \"timeInForce\": \"FOK\",\n \"isIsolated\": false,\n \"isHf\": false\n}" } } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"orderNo\\\":\\\"67187162c0d6990007717b15\\\",\\\"actualSize\\\":\\\"10\\\"}}", "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"size\\\": 10, \\\"timeInForce\\\": \\\"FOK\\\", \\\"isIsolated\\\": false, \\\"isHf\\\": false}", "operationId": "018" }, "get": { "summary": "Get Borrow History", "deprecated": false, "description": "This API endpoint is used to get the borrowing orders for cross and isolated margin accounts.", "tags": [], "parameters": [ { "name": "currency", "in": "query", "description": "currency", "required": true, "schema": { "type": "string", "example": [ "BTC", "ETH", "KCS" ] } }, { "name": "isIsolated", "in": "query", "description": "true-isolated, false-cross; default is false", "required": false, "schema": { "type": "boolean", "default": false } }, { "name": "symbol", "in": "query", "description": "symbol, mandatory for isolated margin account", "required": false, "schema": { "type": "string", "example": [ "BTC-USDT", "ETH-USDT", "KCS-USDT" ] } }, { "name": "orderNo", "in": "query", "description": "Borrow Order ID", "required": false, "schema": { "type": "string" } }, { "name": "startTime", "in": "query", "description": "The start and end times are not restricted. If the start time is empty or less than 1680278400000, the default value is set to 1680278400000 (April 1, 2023, 00:00:00)", "required": false, "schema": { "type": "integer", "format": "int64" } }, { "name": "endTime", "in": "query", "description": "End time", "required": false, "schema": { "type": "integer", "format": "int64" } }, { "name": "currentPage", "in": "query", "description": "Current query page, with a starting value of 1. Default:1\n", "required": false, "schema": { "type": "integer", "default": 1 } }, { "name": "pageSize", "in": "query", "description": "Number of results per page. Default is 50, minimum is 10, maximum is 500", "required": false, "schema": { "type": "integer", "default": 50, "minimum": 10, "maximum": 500 } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "object", "properties": { "timestamp": { "type": "integer", "format": "int64" }, "currentPage": { "type": "integer", "description": "current page" }, "pageSize": { "type": "integer", "description": "page size" }, "totalNum": { "type": "integer", "description": "total number" }, "totalPage": { "type": "integer", "description": "total pages" }, "items": { "type": "array", "items": { "type": "object", "properties": { "orderNo": { "type": "string", "description": "Borrow Order ID" }, "symbol": { "type": "string", "description": "Isolated Margin symbol; empty for cross margin", "example": [ "BTC-USDT", "ETH-USDT", "KCS-USDT" ] }, "currency": { "type": "string", "description": "currency" }, "size": { "type": "string", "description": "Initiated borrow amount" }, "actualSize": { "type": "string", "description": "Actual borrow amount" }, "status": { "type": "string", "description": "PENDING: Processing, SUCCESS: Successful, FAILED: Failed", "enum": [ "PENDING", "SUCCESS", "FAILED" ], "x-api-enum": [ { "value": "PENDING", "name": "", "description": "" }, { "value": "SUCCESS", "name": "", "description": "" }, { "value": "FAILED", "name": "", "description": "" } ] }, "createdTime": { "type": "integer", "description": "Borrow time", "format": "int64" } }, "required": [ "orderNo", "symbol", "currency", "size", "actualSize", "status", "createdTime" ] } } }, "required": [ "timestamp", "currentPage", "pageSize", "totalNum", "totalPage", "items" ] } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470207", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "Margin", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Debit", "x-sdk-method-name": "getBorrowHistory", "x-sdk-method-description": "This API endpoint is used to get the borrowing orders for cross and isolated margin accounts.", "x-api-rate-limit-weight": 15, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"timestamp\\\": 1729657580449,\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 50,\\n \\\"totalNum\\\": 2,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"orderNo\\\": \\\"67187162c0d6990007717b15\\\",\\n \\\"symbol\\\": null,\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"size\\\": \\\"10\\\",\\n \\\"actualSize\\\": \\\"10\\\",\\n \\\"status\\\": \\\"SUCCESS\\\",\\n \\\"createdTime\\\": 1729655138000\\n },\\n {\\n \\\"orderNo\\\": \\\"67187155b088e70007149585\\\",\\n \\\"symbol\\\": null,\\n \\\"currency\\\": \\\"USDT\\\",\\n \\\"size\\\": \\\"0.1\\\",\\n \\\"actualSize\\\": \\\"0\\\",\\n \\\"status\\\": \\\"FAILED\\\",\\n \\\"createdTime\\\": 1729655125000\\n }\\n ]\\n }\\n}", "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"isIsolated\\\": true, \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderNo\\\": \\\"example_string_default_value\\\", \\\"startTime\\\": 123456, \\\"endTime\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", "operationId": "019" } }, "/api/v3/margin/repay": { "post": { "summary": "Repay", "deprecated": false, "description": "This API endpoint is used to initiate an application for cross or isolated margin repayment.", "tags": [], "parameters": [], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "object", "properties": { "timestamp": { "type": "integer", "format": "int64" }, "orderNo": { "type": "string", "description": "Repay order ID" }, "actualSize": { "type": "string", "description": "Actual repay amount" } }, "required": [ "timestamp", "orderNo", "actualSize" ] } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470210", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "Margin", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Debit", "x-sdk-method-name": "repay", "x-sdk-method-description": "This API endpoint is used to initiate an application for cross or isolated margin repayment.", "x-api-rate-limit-weight": 10, "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "currency": { "type": "string", "description": "currency", "example": [ "BTC", "ETH", "USDT" ] }, "size": { "type": "number", "description": "Borrow amount" }, "symbol": { "type": "string", "description": "symbol, mandatory for isolated margin account", "example": [ "BTC-USDT", "ETH-USDT", "KCS-USDT" ] }, "isIsolated": { "type": "boolean", "description": "true-isolated, false-cross; default is false", "default": false }, "isHf": { "type": "boolean", "description": "true: high frequency borrowing, false: low frequency borrowing; default false", "default": false } }, "required": [ "currency", "size" ] }, "example": "{\n \"currency\": \"USDT\",\n \"size\": 10\n}" } } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"timestamp\\\":1729655606816,\\\"orderNo\\\":\\\"671873361d5bd400075096ad\\\",\\\"actualSize\\\":\\\"10\\\"}}", "x-request-example": "{\\\"currency\\\": \\\"USDT\\\", \\\"size\\\": 10}", "operationId": "020" }, "get": { "summary": "Get Repay History", "deprecated": false, "description": "This API endpoint is used to get the borrowing orders for cross and isolated margin accounts.", "tags": [], "parameters": [ { "name": "currency", "in": "query", "description": "currency", "required": true, "schema": { "type": "string", "example": [ "BTC", "ETH", "KCS" ] } }, { "name": "isIsolated", "in": "query", "description": "true-isolated, false-cross; default is false", "required": false, "schema": { "type": "boolean", "default": false } }, { "name": "symbol", "in": "query", "description": "symbol, mandatory for isolated margin account", "required": false, "schema": { "type": "string", "example": [ "BTC-USDT", "ETH-USDT", "KCS-USDT" ] } }, { "name": "orderNo", "in": "query", "description": "Repay order ID", "required": false, "schema": { "type": "string" } }, { "name": "startTime", "in": "query", "description": "The start and end times are not restricted. If the start time is empty or less than 1680278400000, the default value is set to 1680278400000 (April 1, 2023, 00:00:00)", "required": false, "schema": { "type": "integer", "format": "int64" } }, { "name": "endTime", "in": "query", "description": "End time", "required": false, "schema": { "type": "integer", "format": "int64" } }, { "name": "currentPage", "in": "query", "description": "Current query page, with a starting value of 1. Default:1\n", "required": false, "schema": { "type": "integer", "default": 1 } }, { "name": "pageSize", "in": "query", "description": "Number of results per page. Default is 50, minimum is 10, maximum is 500", "required": false, "schema": { "type": "integer", "default": 50, "minimum": 10, "maximum": 500 } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "object", "properties": { "timestamp": { "type": "integer", "format": "int64" }, "currentPage": { "type": "integer", "description": "current page" }, "pageSize": { "type": "integer", "description": "page size" }, "totalNum": { "type": "integer", "description": "total number" }, "totalPage": { "type": "integer", "description": "total pages" }, "items": { "type": "array", "items": { "type": "object", "properties": { "orderNo": { "type": "string", "description": "Repay order ID" }, "symbol": { "type": "string", "description": "Isolated Margin symbol; empty for cross margin" }, "currency": { "type": "string", "description": "currency" }, "size": { "type": "string", "description": "Amount of initiated repay" }, "principal": { "type": "string", "description": "Amount of principal paid" }, "interest": { "type": "string", "description": "Amount of interest paid" }, "status": { "type": "string", "description": "PENDING: Processing, SUCCESS: Successful, FAILED: Failed", "enum": [ "PENDING", "SUCCESS", "FAILED" ], "x-api-enum": [ { "value": "PENDING", "name": "", "description": "" }, { "value": "SUCCESS", "name": "", "description": "" }, { "value": "FAILED", "name": "", "description": "" } ] }, "createdTime": { "type": "integer", "description": "Repayment time", "format": "int64" } }, "required": [ "symbol", "orderNo", "currency", "size", "principal", "interest", "status", "createdTime" ] } } }, "required": [ "timestamp", "currentPage", "pageSize", "totalNum", "totalPage", "items" ] } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470208", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "Margin", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Debit", "x-sdk-method-name": "getRepayHistory", "x-sdk-method-description": "This API endpoint is used to get the borrowing orders for cross and isolated margin accounts.", "x-api-rate-limit-weight": 15, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"timestamp\\\":1729663471891,\\\"currentPage\\\":1,\\\"pageSize\\\":50,\\\"totalNum\\\":1,\\\"totalPage\\\":1,\\\"items\\\":[{\\\"orderNo\\\":\\\"671873361d5bd400075096ad\\\",\\\"symbol\\\":null,\\\"currency\\\":\\\"USDT\\\",\\\"size\\\":\\\"10\\\",\\\"principal\\\":\\\"9.99986518\\\",\\\"interest\\\":\\\"0.00013482\\\",\\\"status\\\":\\\"SUCCESS\\\",\\\"createdTime\\\":1729655606000}]}}", "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"isIsolated\\\": true, \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"orderNo\\\": \\\"example_string_default_value\\\", \\\"startTime\\\": 123456, \\\"endTime\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", "operationId": "021" } }, "/api/v3/margin/interest": { "get": { "summary": "Get Interest History.", "deprecated": false, "description": "Request the interest records of the cross/isolated margin lending via this endpoint.", "tags": [], "parameters": [ { "name": "currency", "in": "query", "description": "currency", "required": false, "schema": { "type": "string", "example": [ "BTC", "ETH", "KCS" ] } }, { "name": "isIsolated", "in": "query", "description": "true-isolated, false-cross; default is false", "required": false, "schema": { "type": "boolean", "default": false } }, { "name": "symbol", "in": "query", "description": "symbol, mandatory for isolated margin account", "required": false, "schema": { "type": "string", "example": [ "BTC-USDT", "ETH-USDT", "KCS-USDT" ] } }, { "name": "startTime", "in": "query", "description": "The start and end times are not restricted. If the start time is empty or less than 1680278400000, the default value is set to 1680278400000 (April 1, 2023, 00:00:00)", "required": false, "schema": { "type": "integer", "format": "int64" } }, { "name": "endTime", "in": "query", "description": "End time", "required": false, "schema": { "type": "integer", "format": "int64" } }, { "name": "currentPage", "in": "query", "description": "Current query page, with a starting value of 1. Default:1\n", "required": false, "schema": { "type": "integer", "default": 1 } }, { "name": "pageSize", "in": "query", "description": "Number of results per page. Default is 50, minimum is 10, maximum is 500", "required": false, "schema": { "type": "integer", "default": 50, "minimum": 10, "maximum": 500 } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "object", "properties": { "timestamp": { "type": "integer", "format": "int64" }, "currentPage": { "type": "integer", "description": "current page" }, "pageSize": { "type": "integer", "description": "page size" }, "totalNum": { "type": "integer", "description": "total number" }, "totalPage": { "type": "integer", "description": "total pages" }, "items": { "type": "array", "items": { "type": "object", "properties": { "currency": { "type": "string", "description": "currency" }, "dayRatio": { "type": "string", "description": "Daily interest rate" }, "interestAmount": { "type": "string", "description": "Interest amount" }, "createdTime": { "type": "integer", "description": "Interest Timestamp", "format": "int64" } }, "required": [ "currency", "dayRatio", "interestAmount", "createdTime" ] } } }, "required": [ "timestamp", "currentPage", "pageSize", "totalNum", "totalPage", "items" ] } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470209", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "Margin", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Debit", "x-sdk-method-name": "getInterestHistory", "x-sdk-method-description": "Request the interest records of the cross/isolated margin lending via this endpoint.", "x-api-rate-limit-weight": 20, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":{\\\"timestamp\\\":1729665170701,\\\"currentPage\\\":1,\\\"pageSize\\\":50,\\\"totalNum\\\":3,\\\"totalPage\\\":1,\\\"items\\\":[{\\\"currency\\\":\\\"USDT\\\",\\\"dayRatio\\\":\\\"0.000296\\\",\\\"interestAmount\\\":\\\"0.00000001\\\",\\\"createdTime\\\":1729663213375},{\\\"currency\\\":\\\"USDT\\\",\\\"dayRatio\\\":\\\"0.000296\\\",\\\"interestAmount\\\":\\\"0.00000001\\\",\\\"createdTime\\\":1729659618802},{\\\"currency\\\":\\\"USDT\\\",\\\"dayRatio\\\":\\\"0.000296\\\",\\\"interestAmount\\\":\\\"0.00000001\\\",\\\"createdTime\\\":1729656028077}]}}", "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"isIsolated\\\": true, \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"startTime\\\": 123456, \\\"endTime\\\": 123456, \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", "operationId": "022" } }, "/api/v3/position/update-user-leverage": { "post": { "summary": "Modify Leverage", "deprecated": false, "description": "This endpoint allows modifying the leverage multiplier for cross margin or isolated margin.", "tags": [], "parameters": [], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "string" } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470211", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "Margin", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Debit", "x-sdk-method-name": "modifyLeverage", "x-sdk-method-description": "This endpoint allows modifying the leverage multiplier for cross margin or isolated margin.", "x-api-rate-limit-weight": 8, "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "symbol": { "type": "string", "description": "symbol, mandatory for isolated margin account", "example": [ "BTC-USDT", "ETH-USDT", "KCS-USDT" ] }, "isIsolated": { "type": "boolean", "description": "true-isolated, false-cross; default is false", "default": false }, "leverage": { "type": "string", "description": "New leverage multiplier. Must be greater than 1 and up to two decimal places, and cannot be less than the user's current debt leverage or greater than the system's maximum leverage" } }, "required": [ "leverage" ] }, "example": "{\n \"leverage\": \"5\"\n}" } } }, "x-response-example": "{\\\"code\\\":\\\"200000\\\",\\\"data\\\":null}", "x-request-example": "{\\\"leverage\\\": \\\"5\\\"}", "operationId": "023" } }, "/api/v3/project/list": { "get": { "summary": "Get Loan Market", "deprecated": false, "description": "This API endpoint is used to get the information about the currencies available for lending.", "tags": [], "parameters": [ { "name": "currency", "in": "query", "description": "currency", "required": false, "schema": { "type": "string", "example": [ "BTC", "ETH", "KCS" ] } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "array", "items": { "type": "object", "properties": { "currency": { "type": "string", "description": "Currency" }, "purchaseEnable": { "type": "boolean", "description": "Whether purchase is supported." }, "redeemEnable": { "type": "boolean", "description": "Whether redeem is supported." }, "increment": { "type": "string", "description": "Increment precision for purchase and redemption" }, "minPurchaseSize": { "type": "string", "description": "Minimum purchase amount" }, "minInterestRate": { "type": "string", "description": "Minimum lending rate" }, "maxInterestRate": { "type": "string", "description": "Maximum lending rate" }, "interestIncrement": { "type": "string", "description": "Increment precision for interest; default is 0.0001", "default": "0.0001" }, "maxPurchaseSize": { "type": "string", "description": "Maximum purchase amount" }, "marketInterestRate": { "type": "string", "description": "Latest market lending rate" }, "autoPurchaseEnable": { "type": "boolean", "description": "Whether to allow automatic purchase: True: on; false: off" } } } } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470212", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "General", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Credit", "x-sdk-method-name": "getLoanMarket", "x-sdk-method-description": "This API endpoint is used to get the information about the currencies available for lending.", "x-api-rate-limit-weight": 10, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"purchaseEnable\\\": true,\\n \\\"redeemEnable\\\": true,\\n \\\"increment\\\": \\\"0.00000001\\\",\\n \\\"minPurchaseSize\\\": \\\"0.001\\\",\\n \\\"maxPurchaseSize\\\": \\\"40\\\",\\n \\\"interestIncrement\\\": \\\"0.0001\\\",\\n \\\"minInterestRate\\\": \\\"0.005\\\",\\n \\\"marketInterestRate\\\": \\\"0.005\\\",\\n \\\"maxInterestRate\\\": \\\"0.32\\\",\\n \\\"autoPurchaseEnable\\\": false\\n }\\n ]\\n}", "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}", "operationId": "024" } }, "/api/v3/project/marketInterestRate": { "get": { "summary": "Get Loan Market Interest Rate", "deprecated": false, "description": "This API endpoint is used to get the interest rates of the margin lending market over the past 7 days.", "tags": [], "parameters": [ { "name": "currency", "in": "query", "description": "currency", "required": true, "schema": { "type": "string", "example": [ "BTC", "ETH", "KCS" ] } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "array", "items": { "type": "object", "properties": { "time": { "type": "string", "description": "Time: YYYYMMDDHH00" }, "marketInterestRate": { "type": "string", "description": "Market lending rate" } }, "required": [ "time", "marketInterestRate" ] } } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470215", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Public", "x-api-permission": "NULL", "x-api-rate-limit-pool": "Public", "x-sdk-service": "Margin", "x-sdk-sub-service": "Credit", "x-sdk-method-name": "getLoanMarketInterestRate", "x-sdk-method-description": "This API endpoint is used to get the interest rates of the margin lending market over the past 7 days.", "x-api-rate-limit-weight": 5, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"time\\\": \\\"202410170000\\\",\\n \\\"marketInterestRate\\\": \\\"0.005\\\"\\n },\\n {\\n \\\"time\\\": \\\"202410170100\\\",\\n \\\"marketInterestRate\\\": \\\"0.005\\\"\\n }\\n ]\\n}", "x-request-example": "{\\\"currency\\\": \\\"BTC\\\"}", "operationId": "025" } }, "/api/v3/purchase": { "post": { "summary": "Purchase", "deprecated": false, "description": "Invest credit in the market and earn interest", "tags": [], "parameters": [], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "object", "properties": { "orderNo": { "type": "string", "description": "Purchase order ID" } }, "required": [ "orderNo" ] } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470216", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "Margin", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Credit", "x-sdk-method-name": "purchase", "x-sdk-method-description": "Invest credit in the market and earn interest", "x-api-rate-limit-weight": 15, "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "currency": { "type": "string", "description": "Currency", "example": [ "BTC", "ETH", "USDT" ] }, "size": { "type": "string", "description": "Purchase amount" }, "interestRate": { "type": "string", "description": "Purchase interest rate" } }, "required": [ "currency", "size", "interestRate" ] }, "example": "{\n \"currency\": \"BTC\",\n \"size\": \"0.001\",\n \"interestRate\": \"0.1\"\n}" } } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderNo\\\": \\\"671bafa804c26d000773c533\\\"\\n }\\n}", "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"size\\\": \\\"0.001\\\", \\\"interestRate\\\": \\\"0.1\\\"}", "operationId": "026" } }, "/api/v3/lend/purchase/update": { "post": { "summary": "Modify Purchase", "deprecated": false, "description": "This API endpoint is used to update the interest rates of subscription orders, which will take effect at the beginning of the next hour. Please ensure that the funds are in the main (funding) account.", "tags": [], "parameters": [], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "string" } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470217", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "Margin", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Credit", "x-sdk-method-name": "modifyPurchase", "x-sdk-method-description": "This API endpoint is used to update the interest rates of subscription orders, which will take effect at the beginning of the next hour. Please ensure that the funds are in the main (funding) account.", "x-api-rate-limit-weight": 10, "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "currency": { "type": "string", "description": "Currency", "example": [ "BTC", "ETH", "USDT" ] }, "interestRate": { "type": "string", "description": "Modified purchase interest rate" }, "purchaseOrderNo": { "type": "string", "description": "Purchase order ID" } }, "required": [ "currency", "purchaseOrderNo", "interestRate" ] }, "example": "{\n \"currency\": \"BTC\",\n \"purchaseOrderNo\": \"671bafa804c26d000773c533\",\n \"interestRate\": \"0.09\"\n}" } } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": null\\n}", "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"purchaseOrderNo\\\": \\\"671bafa804c26d000773c533\\\", \\\"interestRate\\\": \\\"0.09\\\"}", "operationId": "027" } }, "/api/v3/purchase/orders": { "get": { "summary": "Get Purchase Orders", "deprecated": false, "description": "This API endpoint provides a pagination query for the purchase orders.", "tags": [], "parameters": [ { "name": "status", "in": "query", "description": "DONE-completed; PENDING-settling", "required": true, "schema": { "type": "string", "enum": [ "DONE", "PENDING" ], "x-api-enum": [ { "value": "DONE", "name": "DONE", "description": "completed" }, { "value": "PENDING", "name": "PENDING", "description": "settling" } ] } }, { "name": "currency", "in": "query", "description": "Currency", "required": false, "schema": { "type": "string", "example": [ "BTC", "ETH", "KCS" ] } }, { "name": "purchaseOrderNo", "in": "query", "description": "Purchase order ID", "required": false, "schema": { "type": "string" } }, { "name": "currentPage", "in": "query", "description": "Current page; default is 1", "required": false, "schema": { "type": "integer", "default": 1 } }, { "name": "pageSize", "in": "query", "description": "Page size; 1<=pageSize<=50; default is 50", "required": false, "schema": { "type": "integer", "default": 50, "minimum": 1, "maximum": 50 } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "object", "properties": { "currentPage": { "type": "integer", "description": "Current Page" }, "pageSize": { "type": "integer", "description": "Page Size" }, "totalNum": { "type": "integer", "description": "Total Number" }, "totalPage": { "type": "integer", "description": "Total Pages" }, "items": { "type": "array", "items": { "type": "object", "properties": { "currency": { "type": "string", "description": "Currency", "example": [ "BTC", "ETH", "USDT" ] }, "purchaseOrderNo": { "type": "string", "description": "Purchase order ID" }, "purchaseSize": { "type": "string", "description": "Total purchase size" }, "matchSize": { "type": "string", "description": "Executed size" }, "interestRate": { "type": "string", "description": "Target annualized interest rate" }, "incomeSize": { "type": "string", "description": "Redeemed amount" }, "applyTime": { "type": "integer", "description": "Time of purchase", "format": "int64" }, "status": { "type": "string", "description": "Status: DONE-completed; PENDING-settling", "enum": [ "DONE", "PENDING" ], "x-api-enum": [ { "value": "DONE", "name": "", "description": "" }, { "value": "PENDING", "name": "", "description": "" } ] } }, "required": [ "currency", "purchaseOrderNo", "purchaseSize", "matchSize", "interestRate", "incomeSize", "applyTime", "status" ] } } }, "required": [ "currentPage", "pageSize", "totalNum", "totalPage", "items" ] } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470213", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "General", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Credit", "x-sdk-method-name": "getPurchaseOrders", "x-sdk-method-description": "This API endpoint provides a pagination query for the purchase orders.", "x-api-rate-limit-weight": 10, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 10,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"purchaseOrderNo\\\": \\\"671bb15a3b3f930007880bae\\\",\\n \\\"purchaseSize\\\": \\\"0.001\\\",\\n \\\"matchSize\\\": \\\"0\\\",\\n \\\"interestRate\\\": \\\"0.1\\\",\\n \\\"incomeSize\\\": \\\"0\\\",\\n \\\"applyTime\\\": 1729868122172,\\n \\\"status\\\": \\\"PENDING\\\"\\n }\\n ]\\n }\\n}", "x-request-example": "{\\\"status\\\": \\\"DONE\\\", \\\"currency\\\": \\\"BTC\\\", \\\"purchaseOrderNo\\\": \\\"example_string_default_value\\\", \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", "operationId": "028" } }, "/api/v3/redeem": { "post": { "summary": "Redeem", "deprecated": false, "description": "Redeem your loan order.", "tags": [], "parameters": [], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "object", "properties": { "orderNo": { "type": "string", "description": "Redeem order ID" } }, "required": [ "orderNo" ] } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470218", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "Margin", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Credit", "x-sdk-method-name": "redeem", "x-sdk-method-description": "Redeem your loan order.", "x-api-rate-limit-weight": 15, "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "currency": { "type": "string", "description": "Currency", "example": [ "BTC", "ETH", "USDT" ] }, "size": { "type": "string", "description": "Redemption amount" }, "purchaseOrderNo": { "type": "string", "description": "Purchase order ID" } }, "required": [ "currency", "size", "purchaseOrderNo" ] }, "example": "{\n \"currency\": \"BTC\",\n \"size\": \"0.001\",\n \"purchaseOrderNo\": \"671bafa804c26d000773c533\"\n}" } } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderNo\\\": \\\"671bafa804c26d000773c533\\\"\\n }\\n}", "x-request-example": "{\\\"currency\\\": \\\"BTC\\\", \\\"size\\\": \\\"0.001\\\", \\\"purchaseOrderNo\\\": \\\"671bafa804c26d000773c533\\\"}", "operationId": "029" } }, "/api/v3/redeem/orders": { "get": { "summary": "Get Redeem Orders", "deprecated": false, "description": "This API endpoint provides pagination query for the redeem orders.", "tags": [], "parameters": [ { "name": "status", "in": "query", "description": "DONE-completed; PENDING-settling", "required": true, "schema": { "type": "string", "enum": [ "DONE", "PENDING" ], "x-api-enum": [ { "value": "DONE", "name": "DONE", "description": "completed" }, { "value": "PENDING", "name": "PENDING", "description": "settling" } ] } }, { "name": "currency", "in": "query", "description": "currency", "required": false, "schema": { "type": "string", "example": [ "BTC", "ETH", "KCS" ] } }, { "name": "redeemOrderNo", "in": "query", "description": "Redeem order ID", "required": false, "schema": { "type": "string" } }, { "name": "currentPage", "in": "query", "description": "Current page; default is 1", "required": false, "schema": { "type": "integer", "default": 1 } }, { "name": "pageSize", "in": "query", "description": "Page size; 1<=pageSize<=50; default is 50", "required": false, "schema": { "type": "integer", "default": 50, "minimum": 1, "maximum": 50 } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "object", "properties": { "currentPage": { "type": "integer", "description": "Current Page" }, "pageSize": { "type": "integer", "description": "Page Size" }, "totalNum": { "type": "integer", "description": "Total Number" }, "totalPage": { "type": "integer", "description": "Total Pages" }, "items": { "type": "array", "items": { "type": "object", "properties": { "currency": { "type": "string", "description": "Currency", "example": [ "BTC", "ETH", "USDT" ] }, "purchaseOrderNo": { "type": "string", "description": "Purchase order ID" }, "redeemOrderNo": { "type": "string", "description": "Redeem order ID" }, "redeemSize": { "type": "string", "description": "Redemption size" }, "receiptSize": { "type": "string", "description": "Redeemed size" }, "applyTime": { "type": "string", "description": "Time of redeem" }, "status": { "type": "string", "description": "Status: DONE-completed; PENDING-settling" } }, "required": [ "currency", "purchaseOrderNo", "redeemOrderNo", "redeemSize", "receiptSize", "applyTime", "status" ] } } }, "required": [ "currentPage", "pageSize", "totalNum", "totalPage", "items" ] } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470214", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "General", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Credit", "x-sdk-method-name": "getRedeemOrders", "x-sdk-method-description": "This API endpoint provides pagination query for the redeem orders.", "x-api-rate-limit-weight": 10, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"currentPage\\\": 1,\\n \\\"pageSize\\\": 10,\\n \\\"totalNum\\\": 1,\\n \\\"totalPage\\\": 1,\\n \\\"items\\\": [\\n {\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"purchaseOrderNo\\\": \\\"671bafa804c26d000773c533\\\",\\n \\\"redeemOrderNo\\\": \\\"671bb01004c26d000773c55c\\\",\\n \\\"redeemSize\\\": \\\"0.001\\\",\\n \\\"receiptSize\\\": \\\"0.001\\\",\\n \\\"applyTime\\\": null,\\n \\\"status\\\": \\\"DONE\\\"\\n }\\n ]\\n }\\n}", "x-request-example": "{\\\"status\\\": \\\"DONE\\\", \\\"currency\\\": \\\"BTC\\\", \\\"redeemOrderNo\\\": \\\"example_string_default_value\\\", \\\"currentPage\\\": 1, \\\"pageSize\\\": 50}", "operationId": "030" } }, "/api/v3/margin/currencies": { "get": { "summary": "Get Margin Risk Limit", "deprecated": false, "description": "Request Configure and Risk limit info of the margin via this endpoint.", "tags": [], "parameters": [ { "name": "isIsolated", "in": "query", "description": "True-isolated, false-cross", "required": false, "schema": { "type": "boolean" } }, { "name": "currency", "in": "query", "description": "Currency: This field is only required for cross margin", "required": false, "schema": { "type": "string" } }, { "name": "symbol", "in": "query", "description": "Symbol: This field is only required for isolated margin", "required": false, "schema": { "type": "string", "example": [ "BTC-USDT", "ETH-USDT", "KCS-USDT" ] } } ], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "array", "items": { "type": "object", "properties": { "timestamp": { "type": "integer", "description": "Time stamp", "format": "int64" }, "currency": { "type": "string", "description": "CROSS MARGIN RESPONSES, Currency" }, "borrowMaxAmount": { "type": "string", "description": "CROSS MARGIN RESPONSES, Maximum personal borrow amount. If the platform has no borrowing amount, this value will still be displayed." }, "buyMaxAmount": { "type": "string", "description": "CROSS MARGIN RESPONSES, Maximum buy amount" }, "holdMaxAmount": { "type": "string", "description": "CROSS MARGIN RESPONSES, Maximum holding amount" }, "borrowCoefficient": { "type": "string", "description": "CROSS MARGIN RESPONSES, [Borrow Coefficient](https://www.kucoin.com/land/price-protect)" }, "marginCoefficient": { "type": "string", "description": "CROSS MARGIN RESPONSES, [Margin Coefficient](https://www.kucoin.com/land/price-protect)" }, "precision": { "type": "integer", "description": "CROSS MARGIN RESPONSES, Currency precision. The minimum repayment amount of a single transaction should be >= currency precision. For example, the precision of ETH is 8, and the minimum repayment amount is 0.00000001" }, "borrowMinAmount": { "type": "string", "description": "CROSS MARGIN RESPONSES, Minimum personal borrow amount" }, "borrowMinUnit": { "type": "string", "description": "CROSS MARGIN RESPONSES, Minimum unit for borrowing; the borrowed amount must be an integer multiple of this value" }, "borrowEnabled": { "type": "boolean", "description": "CROSS MARGIN RESPONSES, Whether to support borrowing" }, "symbol": { "type": "string", "description": "ISOLATED MARGIN RESPONSES, Symbol" }, "baseMaxBorrowAmount": { "type": "string", "description": "ISOLATED MARGIN RESPONSES, Base maximum personal borrow amount. If the platform has no borrowing amount, this value will still be displayed." }, "quoteMaxBorrowAmount": { "type": "string", "description": "ISOLATED MARGIN RESPONSES, Quote maximum personal borrow amount. If the platform has no borrowing amount, this value will still be displayed." }, "baseMaxBuyAmount": { "type": "string", "description": "ISOLATED MARGIN RESPONSES, Base maximum buy amount\n" }, "quoteMaxBuyAmount": { "type": "string", "description": "ISOLATED MARGIN RESPONSES, Quote maximum buy amount" }, "baseMaxHoldAmount": { "type": "string", "description": "ISOLATED MARGIN RESPONSES, Base maximum holding amount\n" }, "quoteMaxHoldAmount": { "type": "string", "description": "ISOLATED MARGIN RESPONSES, Quote maximum holding amount\n" }, "basePrecision": { "type": "integer", "description": "ISOLATED MARGIN RESPONSES, Base currency precision. The minimum repayment amount of a single transaction should be >= currency precision. For example, the precision of ETH is 8, and the minimum repayment amount is 0.00000001" }, "quotePrecision": { "type": "integer", "description": "ISOLATED MARGIN RESPONSES, Quote currency precision. The minimum repayment amount of a single transaction should be >= currency precision. For example, the precision of ETH is 8, and the minimum repayment amount is 0.00000001\n" }, "baseBorrowMinAmount": { "type": "string", "description": "ISOLATED MARGIN RESPONSES, Base minimum personal borrow amount\n" }, "quoteBorrowMinAmount": { "type": "string", "description": "ISOLATED MARGIN RESPONSES, Quote minimum personal borrow amount" }, "baseBorrowMinUnit": { "type": "string", "description": "ISOLATED MARGIN RESPONSES, Base minimum unit for borrowing, the borrowed amount must be an integer multiple of this value" }, "quoteBorrowMinUnit": { "type": "string", "description": "ISOLATED MARGIN RESPONSES, Quote minimum unit for borrowing, the borrowed amount must be an integer multiple of this value" }, "baseBorrowEnabled": { "type": "boolean", "description": "ISOLATED MARGIN RESPONSES, Base whether to support borrowing\n" }, "quoteBorrowEnabled": { "type": "boolean", "description": "ISOLATED MARGIN RESPONSES, Quote whether to support borrowing\n" }, "baseBorrowCoefficient": { "type": "string", "description": "ISOLATED MARGIN RESPONSES, [Base Borrow Coefficient](https://www.kucoin.com/land/price-protect)" }, "quoteBorrowCoefficient": { "type": "string", "description": "ISOLATED MARGIN RESPONSES, [Quote Borrow Coefficient](https://www.kucoin.com/land/price-protect)" }, "baseMarginCoefficient": { "type": "string", "description": "ISOLATED MARGIN RESPONSES, [Base Margin Coefficient](https://www.kucoin.com/land/price-protect)" }, "quoteMarginCoefficient": { "type": "string", "description": "ISOLATED MARGIN RESPONSES, [Quote Margin Coefficient](https://www.kucoin.com/land/price-protect)" } } } } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470219", "x-abandon": "normal", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "General", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "RiskLimit", "x-sdk-method-name": "getMarginRiskLimit", "x-sdk-method-description": "Request Configure and Risk limit info of the margin via this endpoint.", "x-api-rate-limit-weight": 20, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": [\\n {\\n \\\"timestamp\\\": 1729678659275,\\n \\\"currency\\\": \\\"BTC\\\",\\n \\\"borrowMaxAmount\\\": \\\"75.15\\\",\\n \\\"buyMaxAmount\\\": \\\"217.12\\\",\\n \\\"holdMaxAmount\\\": \\\"217.12\\\",\\n \\\"borrowCoefficient\\\": \\\"1\\\",\\n \\\"marginCoefficient\\\": \\\"1\\\",\\n \\\"precision\\\": 8,\\n \\\"borrowMinAmount\\\": \\\"0.001\\\",\\n \\\"borrowMinUnit\\\": \\\"0.0001\\\",\\n \\\"borrowEnabled\\\": true\\n }\\n ]\\n}\\n", "x-request-example": "{\\\"isIsolated\\\": true, \\\"currency\\\": \\\"BTC\\\", \\\"symbol\\\": \\\"BTC-USDT\\\"}", "operationId": "031" } }, "/api/v1/margin/order": { "post": { "summary": "Add Order - V1", "deprecated": true, "description": "Place order in the Cross-margin or Isolated-margin trading system. You can place two major types of order: Limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", "tags": [], "parameters": [], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "object", "properties": { "orderId": { "type": "string", "description": "The unique order ID generated by the trading system, which can be used later for further actions such as canceling the order." }, "loanApplyId": { "type": "string", "description": "Borrow order ID. The field is returned only after placing the order under the mode of Auto-Borrow." }, "borrowSize": { "type": "string", "description": "Borrowed amount. The field is returned only after placing the order under the mode of Auto-Borrow." }, "clientOid": { "type": "string", "description": "This return value is invalid" } }, "required": [ "orderId", "loanApplyId", "borrowSize", "clientOid" ] } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470312", "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "Margin", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Order", "x-sdk-method-name": "addOrderV1", "x-sdk-method-description": "Place order in the Cross-margin or Isolated-margin trading system. You can place two major types of order: Limit and market. Orders can only be placed if your account has sufficient funds. Once an order is placed, your funds will be put on hold for the duration of the order. The amount of funds on hold depends on the order type and parameters specified.", "x-api-rate-limit-weight": 5, "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "clientOid": { "type": "string", "description": "Client Order ID: The ClientOid field is a unique ID created by the user (we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", "example": [ "5c52e11203aa677f33e493fb" ] }, "side": { "type": "string", "description": "Specify if the order is to 'buy' or 'sell'.", "enum": [ "buy", "sell" ], "x-api-enum": [ { "value": "buy", "name": "", "description": "" }, { "value": "sell", "name": "", "description": "" } ], "example": [ "buy" ] }, "symbol": { "type": "string", "description": "symbol", "example": [ "BTC-USDT", "ETH-USDT", "KCS-USDT" ] }, "type": { "type": "string", "description": "Specify if the order is a 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price; you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", "enum": [ "limit", "market" ], "default": "limit", "x-api-enum": [ { "value": "limit", "name": "", "description": "" }, { "value": "market", "name": "", "description": "" } ] }, "stp": { "type": "string", "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/doc-338146) is divided into four strategies: CN, CO, CB , and DC", "enum": [ "DC", "CO", "CN", "CB" ], "x-api-enum": [ { "value": "DC", "name": "", "description": "" }, { "value": "CO", "name": "", "description": "" }, { "value": "CN", "name": "", "description": "" }, { "value": "CB", "name": "", "description": "" } ] }, "price": { "type": "string", "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." }, "size": { "type": "string", "description": "Specify quantity for order.\n\nWhen **type** is limited, size refers to the amount of trading targets (the asset name written in front) for the trading pair. The Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" }, "timeInForce": { "type": "string", "description": "[Time in force](https://www.kucoin.com/docs-new/doc-338146) is a special strategy used during trading", "enum": [ "GTC", "GTT", "IOC", "FOK" ], "default": "GTC", "x-api-enum": [ { "value": "GTC", "name": "", "description": "" }, { "value": "GTT", "name": "", "description": "" }, { "value": "IOC", "name": "", "description": "" }, { "value": "FOK", "name": "", "description": "" } ] }, "postOnly": { "type": "boolean", "default": false, "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" }, "hidden": { "type": "boolean", "description": "Hidden or not (not shown in order book)", "default": false }, "iceberg": { "type": "boolean", "description": "Whether or not only visible portions of orders are shown in iceberg orders", "default": false }, "visibleSize": { "type": "string", "description": "Maximum visible quantity in iceberg orders" }, "cancelAfter": { "type": "integer", "format": "int64", "description": "Cancel after n seconds, the order timing strategy is GTT" }, "funds": { "type": "string", "description": "When **type** is market, select one out of two: size or funds" }, "autoBorrow": { "type": "boolean", "description": "When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate.", "default": false }, "autoRepay": { "type": "boolean", "description": "AutoPay allows the return of borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount.", "default": false }, "marginModel": { "type": "string", "description": "The type of trading, including cross (cross mode) and isolated (isolated mode). It is set at cross by default.", "enum": [ "cross", "isolated" ], "default": "cross", "x-api-enum": [ { "value": "cross", "name": "", "description": "" }, { "value": "isolated", "name": "", "description": "" } ] } }, "required": [ "symbol", "side", "clientOid" ] }, "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e4193fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n" } } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671bb90194422f00073ff4f0\\\",\\n \\\"loanApplyId\\\": null,\\n \\\"borrowSize\\\": null,\\n \\\"clientOid\\\": null\\n }\\n}", "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e4193fb\\\", \\\"remark\\\": \\\"order remarks\\\"}", "operationId": "032" } }, "/api/v1/margin/order/test": { "post": { "summary": "Add Order Test - V1", "deprecated": true, "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.", "tags": [], "parameters": [], "responses": { "200": { "description": "", "content": { "application/json": { "schema": { "type": "object", "properties": { "code": { "type": "string" }, "data": { "type": "object", "properties": { "orderId": { "type": "string", "description": "The unique order ID generated by the trading system, which can be used later for further actions such as canceling the order." }, "loanApplyId": { "type": "string", "description": "Borrow order ID. The field is returned only after placing the order under the mode of Auto-Borrow." }, "borrowSize": { "type": "string", "description": "Borrowed amount. The field is returned only after placing the order under the mode of Auto-Borrow." }, "clientOid": { "type": "string", "description": "This return value is invalid" } }, "required": [ "orderId", "loanApplyId", "borrowSize", "clientOid" ] } }, "required": [ "code", "data" ] } } } } }, "x-api-doc": "https://www.kucoin.com/docs-new/api-3470313", "x-abandon": "abandon", "x-domain": "Spot", "x-api-channel": "Private", "x-api-permission": "Margin", "x-api-rate-limit-pool": "Spot", "x-sdk-service": "Margin", "x-sdk-sub-service": "Order", "x-sdk-method-name": "addOrderTestV1", "x-sdk-method-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.", "x-api-rate-limit-weight": 5, "requestBody": { "content": { "application/json": { "schema": { "type": "object", "properties": { "clientOid": { "type": "string", "description": "Client Order ID: The ClientOid field is a unique ID created by the user (we recommend using a UUID), and can only contain numbers, letters, underscores (_), and hyphens (-). This field is returned when order information is obtained. You can use clientOid to tag your orders. ClientOid is different from the order ID created by the service provider. Please do not initiate requests using the same clientOid. The maximum length for the ClientOid is 40 characters.\n\nPlease remember the orderId created by the service provider, it used to check for updates in order status.", "example": [ "5c52e11203aa677f33e493fb" ] }, "side": { "type": "string", "description": "Specify if the order is to 'buy' or 'sell'.", "enum": [ "buy", "sell" ], "x-api-enum": [ { "value": "buy", "name": "", "description": "" }, { "value": "sell", "name": "", "description": "" } ], "example": [ "buy" ] }, "symbol": { "type": "string", "description": "symbol", "example": [ "BTC-USDT", "ETH-USDT", "KCS-USDT" ] }, "type": { "type": "string", "description": "Specify if the order is a 'limit' order or 'market' order. \n\nThe type of order you specify when you place your order determines whether or not you need to request other parameters and also affects the execution of the matching engine.\n\nWhen placing a limit order, you must specify a price and size. The system will try to match the order according to market price or a price better than market price. If the order cannot be immediately matched, it will stay in the order book until it is matched or the user cancels.\n\nUnlike limit orders, the price for market orders fluctuates with market prices. When placing a market order, you do not need to specify a price; you only need to specify a quantity. Market orders are filled immediately and will not enter the order book. All market orders are takers and a taker fee will be charged.", "enum": [ "limit", "market" ], "default": "limit", "x-api-enum": [ { "value": "limit", "name": "", "description": "" }, { "value": "market", "name": "", "description": "" } ] }, "stp": { "type": "string", "description": "[Self Trade Prevention](https://www.kucoin.com/docs-new/api-5176570) is divided into four strategies: CN, CO, CB , and DC", "enum": [ "DC", "CO", "CN", "CB" ], "x-api-enum": [ { "value": "DC", "name": "", "description": "" }, { "value": "CO", "name": "", "description": "" }, { "value": "CN", "name": "", "description": "" }, { "value": "CB", "name": "", "description": "" } ] }, "price": { "type": "string", "description": "Specify price for order\n\nWhen placing a limit order, the price must be based on priceIncrement for the trading pair. The price increment (priceIncrement) is the price precision for the trading pair. For example, for the BTC-USDT trading pair, the priceIncrement is 0.00001000. So the price for your orders cannot be less than 0.00001000 and must be a multiple of priceIncrement. Otherwise, the order will return an invalid priceIncrement error." }, "size": { "type": "string", "description": "Specify quantity for order.\n\nWhen **type** is limited, size refers to the amount of trading targets (the asset name written in front) for the trading pair. The Size must be based on the baseIncrement of the trading pair. The baseIncrement represents the precision for the trading pair. The size of an order must be a positive-integer multiple of baseIncrement and must be between baseMinSize and baseMaxSize.\n\nWhen **type** is market, select one out of two: size or funds" }, "timeInForce": { "type": "string", "description": "[Time in force](https://www.kucoin.com/docs-new/api-5176570) is a special strategy used during trading", "enum": [ "GTC", "GTT", "IOC", "FOK" ], "default": "GTC", "x-api-enum": [ { "value": "GTC", "name": "", "description": "" }, { "value": "GTT", "name": "", "description": "" }, { "value": "IOC", "name": "", "description": "" }, { "value": "FOK", "name": "", "description": "" } ] }, "postOnly": { "type": "boolean", "default": false, "description": "passive order labels, this is disabled when the order timing strategy is IOC or FOK" }, "hidden": { "type": "boolean", "description": "Hidden or not (not shown in order book)", "default": false }, "iceberg": { "type": "boolean", "description": "Whether or not only visible portions of orders are shown in iceberg orders", "default": false }, "visibleSize": { "type": "string", "description": "Maximum visible quantity in iceberg orders" }, "cancelAfter": { "type": "integer", "format": "int64", "description": "Cancel after n seconds, the order timing strategy is GTT" }, "funds": { "type": "string", "description": "When **type** is market, select one out of two: size or funds" }, "autoBorrow": { "type": "boolean", "description": "When Margin Account has inefficient balance, our system autoborrows inefficient assets and opens positions according to the lowest market interest rate.", "default": false }, "autoRepay": { "type": "boolean", "description": "AutoPay allows the return of borrowed assets when you close a position. Our system automatically triggers the repayment and the maximum repayment amount equals to the filled-order amount.", "default": false }, "marginModel": { "type": "string", "description": "The type of trading, including cross (cross mode) and isolated (isolated mode). It is set at cross by default.", "enum": [ "cross", "isolated" ], "default": "cross", "x-api-enum": [ { "value": "cross", "name": "", "description": "" }, { "value": "isolated", "name": "", "description": "" } ] } }, "required": [ "symbol", "side", "clientOid" ] }, "example": "//limit order\n{\n \"type\": \"limit\",\n \"symbol\": \"BTC-USDT\",\n \"side\": \"buy\",\n \"price\": \"50000\",\n \"size\": \"0.00001\",\n \"clientOid\": \"5c52e11203aa677f33e4193fb\",\n \"remark\": \"order remarks\"\n}\n\n//market order 1\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"size\": \"0.00001\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n\n//market order 2\n// {\n// \"type\": \"market\",\n// \"symbol\": \"BTC-USDT\",\n// \"side\": \"buy\",\n// \"funds\": \"1\",\n// \"clientOid\": \"5c52e11203aa677f33e493fc\",\n// \"remark\": \"order remarks\"\n// }\n" } } }, "x-response-example": "{\\n \\\"code\\\": \\\"200000\\\",\\n \\\"data\\\": {\\n \\\"orderId\\\": \\\"671bb90194422f00073ff4f0\\\",\\n \\\"loanApplyId\\\": null,\\n \\\"borrowSize\\\": null,\\n \\\"clientOid\\\": null\\n }\\n}", "x-request-example": "{\\\"type\\\": \\\"limit\\\", \\\"symbol\\\": \\\"BTC-USDT\\\", \\\"side\\\": \\\"buy\\\", \\\"price\\\": \\\"50000\\\", \\\"size\\\": \\\"0.00001\\\", \\\"clientOid\\\": \\\"5c52e11203aa677f33e4193fb\\\", \\\"remark\\\": \\\"order remarks\\\"}", "operationId": "033" } } }, "components": { "schemas": {} } }