> For the complete documentation index, see [llms.txt](https://docs.arcflow.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.arcflow.pro/cross-platform-aggregator-api/swap.md).

# Swap

#### Request Url: /api/commonSwap

**API Base Url:** [**api.arcflow.pro**](https://api.arcflow.pro)

#### Request Method: POST

#### Request Parameters:

<table><thead><tr><th width="218">Field Name</th><th>Field Description</th><th width="165">Type</th><th>Required or not</th><th>Notes</th></tr></thead><tbody><tr><td>equipmentNo</td><td>Device number</td><td>string</td><td>Y</td><td></td></tr><tr><td>fromTokenAddress</td><td>Original token contract address </td><td>string</td><td>Y</td><td></td></tr><tr><td>toTokenAddress</td><td>Target token contract address</td><td>string</td><td>Y</td><td></td></tr><tr><td>fromAddress</td><td>Sender address</td><td>string</td><td>Y</td><td></td></tr><tr><td>toAddress</td><td>Recerver address</td><td>string</td><td>Y</td><td></td></tr><tr><td>amountOutMin</td><td>Min receiving amount</td><td>string</td><td>Y</td><td></td></tr><tr><td>routerPath</td><td>Swap route(multiQuote output param path), if no specific route, can set as null </td><td>array</td><td>Y</td><td>plarform like o3, and similar to uniswap must upload</td></tr><tr><td>amounts</td><td>Min amount receiving from all routes, if no specific route, can set as null </td><td>array</td><td>N</td><td>o3 must upload</td></tr><tr><td>dex</td><td>Swap platform name</td><td>string</td><td>Y</td><td>Use to distinguish usage channel</td></tr><tr><td>fromTokenChain</td><td>Oiginal chain</td><td>string</td><td>Y</td><td></td></tr><tr><td>toTokenChain</td><td>Target chain</td><td>string</td><td>Y</td><td></td></tr><tr><td>fromTokenAmount</td><td>Original token amount</td><td>string</td><td>Y</td><td></td></tr><tr><td>slippage</td><td>Slippage</td><td>decimal</td><td>Y</td><td></td></tr><tr><td>source</td><td>Unique ID of the channel</td><td>string</td><td>Y</td><td></td></tr><tr><td><p></p><p>isNoGas</p></td><td>Only the SWFT channel will valid, with the function of whether gas free or not</td><td>boolean</td><td>N</td><td></td></tr><tr><td>midTokenCode</td><td>Only the Glue channel will valid</td><td>string</td><td>N</td><td></td></tr></tbody></table>

#### Response parameter:

<table><thead><tr><th>Field Name</th><th width="249.33333333333331">Field Description</th><th>Type</th></tr></thead><tbody><tr><td>from</td><td>Call the contract request address</td><td>string</td></tr><tr><td>to</td><td>Called contract address</td><td>string</td></tr><tr><td>value</td><td>Call incoming amount</td><td>string</td></tr><tr><td>gas</td><td>Gas Limit</td><td>integer</td></tr><tr><td>gasPrice</td><td>Gas fee</td><td>string</td></tr><tr><td>data</td><td>Contract call data</td><td>string</td></tr><tr><td>noGasTxInfo</td><td>Only the SWFT channel, with the function of whether gas free or not</td><td>string</td></tr><tr><td>transferData</td><td>swap info</td><td>object</td></tr><tr><td>approveAddress</td><td>The Bridgers, Aggregator,Glue,CrossChainX channel will display, approve coin address</td><td>string</td></tr><tr><td>toType</td><td>Deposit coin type,0 (common address, no call data);1 (common address,have call data);2(contract address,have call data )</td><td>string</td></tr><tr><td>platformAddr</td><td>Only the SWFT channel,deposit address</td><td>string</td></tr></tbody></table>

#### Request example:&#x20;

```
{
    "equipmentNo": "0x76336d2903e8f6d62cc3f5d0528310",
    "fromTokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
    "toTokenAddress": "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
    "fromAddress": "0x76336d2903e8f6d62cc3f5d05283108e3d2785e0",
    "toAddress": "0x76336d2903e8f6d62cc3f5d05283108e3d2785e0",
    "amountOutMin": "30427649999999997",
    "routerPath": [
        "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
        "0xbb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c",
        100
    ],
    "amounts": [],
    "dex": "Aggregator",
    "fromTokenChain": "BSC",
    "toTokenChain": "BSC",
    "fromTokenAmount": "30735000000000000",
    "slippage": 1,
    "source": "path"
}
```

#### Response example:&#x20;

```
{
    "resCode": "100",
    "resMsg": "Success",
    "data": {
        "txData": {
        "data": "0xa9059cbb000000000000000000000000e071f953ad560a509632b1f4b8a33d2c4d1d29fd000000000000000000000000000000000000000000000000d02ab486cedc0000",
        "orderId": "89d3e07a-de18-4d50-99c2-651222b81212",
        "swftCoinFeeRate": "0.001",
        "xrpInfo": null,
        "depositCoinAmt": "15",
        "isDiscount": "N",
        "orderState": "wait_deposits",
        "developerId": "",
        "depositCoinCode": "USDT(BSC)",
        "kycUrl": "",
        "dealFinishTime": null,
        "chainFee": "0.001799",
        "depositCoinFeeAmt": "0.045",
        "refundDepositTxid": "",
        "depositFeeRate": "0.003",
        "fromAddress": "0xf5a4170c83d9267b9344eb284d3fc31329e72843",
        "refundSwftAmt": "",
        "depositTxid": "",
        "receiveCoinCode": "BNB(BSC)",
        "value": "0x0",
        "receiveCoinAmt": "0.048217",
        "swftCoinState": "",
        "swftRefundAddr": "",
        "detailState": "wait_deposit_send",
        "burnRate": "0",
        "changeType": "advanced",
        "depositCoinFeeRate": "0.003",
        "transactionId": "",
        "refundAddr": "0xf5a4170c83d9267b9344eb284d3fc31329e72843",
        "createTime": "2024-01-08 17:13:54",
        "choiseFeeType": "3",
        "destinationAddr": "0xF5a4170C83D9267B9344eb284D3fC31329e72843",
        "platformAddr": "0xe071f953ad560a509632b1f4b8a33d2c4d1d29fd",
        "to": "0x55d398326f99059ff775485246999027b3197955",
        "instantRate": "0.003334454849",
        "refundCoinMinerFee": "",
        "refundCoinAmt": "",
        "receiveSwftAmt": "7.49",
        "depositCoinState": "wait_send",
        "swftReceiveAddr": "",
        "toType": "1",
        "noGasTxInfo": "{\"gasLimit\":37920,\"data\":\"0xxxxx\",\"chainId\":56,\"to\":\"0xxxxx\",\"nonce\":51,\"gasPrice\":\"3150000000\"}"
        }
    }
}
```

Other example:

```
{
    "resCode": "100",
    "resMsg": "Success",
    "data": {
        "txData": {
            "from": "0x76336d2903e8f6d62cc3f5d05283108e3d2785e0",
            "to": "0x11111112542d85b3ef69ae05771c2dccff4faa26",
            "value": "0x6d3151d52bf000",
            "gas": 0,
            "gasPrice": "15000000000",
            "approveAddress": "",
            "toType": "2",
            "data": "0x7c025200000000000000000000000000baf9a5d4b0052359326a6cdab54babaa3a3a964300000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000180000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c000000000000000000000000baf9a5d4b0052359326a6cdab54babaa3a3a964300000000000000000000000076336d2903e8f6d62cc3f5d05283108e3d2785e0000000000000000000000000000000000000000000000000006d3151d52bf000000000000000000000000000000000000000000000000000006bfe1cd8548f8000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003a00000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000024000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000064d1660f99000000000000000000000000eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee000000000000000000000000a0102b2abb03234204dacba824c027f45aa6ccd700000000000000000000000000000000000000000000000000001bf40cc1d60000000000000000000000000000000000000000000000000000000000800000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006d155dc86a1a0000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000004d0e30db00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000064d1660f99000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c00000000000000000000000076336d2903e8f6d62cc3f5d05283108e3d2785e0000000000000000000000000000000000000000000000000006d155dc86a1a0000000000000000000000000000000000000000000000000000000000cfee7c08"
        }
    }
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.arcflow.pro/cross-platform-aggregator-api/swap.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
