INDODAX-TradeAPI-2.md

April 14, 2026 · View on GitHub

Table of Contents

Overview

Previously, orderHistory and tradeHistory parameter methods were accessed through the single base endpoint /tapi.

As of Jan 20, 2026 these endpoints now have dedicated REST endpoints for improved stability and performance as follows:

EndpointPurpose
GET /api/v2/order/historiesTo retrieve the account Order History
GET /api/v2/myTradesTo retrieve the account Trade History

🔑 Key Improvements

  • Dedicated endpoints for Order History and Trade History to improve Trade API (TAPI) stability.

  • Improved Trade ID consistency between the Private WebSocket (PWS) and REST API.

  • Simplified and standardized parameters for better clarity and usability.

  • Updated default values and limits to enhance overall reliability.

    ℹ️ Important Information

    • Users of the old /tapi endpoint must migrate to these new endpoints for Order & Trade History queries.
    • The old endpoint will continue to function for historical trades and orders, but is scheduled for decommission on April 7th, 2026.

General API Information

  • The base endpoint is:
  • All endpoints return JSON objects or arrays
  • Data results are sorted in descending ordernewest first, oldest last
  • All timestamps and time-related fields are in milliseconds (ms)

Request Header

KeyTypeMandatoryValue
AcceptstringyesMust be application/json
Content-TypestringyesMust be application/json
X-APIKEYstringyesUser’s API key
SignstringyesSIGNED endpoint (must be HMAC-SHA512 encrypted using secret key on query string)

e.g., ?param=value&param1=value1

Response Body

KeyTypeValue
dataJSONResponse data
codeintError code
errorstringError message

Error Codes

  • Any endpoint can return an ERROR

Sample Error Response:

{
    "code": 1109,
    "error": "Invalid Symbol"
}

Trade API Error Codes

Error codes are grouped by category:

1. General Server / Network Issues (10xx)

HTTP StatusCodeError Description
503 Internal Server Error1000Internal error
Unable to process your request. Please try again.
401 Unauthorized1001Invalid credentials. API not found or session expired. Please generate a new key.
400 Bad Request1002Invalid timestamp.
Timestamp outside recvWindow.
400 Bad Request1003Invalid nonce.
Nonce must be greater than last_nonce.

2. Request Issues (11xx)

HTTP StatusCodeError Description
400 Bad Request1101Sign not found in header.
400 Bad Request1102API key not found in header.
403 Forbidden1103Trade API is disabled.
403 Forbidden1104Account locked.
403 Forbidden1105Account disabled.
403 Forbidden1106No permission.
400 Bad Request1107Request header fields too large.
400 Bad Request1108Mandatory parameter not sent, empty/null, or malformed.
e.g.,Mandatory parameter '%s' was not sent Param '%s' or '%s' must be sent
400 Bad Request1109Invalid parameter value.
400 Bad Request1110Invalid symbol.
405 Method Not Allowed1111Method not allowed.
404 Not Found1112Order not found.
404 Not Found1113The requested resource does not exist.

General Information on Endpoints

  • Parameters must be sent as query strings
  • Each request must include a nonce or timestamp parameter to be valid

Request Parameters

ParameterMandatoryDescriptionValue
noncenoAn increment integer (learn more about nonce).Must be greater than the nonce of the last request.

e.g., if the last request's nonce is 1000, the next request should be 1001 or greater.
ParameterMandatoryDescriptionValue
timestampnoMillisecond timestamp when the request was generated.Timestamp in milliseconds (ms) when the request was created and sent.
recvWindownoValidity window for request in milliseconds (ms).Default: 5000 ms

The value should specify the number of milliseconds after the timestamp where your request is valid.

e.g., your request is still valid if it is sent and processed within the timestamp and the timestamp + recvWindow.

Endpoint Security Type

API Key Usage

  • API-keys are passed into the Rest API via the X-APIKEY header.
  • API-keys and secret-keys are case sensitive.

