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.

  1. Create your KIIEX account:

    1. Go to https://kiiex.io/ and click on login, and create your user

      1. You can also follow our guide on Set up your KIIEX Account

  2. Update your account from level 0 to level 1 by following our KYC flow to be able to swap

  3. 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:

  1. Authenticate your user via api

  2. Create a USDT deposit. If you have already created a deposit, check your current balance

  3. Get the current COPM/USDT rate

  4. Create market order (buy COPM)

  5. Verify order was filled

  6. Get trade details (swap info)

  7. Confirm the new COPM balance using the get account positions endpoint

  8. Create a COPM withdrawal, it could be to another wallet or to your bank account

  9. Check your COPM withdrawal status

How do I perform the swap workflow using the API?

API endpoints

Authenticate your User via API

Authenticate user session

post
Body
one ofOptional
Responses
200
Authentication result
application/json
post
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"
}
200

Authentication result

{
  "authenticated": true,
  "user": {
    "userId": 1,
    "userName": "text",
    "email": "text",
    "emailVerified": true,
    "accountId": 1,
    "omsId": 1,
    "use2FA": true
  }
}

Create Deposit

Create a new deposit ticket

post
Body
assetManagerIdintegerOptional
accountIdintegerOptional
assetIdintegerOptional
assetNamestring | nullableOptional
amountnumberOptional
omsIdintegerOptional
requestCodestring | nullableOptional
requestIPstring | nullableOptional
requestUserintegerOptional
requestUserNamestring | nullableOptional
operatorIdintegerOptional
StatusintegerOptional
feeAmtnumberOptional
updatedByUserintegerOptional
updatedByUserNamestring | nullableOptional
ticketNumberintegerOptional
depositInfostring | nullableOptional
createdTimestampstring · date-timeOptional
lastUpdateTimestampstring · date-timeOptional
commentsstring | nullableOptional
attachmentsstring | nullableOptional
Responses
200
Deposit ticket creation result
application/json
post
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"
}
200

Deposit ticket creation result

{
  "success": true,
  "requestcode": "text"
}

Get Account Balances

Get account positions (balances)

post
Body
AccountIdintegerOptional
OMSIdintegerOptional
IncludePendingbooleanOptional
Responses
200
Account balances
application/json
post
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
}
200

Account balances

[
  {
    "omsId": 1,
    "accountId": 1,
    "productSymbol": "text",
    "productId": 1,
    "amount": 1,
    "hold": 1
  }
]

Get Current Rate

Get market snapshot

post
Body
OMSIdintegerOptional
BaseCurrencystringOptional
QuoteCurrencystringOptional
InstrumentIdsstringOptional
Responses
200
Market data snapshot
application/json
post
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"
}
200

Market data snapshot

[
  [
    "text"
  ]
]

Create a SWAP

Create a new order

post
Body
InstrumentIdintegerOptional
OMSIdintegerOptional
AccountIdintegerOptional
TimeInForceintegerOptional
ClientOrderIdintegerOptional
OrderIdOCOintegerOptional
UseDisplayQuantitybooleanOptional
SideintegerOptional
quantitynumberOptional
OrderTypeintegerOptional
PegPriceTypeintegerOptional
LimitPricenumberOptional
PostOnlybooleanOptional
Responses
200
Order status
application/json
post
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
}
200

Order status

{
  "status": "text",
  "errormsg": "text",
  "OrderId": 1
}

Get SWAP status

Get single order status

post
Body
omsIdintegerOptional
accountIdintegerOptional
orderIdintegerOptional
Responses
200
Order status details
application/json
post
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
}
200

Order status details

{
  "OrderId": 1,
  "OrderState": "text",
  "QuantityExecuted": 1,
  "AvgPrice": 1
}

Get trades history

post
Body
omsIdintegerOptional
accountIdintegerOptional
instrumentIdintegerOptional
tradeIdintegerOptional
orderIdintegerOptional
userIdintegerOptional
startTimestampintegerOptional
endTimestampintegerOptional
depthintegerOptional
startIndexintegerOptional
executionIdintegerOptional
Responses
200
List of executed trades
application/json
post
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
}
200

List of executed trades

[
  {
    "tradeId": 1,
    "orderId": 1,
    "quantity": 1,
    "price": 1
  }
]

Create a Withdrawal

Initiates the withdrawal of funds from an account

post
Body
OMSIdintegerOptional
AccountIdintegerOptional
ProductIdintegerOptional
AmountnumberOptional
feeAmountnumberOptional
TemplateFormobjectOptional
TemplateTypestringOptional
Responses
200
Withdrawal request result
application/json
post
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"
}
200

Withdrawal request result

{
  "result": true,
  "errormsg": "text",
  "errorcode": 1,
  "detail": "text"
}

Check Withdrawal status

Returns an array of withdraw tickets from the specified OMS and Account

post
Body
OMSIdintegerOptional
AccountIdintegerOptional
StartIndexintegerOptional
LimitintegerOptional
Responses
200
List of withdraw tickets
application/json
post
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
}
200

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?