Skip to main content

POST CEX Exchange

Initiates an exchange transaction, including sender and receiver information, transaction status, quoted amounts, and token details. This information is useful for tracking and managing token exchange.

Endpoint

POST /exchange
Request Body: A JSON object containing Exchange details.
The ip, userAgent, and timezone fields are mandatory for compliance purposes.

Request Fields

FieldTypeRequiredDescription
amountnumberYesAmount to be exchanged (example: 1)
fromstringYesSymbol of the input token (example: ETH)
tostringYesSymbol of the output token (example: BNB)
addressTostringYesDestination address
anonymousbooleanYesIndicates if the transaction is anonymous (example: false)
ipstringYesUser IP address. Used for fraud prevention only
userAgentstringYesUser userAgent browser string
timezonestringYesUser browser timezone (example: UTC)
receiverTagstringNoOptional receiver tag (example: 123)
walletIdstringNoUser’s wallet identifier
useXmrstringNoUse XMR if true, or use another token for the anonymous transaction if false

Example Request

POST /exchange
Content-Type: application/json

{
  "amount": 1,
  "from": "ETH",
  "to": "BNB",
  "receiverTag": "",
  "addressTo": "0x000000000000000000000000000000000000dead",
  "anonymous": false,
  "ip": "0.0.0.0",
  "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64)",
  "timezone": "UTC",
  "useXmr": false
}

Example Response

{
  "houdiniId": "mNev2KrGikabTvge75GMwM",
  "created": "2025-02-21T15:32:53.821Z",
  "senderAddress": "0xabb5ac5c686d1614172ac1292519e78ad6c520f5",
  "receiverAddress": "0x000000000000000000000000000000000000dead",
  "anonymous": false,
  "expires": "2025-02-21T16:02:53.821Z",
  "status": 0,
  "inAmount": 1,
  "inSymbol": "ETH",
  "outAmount": 4.189816,
  "outSymbol": "BNB",
  "senderTag": "",
  "receiverTag": "",
  "notified": false,
  "eta": 5,
  "inAmountUsd": 2802.42,
  "inCreated": "2025-02-21T15:32:53.822Z",
  "quote": {
    "amountIn": 1,
    "amountOut": 4.189816,
    "min": 0.001,
    "max": 17.841,
    "path": "ff"
  },
  "outToken": {
    "id": "USDT",
    "name": "Tether",
    "symbol": "USDT",
    "network": {
      "name": "Ethereum Mainnet",
      "shortName": "ETH",
      "addressValidation": "^(0x)[0-9A-Fa-f]{40}$",
      "memoNeeded": false,
      "explorerUrl": "https://etherscan.io/tx/",
      "addressUrl": "https://etherscan.io/address/",
      "priority": 1,
      "kind": "evm",
      "chainId": 1
    },
    "color": "#26a17b",
    "keyword": "usdt usdterc20 tether usdteth erc-20 erc20 eth",
    "displayName": "USDT (ETHEREUM)",
    "chain": 1,
    "address": "0xdac17f958d2ee523a2206206994597c13d831ec7",
    "hasMarkup": true,
    "networkPriority": 2,
    "icon": "https://...",
    "hasFixed": true,
    "hasFixedReverse": true
  },
  "inToken": {
    "id": "BNB",
    "name": "BNB",
    "symbol": "BNB",
    "network": {
      "name": "Binance Smart Chain",
      "shortName": "BSC",
      "addressValidation": "^(0x)[0-9A-Za-z]{40}$",
      "memoNeeded": false,
      "explorerUrl": "https://bscscan.com/tx/",
      "addressUrl": "https://bscscan.com/address/",
      "priority": 6,
      "kind": "evm",
      "chainId": 56,
      "icon": "http://127.0.0.1:3000/assets/networks/BSC.png"
    },
    "color": "#FFFFFF",
    "keyword": "BNB BNB Binance Smart Chain evm BNB BNB bsc Binance Smart Chain",
    "displayName": "BNB (BSC)",
    "chain": 56,
    "networkPriority": 1,
    "icon": "http://127.0.0.1:3000/assets/tokens/BNB-BSC.png",
    "hasFixed": false,
    "hasFixedReverse": false
  }
}

Response Fields

FieldTypeDescription
houdiniIdstringUnique identifier for the exchange transaction
createdstringTimestamp of when the transaction was created
senderAddressstringAddress to send funds to
receiverAddressstringAddress of the receiver
anonymousbooleanIndicates if the transaction is anonymous
expiresstringExpiration timestamp of the transaction
statusnumberStatus code of the transaction
inAmountnumberAmount sent in the exchange
outAmountnumberAmount received in the exchange
inSymbolstringSymbol of the input token
outSymbolstringSymbol of the output token
senderTagstring(Optional) Sender tag
receiverTagstring(Optional) Receiver tag
notifiedbooleanIndicates if the user has been notified
etanumberEstimated time of arrival (in minutes)
inAmountUsdnumberInput amount converted to USD
inCreatedstringTimestamp when the input was created
quoteobjectDetails of the exchange quote (amounts, min/max limits, path). See QuoteDTO
outTokenobjectDetails of the output token. See TokenDTO
inTokenobjectDetails of the input token. See TokenDTO
After receiving the response, send the exact inAmount of the inSymbol token to the senderAddress to initiate the swap.