> For the complete documentation index, see [llms.txt](https://docs-tron.tronify.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-tron.tronify.io/flash-unstake-api/create-order.md).

# 创建订单

### 接口调用

<mark style="color:green;">`POST`</mark> `https://open.tronify.io/api/tronRent/flashUnstakeOrder`&#x20;

**以下参数带\*字段为必填，不带\*号为选填**

#### Request Body

| Name                                             | Type   | Description              |
| ------------------------------------------------ | ------ | ------------------------ |
| fromAddress<mark style="color:red;">\*</mark>    | String | 用户地址（钱包地址）               |
| receiveAddress<mark style="color:red;">\*</mark> | String | 收款地址                     |
| sourceFlag<mark style="color:red;">\*</mark>     | String | 渠道来源（需要双方约定一个名称来代表三方的渠道） |
| signedMsg<mark style="color:red;">\*</mark>      | String | 钱包签名                     |
| connectWalletType                                | String | 钱包类型                     |

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

```javascript
{
    "resCode": 100,
    "resMsg": "Success",
    "data": {
        "orderId": "pjfkl0fb_ghkd_maqo_5u0r_2uewb420u2hk",
        "fromAddress": "TK54WodHVAHFoep8huDh9g9nRwXqXm5SJC",
        "receiveAddress": "TX5dfXNzBv6a9FiaRgK5rCJYzKuKpNzcHc",
        "stakingSun": "70000000",
        "unstakingSun": "0",
        "balanceSun": "111002968",
        "hasDelegatedEnergy": false,
        "hasDelegatedBandwidth": false,
        "heldTokens": [],
        "unstakeLimitMin": 10,
        "unstakeLimitMax": 100000,
        "feeRate": 0.05,
        "orderStatus": "wait_flash_unstake_approve",  
        "approveTransaction": {
            "raw_data": {
                "ref_block_bytes": "0022",
                "ref_block_hash": "55bcxxxxxx",
                "expiration": 1792555746000,
                "contract": [
                    {
                        "parameter": {
                            "value": {
                                "owner_address": "4163dxxxxxxxxxxxxxxxxxxxxxxxx",
                                "owner": {
                                    "permission_name": "owner",
                                    "threshold": 1,
                                    "keys": [
                                        {
                                            "address": "41b2xxxx922b6xxxxxxxxxxxxxx",
                                            "weight": 1
                                        }
                                    ]
                                },
                                "actives": [
                                    {
                                        "type": "Active",
                                        "id": 2,
                                        "permission_name": "tronify-active",
                                        "threshold": 1,
                                        "operations": "7ffxxxxf1fcxxxxxxxxxxxxxxxxxxxxxxx",
                                        "keys": [
                                            {
                                                "address": "41b29xxxxxxxxxxxxxxxxxxxxxx",
                                                "weight": 1
                                            }
                                        ]
                                    }
                                ]
                            },
                            "type_url": "type.googleapis.com/protocol.AccountPermissionUpdateContract"
                        },
                        "type": "AccountPermissionUpdateContract"
                    }
                ],
                "timestamp": 1792555086833
            },
            "raw_data_hex": "0a02xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
            "txID": "4b32xxxxxxxxxxxxxxxxxxxxxxxxxxx51",
            "visible": false
        }
    }
}
 
```

{% endtab %}

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

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

{% endtab %}
{% endtabs %}

### 调用示例

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

```javascript
// example
const params = {
   "fromAddress": "TK54WodHVAHFoep8huDh9g9nRwXqXm5SJC",
    "receiveAddress": "TX5dfXNzBv6a9FiaRgK5rCJYzKuKpNzcHc",
    "sourceFlag": "tronify",
    "connectWalletType": "TronLink",
    "invitationCode": "",
    "utmSource": "",
    "signedMsg": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
const res = await axios.post('https://open.tronify.io/api/tronRent/flashUnstakeOrder',params)
console.log(res)
if(res.resCode === '100'){
   //... 
}
```

{% endtab %}
{% endtabs %}

### Postman 示例

<figure><img src="https://437826888-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F4K3XSHX743UkF46Owwyj%2Fuploads%2F7Nq4alTuPfD00QxcZgGL%2Fimage.png?alt=media&amp;token=f067cf6a-73f9-410c-8939-6c09ab1f694b" alt=""><figcaption></figcaption></figure>
