> For the complete documentation index, see [llms.txt](https://api-en.stridecross.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api-en.stridecross.com/stridecross-api/request-quote.md).

# Request quote

**Note**

{% hint style="info" %}
Note: If the value filled in by the user is outside the convertible range, in order to avoid user losses, please remind the user to change the swap value
{% endhint %}

#### Endpoint usage

<mark style="color:green;">`POST`</mark>&#x20;

https\://{host}/api/v1/quotes/create

**The fields with \* are required, and the fields without \* are optional**

**Request Body**

| Name                                               | Type    | Description                                                                                                                                                                                                                    |
| -------------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| equipmentNo<mark style="color:red;">\*</mark>      | String  | Equipment number(This field will be used as the unique identifier of the user, and the third parties can obtain it on their own, such as the first 32 characters of fromAddress, or a string of 32 random numbers and letters) |
| sourceType                                         | String  | Device type (H5/IOS/Android The field is optional, if it is requested directly through the API, it can be empty)                                                                                                               |
| sourceFlag<mark style="color:red;">\*</mark>       | String  | <p><strong>Channel / Source Identifier</strong></p><p>This interface does not require an API Key. Your caller identity will be identified through this parameter. Please ensure it is filled in accurately.</p>                |
| fromTokenAddress<mark style="color:red;">\*</mark> | String  | Contract address for the token to sell (It can be obtained from the address field in the currency list)                                                                                                                        |
| toTokenAddress<mark style="color:red;">\*</mark>   | String  | Contract address for the token to receive (It can be obtained from the address field in the currency list)                                                                                                                     |
| fromTokenAmount<mark style="color:red;">\*</mark>  | String  | Amount of token to sell                                                                                                                                                                                                        |
| fromTokenChain<mark style="color:red;">\*</mark>   | String  | Network of the token to sell (It can be obtained from the chain field in the currency list, For details of the support chain, please refer to \[Basic information])                                                            |
| toTokenChain<mark style="color:red;">\*</mark>     | String  | Network of the token to received (It can be obtained from the chain field in the currency list, For details of the support chain, please refer to \[Basic information])                                                        |
| userAddr                                           | String  | User address                                                                                                                                                                                                                   |
| fixedRateFlag                                      | Integer | Flag to toggle fixed rate mode. 1 = Enable, 0 = Disable. Default: 0                                                                                                                                                            |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
 "resCode":"100",
 "resMsg":"Success",
 "data":{
  "txData":{
   "amountOutMin": "5055580656532273000"// Expected amount received (WEI version)
   "chainFee":"0.02" // Gas fee
   "contractAddress":"0x6b4427caa371627e2a73521a2568fcf1212cd4d9", // Contract Address
   "depositMin": "30", // minimum swap value
   "depositMax": "21738659651027.298142", // maximum swap value
   "dex":"Bridgers1",
   "fee":0.002, // Processing fee ratio 
   "feeToken":"",
   "fromTokenAmount":"47079490000000000000",
   "fromTokenDecimal":18,
   "toTokenAmount":"5.0555806565",  // Expected amount received
   "toTokenDecimal":18,
   "path":["0x55d398326f99059ff775485246999027b3197955","0x6b4427caa371627e2a73521a2568fcf1212cd4d9","0xa71edc38d189767582c38a3145b5873052c3e47a"],
   "logoUrl":"",
  }
 }
}
```

{% endtab %}

{% tab title="500: Internal Server Error " %}

```javascript
{
    // Response
}
```

{% endtab %}
{% endtabs %}

#### Code example

{% tabs %}
{% tab title="JavaScript" %}

```
// quote example
 const params = {
   fromTokenAddress: '0x55d398326f99059ff775485246999027b3197955',
   toTokenAddress: '0xa71edc38d189767582c38a3145b5873052c3e47a',
   fromTokenAmount: '8000000000000000000',
   fromTokenChain: 'BSC',
   toTokenChain: 'HECO',
   userAddr: '0x...', //your wallet address
   equipmentNo:'', // your equipment number
   sourceFlag:'widget',
   sourceType:'H5',
  }
  const res = await axios.post('https://{host}/api/v1/quotes/create',params)
  console.log(res)
```

{% endtab %}
{% endtabs %}

#### Postman example


---

# 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://api-en.stridecross.com/stridecross-api/request-quote.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.