Signed (TRADE and USER_DATA) Endpoint Security

  • SIGNED endpoints require an additional signature parameter sent in the query string or request body.
  • The signature must be sent to the REST API in the Sign header.
  • The signature value itself is not case sensitive
  • totalParams is defined as the query string concatenated with the request body. e.g., *(?param=val&param1=val1) encrypted with method HMAC-SHA512 using secret key*

Timing Security

  • A SIGNED endpoint also requires a timestamp parameter defined as the millisecond timestamp at which the request was created and sent.
  • An optional recvWindow parameter may be sent to specify the validity duration (in milliseconds) of the request after the timestamp. If recvWindow is not provided, it defaults to 5000 ms.
  • The logic is as follows:
    if (( timestamp >= serverTime + 1000 || serverTime - timestamp > recvWindow )); then
        # Reject request
        echo "Request rejected"
    else
        # Process request
        echo "Request processed"
    fi
    

    ℹ️ Notes:

    Serious trading is about timing. Networks can be unstable and unreliable, which can lead to requests taking varying amounts of time to reach the servers.

    With recvWindow parameter, user can specify that the request must be processed within a certain number of milliseconds or be rejected by the server.

SIGNED Endpoint Examples for GET /api/v2/myTrades

Step-by-step example on how to send a valid signed payload from the Linux command line using curl:

KeyValue
apiKeyAEDHIGAT-QATEGWOX-OPCSCPQX-2E00B1L7-VJBXXKMA
secretKeyf60617a68fcce028f0a90bc9eb765d17379eb548cc935c01a7ee3186eecf870e9b68f27a31bcfe8d
ParameterValue
symbolbtcidr
limit100
timestamp1578304294000
recvWindow1578303937000

Example:

  • Send parameter using query string
    • queryString: symbol=btcidr&limit=100&timestamp=1578304294000&recvWindow=1578303937000
    • HMAC SHA512 signature:
      [linux]$ echo -n "symbol=btcidr&limit=100&timestamp=1578304294000&recvWindow=1578303937000" | openssl dgst -sha512 -hmac "f60617a68fcce028f0a90bc9eb765d17379eb548cc935c01a7ee3186eecf870e9b68f27a31bcfe8d"
      (stdin)= bab004e5a518740d7a33b38b44dbebecd3fb39f40b42391af39fcce06edabff5233b3e8064a07c528d1c751a6923d5116026c7786e01b22e2d35277a098cae99
      
    • curl command:
      (HMAC SHA512)
      [linux]$ curl -H "X-APIKEY: AEDHIGAT-QATEGWOX-OPCSCPQX-2E00B1L7-VJBXXKMA" -H "Sign: bab004e5a518740d7a33b38b44dbebecd3fb39f40b42391af39fcce06edabff5233b3e8064a07c528d1c751a6923d5116026c7786e01b22e2d35277a098cae99" -X GET 'https://tapi.btcapi.net/api/v2/myTrades?symbol=btcidr&limit=100&timestamp=1578304294000&recvWindow=1578303937000'
      

Order History

GET /api/v2/order/histories

Description

This REST endpoint serves to retrieve an account’s order history for a specific trading pair symbol by returning all orders placed by the account within the specified timeframe. Each order history contains:

  • orderId and clientOrderId
  • Trading pair symbol
  • Order price and side of the order
  • Original and executed quantities
  • Order type and status (FILLED, CANCELLED, REJECTED)
  • Timestamps for submission and completion

Parameters

NameMandatoryDescriptionValueDefault
symbolyesTrading pair symbole.g., btcidr, ethidr, etc
startTimenoStart of query range (Timestamp)Unix in milliseconds (UTC)

e.g., 1723442692520
Last 24 hours
endTimenoEnd of query range (Timestamp)Unix in milliseconds (UTC)

e.g., 1723442692520
Last 24 hours
limitnoNumber of orders to be returned for displayAllowed range: min. 10, max. 1000100
sortnoSorting order for returned dataasc or descdesc

ℹ️ Notes

  1. Default Range: If startTime and endTime are not set, the date range defaults to the last 24 hours.

  2. Maximum Range: The interval between startTime and endTime cannot exceed 7 days.

  3. Supported Parameter Combinations:

    • symbol
    • symbol + startTime
    • symbol + endTime
    • symbol + startTime + endTime

