Stablecoin FX Quick Start
This guide explains how to swap any stablecoin using our KIIEX API. It covers retrieving balances, checking the current exchange rate, sending the order and verifying execution.
Requirements to be able to trade stablecoins on KIIEX, via dashboard or API:
Have a user
Have an account level 1 at least (to upgrade from level 0 to level 1, you need to complete our KYC verification inside your user settings)
Have balances on any stablecoin
Endpoints
Staging URL :
https://apstage.proxy.kiiex.io/ap
Prod URL :
https://alphaprod.proxy.kiiex.io/ap
Swap Workflow example
For this example will assume a goal and specify what to do in order, also we'll provide you with all the endpoints related to each step. The goal is:
Swap USDT → COPM using a market order.
Prerequisites
These are the prerequisites for the step-by-step guide.
Create your KIIEX account:
Go to https://kiiex.io/ and click on login, and create your user
You can also follow our guide on Set up your KIIEX Account
Update your account from level 0 to level 1 by following our KYC flow to be able to swap
Create your trader API Key on our panel to follow the next steps
Step-by-step
These are the steps to fully create a swap and withdraw it:
Authenticate your user via api
Create a USDT deposit. If you have already created a deposit, check your current balance
Get the current COPM/USDT rate
Create market order (buy COPM)
Verify order was filled
Get trade details (swap info)
Confirm the new COPM balance using the get account positions endpoint
Create a COPM withdrawal, it could be to another wallet or to your bank account
Check your COPM withdrawal status
How do I perform the swap workflow using the API?
API endpoints
Authenticate your User via API
POST /ap/AuthenticateUser HTTP/1.1
Host: apstage.proxy.kiiex.io
Content-Type: application/json
Accept: */*
Content-Length: 85
{
"APIKey": "text",
"Signature": "text",
"UserId": "text",
"UserName": "text",
"Nonce": "text"
}
Authentication result
{
"authenticated": true,
"user": {
"userId": 1,
"userName": "text",
"email": "text",
"emailVerified": true,
"accountId": 1,
"omsId": 1,
"use2FA": true
}
}
Create Deposit
POST /ap/CreateDepositTicket HTTP/1.1
Host: apstage.proxy.kiiex.io
Content-Type: application/json
Accept: */*
Content-Length: 421
{
"assetManagerId": 1,
"accountId": 1,
"assetId": 1,
"assetName": "text",
"amount": 1,
"omsId": 1,
"requestCode": "text",
"requestIP": "text",
"requestUser": 1,
"requestUserName": "text",
"operatorId": 1,
"Status": 1,
"feeAmt": 1,
"updatedByUser": 1,
"updatedByUserName": "text",
"ticketNumber": 1,
"depositInfo": "text",
"createdTimestamp": "2025-07-09T14:52:32.050Z",
"lastUpdateTimestamp": "2025-07-09T14:52:32.050Z",
"comments": "text",
"attachments": "text"
}
Deposit ticket creation result
{
"success": true,
"requestcode": "text"
}
Get Account Balances
POST /ap/GetAccountPositions HTTP/1.1
Host: apstage.proxy.kiiex.io
Content-Type: application/json
Accept: */*
Content-Length: 47
{
"AccountId": 1,
"OMSId": 1,
"IncludePending": true
}
Account balances
[
{
"omsId": 1,
"accountId": 1,
"productSymbol": "text",
"productId": 1,
"amount": 1,
"hold": 1
}
]
Get Current Rate
POST /ap/GetLevel1SummaryMin HTTP/1.1
Host: apstage.proxy.kiiex.io
Content-Type: application/json
Accept: */*
Content-Length: 79
{
"OMSId": 1,
"BaseCurrency": "text",
"QuoteCurrency": "text",
"InstrumentIds": "text"
}
Market data snapshot
[
[
"text"
]
]
Create a SWAP
POST /ap/SendOrder HTTP/1.1
Host: apstage.proxy.kiiex.io
Content-Type: application/json
Accept: */*
Content-Length: 201
{
"InstrumentId": 1,
"OMSId": 1,
"AccountId": 1,
"TimeInForce": 1,
"ClientOrderId": 1,
"OrderIdOCO": 1,
"UseDisplayQuantity": true,
"Side": 1,
"quantity": 1,
"OrderType": 1,
"PegPriceType": 1,
"LimitPrice": 1,
"PostOnly": true
}
Order status
{
"status": "text",
"errormsg": "text",
"OrderId": 1
}
Get SWAP status
POST /ap/GetOrderStatus HTTP/1.1
Host: apstage.proxy.kiiex.io
Content-Type: application/json
Accept: */*
Content-Length: 37
{
"omsId": 1,
"accountId": 1,
"orderId": 1
}
Order status details
{
"OrderId": 1,
"OrderState": "text",
"QuantityExecuted": 1,
"AvgPrice": 1
}
POST /ap/GetTradesHistory HTTP/1.1
Host: apstage.proxy.kiiex.io
Content-Type: application/json
Accept: */*
Content-Length: 154
{
"omsId": 1,
"accountId": 1,
"instrumentId": 1,
"tradeId": 1,
"orderId": 1,
"userId": 1,
"startTimestamp": 1,
"endTimestamp": 1,
"depth": 1,
"startIndex": 1,
"executionId": 1
}
List of executed trades
[
{
"tradeId": 1,
"orderId": 1,
"quantity": 1,
"price": 1
}
]
Create a Withdrawal
POST /ap/CreateWithdrawTicket HTTP/1.1
Host: apstage.proxy.kiiex.io
Content-Type: application/json
Accept: */*
Content-Length: 104
{
"OMSId": 1,
"AccountId": 1,
"ProductId": 1,
"Amount": 1,
"feeAmount": 1,
"TemplateForm": {},
"TemplateType": "text"
}
Withdrawal request result
{
"result": true,
"errormsg": "text",
"errorcode": 1,
"detail": "text"
}
Check Withdrawal status
POST /ap/GetWithdrawTickets HTTP/1.1
Host: apstage.proxy.kiiex.io
Content-Type: application/json
Accept: */*
Content-Length: 50
{
"OMSId": 1,
"AccountId": 1,
"StartIndex": 1,
"Limit": 1
}
List of withdraw tickets
[
{
"assetManagerId": 1,
"accountId": 1,
"assetId": 1,
"assetName": "text",
"amount": 1,
"templateForm": "text",
"templateFormType": "text",
"omsId": 1,
"requestCode": "text",
"requestIP": "text",
"requestUserId": 1,
"requestUserName": "text",
"operatorId": 1,
"Status": 1,
"feeAmt": 1,
"updatedByUser": 1,
"updatedByUserName": "text",
"ticketNumber": 1,
"createdTimestamp": "2025-07-09T14:52:32.050Z",
"lastUpdateTimestamp": "2025-07-09T14:52:32.050Z",
"Comments": "text",
"Attachments": "text",
"AuditLog": "text"
}
]
Last updated
Was this helpful?