# Use Signed Transaction

## [Buy API (Postman)](https://www.postman.com/tronsave/workspace/tronsave/folder/29749953-d79c9a0d-9ca8-4933-9c1e-d4b8d19effa6)

## Buy Energy with Signed Transaction Flow

### **Step 1: Prepare Wallet and Private Key**

1. Ensure you have access to the wallet's private key you intend to use for the transaction.
2. Verify that the wallet has sufficient TRX balance to execute the transaction.

### **Step 2: Estimate TRX Required**

* The [Estimate of TRX](/developer/rest-api-v0/buy-on-rest-api/use-signed-transaction/estimate-trx.md) API will be used to calculate the TRX needed for the desired energy amount and rental duration.

### **Step 3: Generate a Signed Transaction**

1. **Option 1:**[ **Write your function**](/developer/rest-api-v0/buy-on-rest-api/use-signed-transaction/get-signed-transaction.md#option-1-write-your-function-get-signed-transaction) to generate the signed transaction using the wallet's private key.
2. **Option 2:** Use Tronsave [Get Signed Transaction](/developer/rest-api-v0/buy-on-rest-api/use-signed-transaction/get-signed-transaction.md#option-2-use-tronsave-get-signed-transaction-api) API to generate the signed transaction automatically.

### **Step 4: Create an Order**

* Use the [Create Order](/developer/rest-api-v0/buy-on-rest-api/use-signed-transaction/create-order.md) API to finalize the transaction.
  * Pass the response from the signed transaction (if using the API) or your custom-signed transaction.
  * Include the estimated TRX amount and other required parameters to create the energy purchase order.

## API List for Testing - TRON Nile Testnet

{% tabs %}
{% tab title="Test\_API" %}

* Estimate TRX: <mark style="color:orange;">`POST`</mark> `https://api-dev.tronsave.io/v0/estimate-trx`
* Get Signed Transaction: <mark style="color:orange;">`POST`</mark> `https://api-dev.tronsave.io/v0/signed-tx`
* Create order: <mark style="color:orange;">`POST`</mark>  `https://api-dev.tronsave.io/v0/buy-energy`
  {% endtab %}
  {% endtabs %}


---

# Agent Instructions: 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/developer/rest-api-v0/buy-on-rest-api/use-signed-transaction.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.
