### Get User Info and Balances (JSON Response) Source: https://github.com/btcid/indodax-official-api-docs/blob/master/Private-RestAPI.md This is an example JSON response for the 'getInfo' method, which returns server time, user balances, and account details. Note the structure for 'balance', 'balance_hold', and 'address'. ```json { "success": 1, "return": { "server_time": 1578638762, "balance": { "idr": 0, "btc": "0.00000000", ... }, "balance_hold": { "idr": 0, "btc": "0.00000000", ... }, "address": { "btc": "17wGZJCHfi1MJXY9V8NrbSwBYmUM2wXdER", "1inch": "0xaDF5bF5e8fa6966451D6cf43A9dbe3f142695362", "eth": "0xa6fd81330501442e8dff403f966b6e023a53763e" }, "network": { "btc": "mainnet", "1inch": "erc20", "eth": [ "eth", "arb", "op", "base" ] }, "memo_is_required": { "btc": { "mainnet": false }, "1inch": { "erc20": false }, "eth": { "eth": false, "arb": false, "op": false, "base": false } }, "user_id": "00001", "name": "Jhon Doe", "email": "jhonDoe@mail.com", "profile_picture": null, "verification_status": "verified", "gauth_enable": true, "withdraw_status" : 1 // 1 if user can withdraw, 0 if user can't withdraw } } ``` -------------------------------- ### Get Account Balances and Server Time (Linux curl) Source: https://context7.com/btcid/indodax-official-api-docs/llms.txt Example using Linux curl to fetch account balances and server time via the Private REST API. Requires API Key and Secret Key for authentication. ```bash # Linux curl example (HMAC-SHA512 signed) BODY="method=getInfo×tamp=1578304294000&recvWindow=1578303937000" SIGN=$(echo -n "$BODY" | openssl dgst -sha512 -hmac "YOUR_SECRET_KEY" | awk '{print $2}') curl -X POST https://indodax.com/tapi \ -H "Key: YOUR_API_KEY" \ -H "Sign: $SIGN" \ -d "$BODY" # Response: # { # "success": 1, # "return": { # "server_time": 1578638762, # "balance": { "idr": 0, "btc": "0.00000000" }, # "balance_hold": { "idr": 0, "btc": "0.00000000" }, # "address": { "btc": "17wGZJCHfi1MJXY9V8NrbSwBYmUM2wXdER" }, # "user_id": "00001", # "name": "John Doe", # "verification_status": "verified", # "withdraw_status": 1 # } # } ``` -------------------------------- ### Signed POST getInfo Request Example using curl Source: https://github.com/btcid/indodax-official-api-docs/blob/master/Private-RestAPI.md This example demonstrates how to construct and send a signed POST request to the 'getInfo' endpoint using curl. It includes the necessary API key, secret key, method, timestamp, and recvWindow. ```bash curl -X POST "https://indodax.com/tapi" -H "Content-Type: application/x-www-form-urlencoded" -H "Key: AEDHIGAT-QATEGWOX-OPCSCPQX-2E00B1L7-VJBXXKMA" -H "Sign: YOUR_SIGNATURE" -d "method=getInfo×tamp=1578304294000&recvWindow=1578303937000" ``` -------------------------------- ### Execute Signed GET Request with Curl Source: https://github.com/btcid/indodax-official-api-docs/blob/master/INDODAX-TradeAPI-2.md This bash command shows how to make a signed GET request to the /api/v2/myTrades endpoint using curl. It includes the necessary API key and signature in the headers, along with query parameters. ```bash (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×tamp=1578304294000&recvWindow=1578303937000' ``` -------------------------------- ### Get Info Source: https://github.com/btcid/indodax-official-api-docs/blob/master/example/Private-RestAPI-php.md Retrieves general account information. Requires API key and secret. ```APIDOC ## GET INFO ### Description Retrieves general account information. ### Method POST ### Endpoint https://indodax.com/tapi ### Parameters #### Request Body - **method** (string) - Required - 'getInfo' - **timestamp** (string) - Required - Current timestamp - **recvWindow** (string) - Required - Timestamp for receive window ### Request Example ```php 'getInfo', 'timestamp' => '1578304294000', 'recvWindow' => '1578303937000' ]; $post_data = http_build_query($data, '', '&'); $sign = hash_hmac('sha512', $post_data, $secretKey); $headers = ['Key:'.$key,'Sign:'.$sign]; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_HTTPHEADER => $headers, CURLOPT_URL => $url, CURLOPT_POST => true, CURLOPT_POSTFIELDS => $data, CURLOPT_RETURNTRANSFER => true )); $response = curl_exec($curl); curl_close($curl); echo $response; ?> ``` ### Response #### Success Response (200) - **return_value** (object) - Contains account details. - **success** (boolean) - Indicates if the request was successful. ``` -------------------------------- ### Response Done Order Source: https://github.com/btcid/indodax-official-api-docs/blob/master/Private-websocket.md This example shows the response when an order has been completed. The status field will be 'DONE'. ```APIDOC ## Response Done Order ### Description This JSON structure represents the response when an order has been fully executed or completed. The `status` field within the `order` object will be set to `DONE`. ### Response Example ```json { "push": { "channel": "pws:#c12d3ca099785ede15c37c9b7642ab89d19bc96e", "pub": { "data": [ { "eventType": "order_update", "order": { "orderId": "aaveidr-limit-3397", "symbol": "aaveidr", "side": "BUY", "origQty": "0.00996909", "unfilledQty": "0", "executedQty": "0.00996909", "price": "2000000", "description": "AAVE/IDR", "status": "DONE", "transactionTime": 1705635775203, "clientOrderId": "lendidr-limit-3397" } } ] } } } ``` ``` -------------------------------- ### GET /api/summaries Source: https://context7.com/btcid/indodax-official-api-docs/llms.txt Fetches a combined snapshot of 24-hour ticker data, 24-hour opening prices, and 7-day opening prices for all trading pairs. ```APIDOC ## GET /api/summaries - Market Summaries ### Description Returns a combined snapshot of 24h ticker data, 24h opening prices, and 7-day opening prices for all pairs. ### Method GET ### Endpoint /api/summaries ### Request Example ```bash curl https://indodax.com/api/summaries ``` ### Response #### Success Response (200) - **tickers** (object) - Contains 24h ticker data for each pair. - Each pair object includes: `high`, `low`, `vol_btc`, `vol_idr`, `last`, `buy`, `sell`, `server_time`, `name`. - **prices_24h** (object) - Contains the opening price for the last 24 hours for each pair. - **prices_7d** (object) - Contains the opening price for the last 7 days for each pair. #### Response Example ```json { "tickers": { "btc_idr": { "high": "120009000", "low": "116735000", "vol_btc": "218.31103295", "vol_idr": "25831203178", "last": "117136000", "buy": "116938000", "sell": "117136000", "server_time": 1571206340, "name": "Bitcoin" } }, "prices_24h": { "btcidr": "120002000" }, "prices_7d": { "btcidr": "116001000" } } ``` ``` -------------------------------- ### Withdraw Fee Success Response Example Source: https://github.com/btcid/indodax-official-api-docs/blob/master/Private-RestAPI.md This is a successful response for the withdraw fee endpoint. ```json { "success": 1, "return": { "server_time": 1607923272, "withdraw_fee": 0.005, "currency": "eth" } } ``` -------------------------------- ### Open Orders Response Example (Specific Pair) Source: https://github.com/btcid/indodax-official-api-docs/blob/master/Private-RestAPI.md This JSON structure shows the response when a specific trading pair is requested for open orders. ```json { "success": 1, "return": { "orders": [ { "order_id": "172", "client_order_id": "clientx-sj82ks82j", "submit_time": "1693226027", "price": "421004000", "type": "sell", "order_type": "limit", "order_btc": "0.02000000", "remain_btc": "0.00133450" }, { "order_id": "173", "client_order_id": "clientx-sj82ks83j", "submit_time": "1693280465", "price": "421003000.00000000", "type": "buy", "order_type": "stoplimit", "order_idr": "1266293.00000000", "remain_idr": "1266293.00000000" } ] } } } ``` -------------------------------- ### Cancel Order Response Example Source: https://github.com/btcid/indodax-official-api-docs/blob/master/Private-RestAPI.md This is a successful response for the cancel order endpoint. ```json { "success": 1, "return": { "order_id": 666883, "client_order_id": "clientx-sj82ks82j", "type": "sell", "pair": "btc_idr", "balance": { "idr": "33605800", "btc": "0.00000000", ... "frozen_idr": "0", "frozen_btc": "0.00000000", ... } } } ``` -------------------------------- ### Get Info Endpoint Source: https://github.com/btcid/indodax-official-api-docs/blob/master/Private-RestAPI.md This method retrieves user balances and the server's current timestamp. ```APIDOC ## Get Info Endpoint ### Description This method gives user balances and server's timestamp. ### Method POST ### Endpoint `https://indodax.com/tapi` ### Request Body | Name | Type | Mandatory | Description | Value | |-|-|-|-|-| | `method` | string | yes | Specify the method you want to call | `getInfo` | ### Response #### Success Response (200) ```json { "success": 1, "return": { "server_time": 1578638762, "balance": { "idr": 0, "btc": "0.00000000", ... }, "balance_hold": { "idr": 0, "btc": "0.00000000", ... }, "address": { "btc": "17wGZJCHfi1MJXY9V8NrbSwBYmUM2wXdER", "1inch": "0xaDF5bF5e8fa6966451D6cf43A9dbe3f142695362", "eth": "0xa6fd81330501442e8dff403f966b6e023a53763e" }, "network": { "btc": "mainnet", "1inch": "erc20", "eth": [ "eth", "arb", "op", "base" ] }, "memo_is_required": { "btc": { "mainnet": false }, "1inch": { "erc20": false }, "eth": { "eth": false, "arb": false, "op": false, "base": false } }, "user_id": "00001", "name": "Jhon Doe", "email": "jhonDoe@mail.com", "profile_picture": null, "verification_status": "verified", "gauth_enable": true, "withdraw_status" : 1 // 1 if user can withdraw, 0 if user can't withdraw } } ``` ``` -------------------------------- ### Get All Ticker Prices Source: https://github.com/btcid/indodax-official-api-docs/blob/master/Public-RestAPI.md Fetch ticker information for all available trading pairs on the exchange. ```HTTP /api/ticker_all ``` ```JSON { "tickers": { "btc_idr": { "high": "120009000", "low": "116735000", "vol_btc": "218.13777777", "vol_idr": "25800033297", "last": "117088000", "buy": "117002000", "sell": "117078000", "server_time": 1571207881 } } } ``` -------------------------------- ### Trade History Response Example Source: https://github.com/btcid/indodax-official-api-docs/blob/master/Private-RestAPI.md This JSON structure represents the successful response from the `tradeHistory` endpoint, detailing buy and sell transactions. ```json { "success": 1, "return": { "trades": [ { "trade_id": "17393994", "order_id": "59636253", "type": "sell", "btc": "0.00313482", "price": "107202000", "fee": "0", "trade_time": "1578645297", "client_order_id": "clientx-sj82ks82j" }, ... ] } } ``` -------------------------------- ### Orderbook Response Structure Source: https://github.com/btcid/indodax-official-api-docs/blob/master/Marketdata-websocket.md Example response structure for a market orderbook subscription, detailing bid and ask orders, volumes, and prices. ```json { "result": { "channel": "market:order-book-btcidr", "data": { "data": { "pair": "btcidr", "ask": [ { "btc_volume": "0.11035661", "idr_volume": "35251984", "price": "319437000" }, { "btc_volume": "0.20000000", "idr_volume": "63950800", "price": "319754000" } ], "bid": [ { "btc_volume": "0.61427265", "idr_volume": "196220798", "price": "319436000" }, { "btc_volume": "0.00697822", "idr_volume": "2228655", "price": "319373000" } ] }, "offset": 67409 } } } ``` -------------------------------- ### Get Available Trading Pairs - Public REST API Source: https://context7.com/btcid/indodax-official-api-docs/llms.txt Fetches a list of all available trading pairs with their metadata. Includes precision settings and trade limits. ```bash curl https://indodax.com/api/pairs # Response (array): # [ # { # "id": "btcidr", # "symbol": "BTCIDR", # "base_currency": "idr", # "traded_currency": "btc", # "traded_currency_unit": "BTC", # "description": "BTC/IDR", # "ticker_id": "btc_idr", # "volume_precision": 0, # "price_precision": 1000, # "price_round": 8, # "pricescale": 1000, # "trade_min_base_currency": 50000, # "trade_min_traded_currency": 0.0001, # "has_memo": false, # "url_logo": "https://indodax.com/v2/logo/svg/color/btc.svg", # "url_logo_png": "https://indodax.com/v2/logo/png/color/btc.png" # } # ] ``` -------------------------------- ### Transaction History Error: Start Date After End Date Source: https://github.com/btcid/indodax-official-api-docs/blob/master/Private-RestAPI.md This error is returned when the 'start' date is later than the 'end' date. Ensure the start date precedes or is the same as the end date. ```json { "success": 0, "error": "start date must be less then end date", "error_code": "invalid_date" } ``` -------------------------------- ### Get Trading Pair Information Source: https://github.com/btcid/indodax-official-api-docs/blob/master/Public-RestAPI.md This API endpoint provides details about available trading pairs. Use the response to get specific pair IDs for other API calls. ```json { "buy": [ [ 511, "176.61056751" ], [ 510, "100.00000000" ] ], "sell": [ [ 512, "1591.21213341" ], [ 513, "0.88109162" ] ] } ``` -------------------------------- ### Place a Limit Order (Linux curl) Source: https://context7.com/btcid/indodax-official-api-docs/llms.txt Example of placing a limit buy order using Linux curl. Supports specifying amount, price, client order ID, and time in force (GTC or MOC). ```bash # Limit BUY 0.001 BTC at 500,000 IDR with client_order_id BODY="method=trade&nonce=4531235&pair=btc_idr&type=buy&btc=0.001&order_type=limit&price=500000&client_order_id=myorder-001&time_in_force=GTC" SIGN=$(echo -n "$BODY" | openssl dgst -sha512 -hmac "YOUR_SECRET_KEY" | awk '{print $2}') curl -X POST https://indodax.com/tapi \ -H "Key: YOUR_API_KEY" \ -H "Sign: $SIGN" \ -d "$BODY" # Success response: ``` -------------------------------- ### Open Orders Response Example (No Pair Specified) Source: https://github.com/btcid/indodax-official-api-docs/blob/master/Private-RestAPI.md This JSON structure illustrates the response when no specific trading pair is provided for open orders, returning orders grouped by pair. ```json { "success": 1, "return": { "orders": { "btc_idr": [ { "order_id": "172", "client_order_id": "clientx-sj82ks82j", "submit_time": "1693226027", "price": "421004000", "type": "sell", "order_type": "limit", "order_btc": "0.02000000", "remain_btc": "0.00133450" }, { "order_id": "173", "client_order_id": "clientx-sj82ks83j", "submit_time": "1693280465", "price": "421003000.00000000", "type": "buy", "order_type": "stoplimit", "order_idr": "1266293.00000000", "remain_idr": "1266293.00000000" } ] } } } ``` -------------------------------- ### Perform API Request with Curl Source: https://github.com/btcid/indodax-official-api-docs/blob/master/Deadman-switch.md Example of how to make a POST request to the /tapi/countdownCancelAll endpoint using curl. Ensure your API key and generated signature are included in the headers. ```bash #!/bin/bash curl --location -X POST 'https://demo-indodax.com/tapi/countdownCancelAll' \ --header 'Key: LSCE7NJG-JACRNTBX-D834R4UG-KMMTV8OP-PS1NHRBA' \ --header 'Sign: b4f03574d264ffbaa37eadd8460f50dbb9ae6f12d4852a46d8654d472838aaa1de99248e958c904333e61738a00462d49f32bcd3258d8a3defca8c73b8d60d09' \ --header 'Content-Type: text/plain' \ --data 'pair=btc_idr,eth_idr&countdownTime=10000×tamp=1578304294001&recvWindow=1578303937000' ``` -------------------------------- ### GET /api/server_time Source: https://context7.com/btcid/indodax-official-api-docs/llms.txt Retrieves the current UTC timestamp in milliseconds from the exchange server. ```APIDOC ## GET /api/server_time - Server Time ### Description Returns the exchange server's current UTC timestamp in milliseconds. ### Method GET ### Endpoint /api/server_time ### Request Example ```bash curl https://indodax.com/api/server_time ``` ### Response #### Success Response (200) - **timezone** (string) - The timezone of the server. - **server_time** (integer) - The current server time in milliseconds. #### Response Example ```json { "timezone": "UTC", "server_time": 1571205969552 } ``` ``` -------------------------------- ### GET /api/ticker_all Source: https://context7.com/btcid/indodax-official-api-docs/llms.txt Retrieves current ticker data for all active trading pairs on Indodax. ```APIDOC ## GET /api/ticker_all - All Tickers ### Description Returns current ticker data (high, low, last, buy, sell, volume) for every active trading pair in a single request. ### Method GET ### Endpoint /api/ticker_all ### Request Example ```bash curl https://indodax.com/api/ticker_all ``` ### Response #### Success Response (200) - **tickers** (object) - An object where keys are trading pair IDs and values are ticker data objects for each pair. Each ticker object includes: - **high** (string) - The highest price in the last 24 hours. - **low** (string) - The lowest price in the last 24 hours. - **vol_btc** (string) - The volume of the traded currency in BTC in the last 24 hours. - **vol_idr** (string) - The volume in the base currency (IDR) in the last 24 hours. - **last** (string) - The price of the last trade. - **buy** (string) - The current best bid price. - **sell** (string) - The current best ask price. - **server_time** (integer) - The server time when the data was retrieved. #### Response Example ```json { "tickers": { "btc_idr": { "high": "120009000", "low": "116735000", "vol_btc": "218.13777777", "vol_idr": "25800033297", "last": "117088000", "buy": "117002000", "sell": "117078000", "server_time": 1571207881 } } } ``` ``` -------------------------------- ### Get Market Summaries - Public REST API Source: https://context7.com/btcid/indodax-official-api-docs/llms.txt Fetches a snapshot of 24-hour ticker data, opening prices for the last 24 hours, and 7-day opening prices for all pairs. ```bash curl https://indodax.com/api/summaries # Response: # { # "tickers": { # "btc_idr": { # "high": "120009000", # "low": "116735000", # "vol_btc": "218.31103295", # "vol_idr": "25831203178", # "last": "117136000", # "buy": "116938000", # "sell": "117136000", # "server_time": 1571206340, # "name": "Bitcoin" # } # }, # "prices_24h": { "btcidr": "120002000" }, # "prices_7d": { "btcidr": "116001000" } # } ``` -------------------------------- ### GET /api/price_increments Source: https://context7.com/btcid/indodax-official-api-docs/llms.txt Retrieves the minimum price increment (tick size) for each trading pair. ```APIDOC ## GET /api/price_increments - Price Increments ### Description Returns the minimum price increment (tick size) for each trading pair. ### Method GET ### Endpoint /api/price_increments ### Request Example ```bash curl https://indodax.com/api/price_increments ``` ### Response #### Success Response (200) - **increments** (object) - An object where keys are trading pair IDs and values are their minimum price increments as strings. #### Response Example ```json { "increments": { "btc_idr": "1000", "ten_idr": "1", "abyss_idr": "1", "ada_idr": "1" } } ``` ``` -------------------------------- ### GET /api/pairs Source: https://context7.com/btcid/indodax-official-api-docs/llms.txt Fetches a list of all available trading pairs on Indodax, including their metadata. ```APIDOC ## GET /api/pairs - Available Trading Pairs ### Description Returns the full list of trading pairs with metadata including precision settings, minimum trade sizes, and logo URLs. ### Method GET ### Endpoint /api/pairs ### Request Example ```bash curl https://indodax.com/api/pairs ``` ### Response #### Success Response (200) - An array of trading pair objects, each containing: - **id** (string) - Unique identifier for the pair. - **symbol** (string) - Trading pair symbol (e.g., BTCIDR). - **base_currency** (string) - The base currency (e.g., idr). - **traded_currency** (string) - The traded currency (e.g., btc). - **traded_currency_unit** (string) - The unit of the traded currency (e.g., BTC). - **description** (string) - A human-readable description (e.g., BTC/IDR). - **ticker_id** (string) - Identifier used in ticker endpoints. - **volume_precision** (integer) - Precision for volume. - **price_precision** (integer) - Precision for price. - **price_round** (integer) - Rounding for price. - **pricescale** (integer) - Scale for price. - **trade_min_base_currency** (integer) - Minimum trade amount in base currency. - **trade_min_traded_currency** (float) - Minimum trade amount in traded currency. - **has_memo** (boolean) - Whether the pair requires a memo. - **url_logo** (string) - URL for the pair's logo. - **url_logo_png** (string) - URL for the pair's PNG logo. #### Response Example ```json [ { "id": "btcidr", "symbol": "BTCIDR", "base_currency": "idr", "traded_currency": "btc", "traded_currency_unit": "BTC", "description": "BTC/IDR", "ticker_id": "btc_idr", "volume_precision": 0, "price_precision": 1000, "price_round": 8, "pricescale": 1000, "trade_min_base_currency": 50000, "trade_min_traded_currency": 0.0001, "has_memo": false, "url_logo": "https://indodax.com/v2/logo/svg/color/btc.svg", "url_logo_png": "https://indodax.com/v2/logo/png/color/btc.png" } ] ``` ``` -------------------------------- ### Subscribe to Market Summary (24h) Source: https://github.com/btcid/indodax-official-api-docs/blob/master/Marketdata-websocket.md Use this JSON payload to subscribe to the market:summary-24h channel for a quick overview of cryptocurrency market information. The response indicates successful subscription and provides epoch and offset details. ```json { "method": 1, "params": { "channel": "market:summary-24h" }, "id": 2 } ``` ```json { "id": 2, "result": { "recoverable": true, "epoch": "1633995795", "offset": 2820132 } } ``` ```json { "result": { "channel": "market:summary-24h", "data": { "data": [ [ "dogeidr", // pair 1635134109, // epoch timestamp in second 3810, // last price 3480, // lowest price in the last 24h 3980, // highest price in the last 24h 3523, // price at T-24h "112745093944.00000000", // IDR volume in the last 24h (DOGE/IDR) "30241791.15270789" // DOGE volume in the last 24h (DOGE/IDR) ], [ "usdtidr", 1635134410, 14124, 14076, 14130, 14123, "194798674207.00000000", // IDR volume in the last 24h (USDT/IDR) "13798116.12995762" // USDT volume in the last 24h (USDT/IDR) ] ], "offset": 2444948 } } } ``` -------------------------------- ### Get Order Source: https://github.com/btcid/indodax-official-api-docs/blob/master/example/Private-RestAPI-php.md Retrieves details for a specific order using its ID and trading pair. ```APIDOC ## Get Order ### Description Retrieves details for a specific order using its ID and trading pair. ### Method POST ### Endpoint https://indodax.com/tapi ### Parameters #### Request Body - **method** (string) - Required - 'getOrder' - **timestamp** (integer) - Required - Current Unix timestamp in milliseconds. - **recvWindow** (integer) - Required - The difference between the timestamp and the server time. - **pair** (string) - Required - The trading pair (e.g., 'btc_idr'). - **order_id** (string) - Required - The ID of the order to retrieve. ### Request Example ```json { "method": "getOrder", "timestamp": "1578304294000", "recvWindow": "1578303937000", "pair": "btc_idr", "order_id": "59639504" } ``` ### Response #### Success Response (200) - **return_value** (object) - Contains the order details. - **success** (boolean) - Indicates if the request was successful. #### Response Example ```json { "return_value": { "order_id": "59639504", "pair": "btc_idr", "type": "buy", "price": "100000000", "amount": "0.001", "filled": "0", "unfilled": "0.001", "status": "open", "order_time": "1578304294000" }, "success": true } ``` ``` -------------------------------- ### Execute a Trade on Indodax with PHP Source: https://github.com/btcid/indodax-official-api-docs/blob/master/example/Private-RestAPI-php.md This PHP code demonstrates how to place a trade (sell order) on Indodax. Customize 'pair', 'type', 'price', and amount fields as needed. ```php 'trade', 'timestamp' => '1578304294000', 'recvWindow' => '1578303937000', 'pair' => 'btc_idr', 'type' => 'sell', 'price' => '107202000', 'idr' => '', 'btc' => '0.00313482' ]; $post_data = http_build_query($data, '', '&'); $sign = hash_hmac('sha512', $post_data, $secretKey); $headers = ['Key:'.$key,'Sign:'.$sign]; $curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_HTTPHEADER => $headers, CURLOPT_URL => $url, CURLOPT_POST => true, CURLOPT_POSTFIELDS => $data, CURLOPT_RETURNTRANSFER => true )); $response = curl_exec($curl); curl_close($curl); echo $response; ``` -------------------------------- ### Timing Security Logic Source: https://github.com/btcid/indodax-official-api-docs/blob/master/INDODAX-TradeAPI-2.md This bash script illustrates the logic for validating request timing using timestamp and recvWindow against the server time. Requests are rejected if they fall outside the acceptable window. ```bash if (( timestamp >= serverTime + 1000 || serverTime - timestamp > recvWindow )); then # Reject request echo "Request rejected" else # Process request echo "Request processed" fi ``` -------------------------------- ### List Referral Downlines with listDownline Source: https://context7.com/btcid/indodax-official-api-docs/llms.txt Returns a paginated list of users registered under the authenticated user's referral link. Requires the API key to have the necessary permissions. ```bash BODY="method=listDownline×tamp=1578304294000&recvWindow=5000&page=1&limit=10" SIGN=$(echo -n "$BODY" | openssl dgst -sha512 -hmac "YOUR_SECRET_KEY" | awk '{print $2}') curl -X POST https://indodax.com/tapi \ -H "Key: YOUR_API_KEY" \ -H "Sign: $SIGN" \ -d "$BODY" ``` -------------------------------- ### GET /api/trades/$pair_id Source: https://context7.com/btcid/indodax-official-api-docs/llms.txt Retrieves a list of recent public trades for a specified trading pair. ```APIDOC ## GET /api/trades/$pair_id - Recent Trades ### Description Returns the list of recent public trades (date, price, amount, trade ID, and side) for a given pair. ### Method GET ### Endpoint /api/trades/$pair_id ### Parameters #### Path Parameters - **pair_id** (string) - Required - The ID of the trading pair (e.g., `btcidr`). ### Request Example ```bash curl https://indodax.com/api/trades/btcidr ``` ### Response #### Success Response (200) - An array of trade objects, ordered from newest to oldest, each containing: - **date** (string) - The Unix timestamp of the trade. - **price** (string) - The price at which the trade occurred. - **amount** (string) - The amount of the traded currency. - **tid** (string) - The unique trade ID. - **type** (string) - The side of the trade ('buy' or 'sell'). #### Response Example ```json [ { "date": "1571207255", "price": "511", "amount": "123.19523759", "tid": "1623490", "type": "sell" }, { "date": "1571207236", "price": "512", "amount": "121.42187500", "tid": "1623489", "type": "buy" } ] ``` ``` -------------------------------- ### getInfo — Account Balances and Server Time Source: https://context7.com/btcid/indodax-official-api-docs/llms.txt Retrieves comprehensive account information including all asset balances, deposit addresses, network details, user profile, and KYC status. ```APIDOC ### getInfo — Account Balances and Server Time ### Description Returns all asset balances (available and on hold), deposit addresses, network info, user profile, and KYC status. ### Method POST ### Endpoint `/tapi` ### Parameters #### Request Body - **method** (string) - Required - Must be `getInfo`. - **timestamp** (integer) - Required - Current Unix timestamp in milliseconds. - **recvWindow** (integer) - Optional - The window in milliseconds that the server should use to check the timestamp. ### Request Example ```bash BODY="method=getInfo×tamp=1578304294000&recvWindow=1578303937000" SIGN=$(echo -n "$BODY" | openssl dgst -sha512 -hmac "YOUR_SECRET_KEY" | awk '{print $2}') curl -X POST https://indodax.com/tapi \ -H "Key: YOUR_API_KEY" \ -H "Sign: $SIGN" \ -d "$BODY" ``` ### Response #### Success Response (200) - **success** (integer) - Indicates if the request was successful (1 for success, 0 for failure). - **return** (object) - Contains the account information: - **server_time** (integer) - Current server time in Unix epoch seconds. - **balance** (object) - Available asset balances. - **balance_hold** (object) - Asset balances on hold. - **address** (object) - Deposit addresses for assets. - **user_id** (string) - The user's unique ID. - **name** (string) - The user's name. - **verification_status** (string) - KYC verification status. - **withdraw_status** (integer) - Withdrawal status. ### Response Example ```json { "success": 1, "return": { "server_time": 1578638762, "balance": { "idr": 0, "btc": "0.00000000" }, "balance_hold": { "idr": 0, "btc": "0.00000000" }, "address": { "btc": "17wGZJCHfi1MJXY9V8NrbSwBYmUM2wXdER" }, "user_id": "00001", "name": "John Doe", "verification_status": "verified", "withdraw_status": 1 } } ``` ``` -------------------------------- ### Market Summary Source: https://github.com/btcid/indodax-official-api-docs/blob/master/Marketdata-websocket.md Retrieves a concise overview of essential cryptocurrency market information for the last 24 hours. Subscribe to the 'market:summary-24h' channel. ```APIDOC ## Market Summary ### Description Provides a quick overview of essential cryptocurrency market information in one place. Use market:summary-24h as channel. ### Method WebSocket Subscription ### Channel `market:summary-24h` ### Request Example ```json { "method": 1, "params": { "channel": "market:summary-24h" }, "id": 2 } ``` ### Response Example (Subscription Confirmation) ```json { "id": 2, "result": { "recoverable": true, "epoch": "1633995795", "offset": 2820132 } } ``` ### Received Message Example ```json { "result": { "channel": "market:summary-24h", "data": { "data": [ [ "dogeidr", // pair 1635134109, // epoch timestamp in second 3810, // last price 3480, // lowest price in the last 24h 3980, // highest price in the last 24h 3523, // price at T-24h "112745093944.00000000", // IDR volume in the last 24h (DOGE/IDR) "30241791.15270789" // DOGE volume in the last 24h (DOGE/IDR) ], [ "usdtidr", 1635134410, 14124, 14076, 14130, 14123, "194798674207.00000000", // IDR volume in the last 24h (USDT/IDR) "13798116.12995762" // USDT volume in the last 24h (USDT/IDR) ] ], "offset": 2444948 } } } ``` ``` -------------------------------- ### Get Order Details Source: https://github.com/btcid/indodax-official-api-docs/blob/master/Private-RestAPI.md Retrieves specific details for a given order using its Order ID. ```APIDOC ## POST /api/v1/user/getorder ### Description Retrieves specific details for a given order using its Order ID. ### Method POST ### Endpoint /api/v1/user/getorder ### Parameters #### Request Body - **method** (string) - Required - Specify the method you want to call (getOrder) - **pair** (string) - Required - Pair to get the information from (e.g., btc_idr, ltc_btc) - **order_id** (int) - Required - The ID of the order to retrieve ### Request Example ```json { "method": "getOrder", "pair": "btc_idr", "order_id": 59639504 } ``` ### Response #### Success Response (200) - **success** (int) - Indicates if the request was successful (1 for success) - **return** (object) - Contains the order data - **order** (object) - Details of the specific order - **order_id** (string) - Unique identifier for the order - **client_order_id** (string) - Client-defined order identifier - **type** (string) - Type of order (buy or sell) - **price** (string) - Price of the order - **submit_time** (string) - Timestamp when the order was submitted - **finish_time** (string) - Timestamp when the order was finished - **status** (string) - Current status of the order - **order_rp** (string) - Order amount in IDR - **remain_rp** (string) - Remaining amount in IDR - **receive_idr** (string) - Received amount in IDR - **refund_idr** (string) - Refunded amount in IDR (if applicable) #### Response Example ```json { "success": 1, "return": { "order": { "order_id": "59639504", "price": "100207000", "type": "buy", "order_rp": "336058", "remain_rp": "336058", "submit_time": "1578648363", "finish_time": "1578649332", "status": "cancelled", "receive_idr": "336058", "client_order_id": "clientx-sj82ks82j" } } } ``` ``` -------------------------------- ### Subscribe: Order Book (Depth) Source: https://context7.com/btcid/indodax-official-api-docs/llms.txt Subscribe to full order book snapshots, including bid and ask entries with price, BTC volume, and IDR volume. The channel format is `market:order-book-`. ```APIDOC ## Subscribe: Order Book (Depth) Streams full order book snapshots with bid/ask entries including price, BTC volume, and IDR volume. Channel format: `market:order-book-`. ```json { "method": 1, "params": { "channel": "market:order-book-btcidr" }, "id": 4 } // Incoming message: // { // "result": { // "channel": "market:order-book-btcidr", // "data": { // "data": { // "pair": "btcidr", // "ask": [ // { "btc_volume": "0.11035661", "idr_volume": "35251984", "price": "319437000" }, // { "btc_volume": "0.20000000", "idr_volume": "63950800", "price": "319754000" } // ], // "bid": [ // { "btc_volume": "0.61427265", "idr_volume": "196220798", "price": "319436000" } // ] // }, // "offset": 67409 // } // } // } ``` ```