Sample Response Body

{
  "data": [
    {
      "orderId": "aaveidr-limit-3568",
      "clientOrderId": "clientx-2",
      "symbol": "aaveidr",
      "side": "SELL",
      "type": "LIMIT",
      "status": "FILLED",
      "price": "1564455",
      "oriQty": "0.1",
      "executedQty": "0.1",
      "submitTime": 1723442692520,
      "finishTime": 1723442692520
    }
  ]
}

Response Description

FieldDescription
orderIdUnique identifier for the order.
clientOrderIdClient-specified ID for the order.
symbolTrading pair symbol (e.g., aaveidr).
sideSide of the order: BUY or SELL.
typeType of the order: LIMIT or MARKET.
statusCurrent status of the order: FILLED, CANCELLED, or REJECTED.
priceOrder price per unit of the base asset: IDR or USDT.
oriQtyOriginal quantity specified in the order.
executedQtyExecuted quantity of the order
submitTimeTimestamp when the order was submitted (milliseconds since epoch).
finishTimeTimestamp when the order was completed (milliseconds since epoch).

Trade History

GET /api/v2/myTrades

Description

This REST endpoint serves to retrieve an account’s trade execution history for a specific trading pair symbol by returning each trade fill executed from orders placed by the account. Each trade history includes:

  • tradeId, orderId, and clientOrderId
  • Trading pair symbol
  • Order price and quantities (qty, quoteQty)
  • Fee + tax commission and asset used
  • Trade role (isBuyer, isMaker)
  • Timestamp of trade execution

Parameters

NameMandatoryDescriptionValueDefault
symbolyesTrading pair symbole.g., btcidr, ethidr, etc
orderIdnoFilter trades by orderId; must be used with symbole.g., aaveidr-limit-3568
clientOrderIdnoFilter trades by clientOrderId; must be used with symbole.g., clientx-1
startTimenoStart of query range (Timestamp)Unix in milliseconds (UTC)

e.g., 1723442692520
Last 24 hours
endTimenoEnd of query range (Timestamp)Unix in milliseconds (UTC)

e.g., 1723442692520
Last 24 hours
limitnoNumber of orders to be returned for displayAllowed range: min. 10, max. 1000500
sortnoSorting order for returned dataasc or descdesc

ℹ️ Notes

  1. Default Range: If startTime and endTime are not set, the date range defaults to the last 24 hours.

  2. Maximum Range: The interval between startTime and endTime cannot exceed 7 days.

  3. Supported Parameter Combinations:

    • symbol
    • symbol + orderId
    • symbol + clientOrderId
    • symbol + startTime
    • symbol + endTime
    • symbol + startTime + endTime
  4. Removed Old Params: Query parameters from_id and end_id have been removed as trade history now uses timestamp parameters (startTime, endTime).

Sample Response Body

{
  "data": [
    {
      "tradeId": "72057594037936570",
      "orderId": "aaveidr-limit-3568",
      "clientOrderId": "clientx-1",
      "symbol": "aaveidr",
      "price": "1564455",
      "qty": "0.1",
      "quoteQty": "156445",
      "commission": "468",
      "commissionAsset": "idr",
      "isBuyer": false,
      "isMaker": false,
      "time": 1723442692520
    }
  ]
}

Response Description

FieldDescription
tradeIdUnique identifier for the trade.
orderIdUnique identifier for the order.
clientOrderIdClient-specified ID for the order.
symbolTrading pair symbol (e.g., aaveidr).
priceOrder price per unit of the base asset: IDR or USDT.
qtyBase asset quantity executed in this trade (e.g., btcidr, qty is btc).
quoteQtyTotal trade value in the quote asset: IDR or USDT (e.g., btcusdt, quoteQty is USDT), calculated as qty × price.
commissionTotal fees paid for the trade (incl. trading fees and any applicable taxes).
commissionAssetAsset used to pay the commission: IDR or USDT.
isBuyertrue if the account is the Buyer side in this trade; otherwise false.
isMakertrue if the account is the Maker in this trade; otherwise false.
timeTimestamp when the trade was executed (milliseconds since epoch).