# Use Signed Transaction

## [Buy API (Postman)](https://www.postman.com/tronsave/tronsave/folder/kuv179r/buy-with-signtx)

## Buy Resources 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](https://docs.tronsave.io/developer/buy-resources-v2/use-signed-transaction/estimate-trx) API will be used to calculate the TRX needed for the desired resource amount and rental duration.

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

1. **Option 1:** [**Write your function**](https://docs.tronsave.io/developer/buy-resources-v2/get-signed-transaction#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 API](https://docs.tronsave.io/developer/buy-resources-v2/get-signed-transaction#option-2-use-tronsave-get-signed-transaction-api) to generate the signed transaction automatically.

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

* Use the [Create Order API](https://docs.tronsave.io/developer/buy-resources-v2/use-signed-transaction/create-order) 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 resource 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/v2/estimate-buy-resource`
* Get Signed Transaction: <mark style="color:orange;">`POST`</mark> `https://api-dev.tronsave.io/v2/signed-tx`
* Create order: <mark style="color:orange;">`POST`</mark>  `https://api-dev.tronsave.io/v2/buy-resource`
  {% endtab %}
  {% endtabs %}

If you want to integrate with the **Nile Testnet**, simply replace the URL with <https://testnet.tronsave.io/> and follow the same steps as in [the guide](https://docs.tronsave.io/developer/get-api-key/on-the-website).
