> For the complete documentation index, see [llms.txt](https://docs.tronsave.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tronsave.io/chinese/developers/api-reference/extend-orders.md).

# 延长订单

v2 延长接口让你可以延长已持有的订单，而无需重新下单。相比早期的延长功能，第 2 版新增了两项改进：

* 支持通过**签名交易**延长，而不仅限于 API 密钥。
* 新增资源类型：**带宽**（在**能量**之外）。

延长是一个两步流程：先查询订单上哪些代理可以延长，然后为你想延长的代理提交延长请求。

## 两步流程

| 步骤 | 作用             | 页面                                                                                      |
| -- | -------------- | --------------------------------------------------------------------------------------- |
| 1  | 列出订单上符合延长条件的代理 | [获取可延长的代理](/chinese/developers/api-reference/extend-orders/get-extendable-delegates.md) |
| 2  | 提交延长并支付        | [提交延长请求](/chinese/developers/api-reference/extend-orders/extend-request.md)             |

### 步骤 1：获取可延长的代理

查询某个订单，了解哪些代理（委托）仍可延长以及可延长多久。使用查询结果来构建步骤 2 的请求负载。

→ [获取可延长的代理](/chinese/developers/api-reference/extend-orders/get-extendable-delegates.md)

### 步骤 2：提交延长请求

为选定的代理发送延长请求。支持两种支付方式：

* **方式一 —— 使用 API 密钥延长：** 在已预充值的内部账户上使用 TronSave API 密钥授权延长；无需对每笔订单进行链上签名。
* **方式二 —— 使用签名交易延长：** 用你自己的私钥对延长进行签名并在链上结算。

→ [提交延长请求](/chinese/developers/api-reference/extend-orders/extend-request.md)

## 接口端点

延长流程使用两个 `POST` 端点：

| 步骤       | 方法     | 路径                             |
| -------- | ------ | ------------------------------ |
| 获取可延长的代理 | `POST` | `/v2/get-extendable-delegates` |
| 提交延长请求   | `POST` | `/v2/extend-request`           |

{% hint style="info" %}
延长流程的 Postman 集合可在 [postman.com/tronsave/tronsave](https://www.postman.com/tronsave/tronsave/folder/01yhu2j/extend-order) 获取。
{% endhint %}

## 在 TRON Nile 测试网上测试

使用开发主机针对 Nile（测试网）进行测试：

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

* 获取可延长的代理：`POST` `https://api-dev.tronsave.io/v2/get-extendable-delegates`
* 提交延长请求：`POST` `https://api-dev.tronsave.io/v2/extend-request`
  {% endtab %}
  {% endtabs %}

要从网站接入 Nile（测试网），请将主机替换为 <https://testnet.tronsave.io/>，并按照[获取 API 密钥](/chinese/developers/authentication.md)指南中的相同步骤操作。

## 后续步骤

* [获取可延长的代理](/chinese/developers/api-reference/extend-orders/get-extendable-delegates.md) —— 开始流程。
* 在调用 API 之前，先设置[身份验证](/chinese/developers/authentication.md)。
* 查看[能量与带宽](/chinese/concepts/energy-and-bandwidth.md)和[订单类型](/chinese/concepts/order-types.md)。


---

# 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:

```
GET https://docs.tronsave.io/chinese/developers/api-reference/extend-orders.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
