# Creating an outgoing transaction from HD wallet root key

**Request Body - `Content-Type: application/json;charset=utf-8`**

| Parameter     | Type   | Required | Description                                                |
| ------------- | ------ | -------- | ---------------------------------------------------------- |
| `tx`          | object | Yes      | Transaction information with the below parameters:         |
| `tx.address`  | string | Yes      | A Hycon wallet address of the recipient                    |
| `tx.amount`   | string | Yes      | Amount of Hycon to send to the recipient                   |
| `tx.minerFee` | string | Yes      | Transaction fee in Hycon                                   |
| `tx.nonce`    | number | No       | The transaction number sent from the Hycon address         |
| `rootKey`     | string | Yes      | Root key of the wallet you want to use for the transaction |
| `index`       | number | Yes      | HD wallet index to a specific wallet address               |

**Response - `200 OK, application/json`**

| Parameter | Type   | Description                                                |
| --------- | ------ | ---------------------------------------------------------- |
| `hash`    | string | Hash representation of the transaction after it is created |

**Response Error Table**

| Status | Error               | Message                                    |
| ------ | ------------------- | ------------------------------------------ |
| 400    | `INVALID_PARAMETER` | Invalid address: Please check 'To address' |

POST/api/v1/sendTxWithHDWalletRootKey

**Example request body**

```
{
    "tx": {
        "address": "H23fF8ktBWYwK7aHFbPSW52LtoHcbDvmT",
        "amount": "0.000000001",
        "minerFee": "0.000000001"
    },
    "rootKey": "xprv9s21ZrQH143K4AS5aB6u92QhhFNraGRKE9kHUdtkndLLLu4V5CKHugyAGVgs7R38y8gTG2t",
    "index": 0
}
```

**Example request**

```
$ curl -X POST http://localhost:2442/api/v1/sendTxWithHDWalletRootKey \
    -H 'Content-Type: application/json;charset=utf-8' \
    -d '{
        "tx": [
            {
                "address": "H23fF8ktBWYwK7aHFbPSW52LtoHcbDvmT",
                "amount": "0.000000001",
                "minerFee": "0.000000001"
            }
        ],
        "rootKey": "xprv9s21ZrQH143K4AS5aB6u92QhhFNraGRKE9kHUdtkndLLLu4V5CKHugyAGVgs7R38y8gTG2t",
        "index": 0
    }'
```

**Response (Success)**

```
{ "hash": "3AeeciKEM97w32GLQPeSnU1i6U9G2YxbeyVc7BQb4LQD" }
```


---

# 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://teamhycon.gitbook.io/docs/api-v1-4/api-v1-1/creating-an-outgoing-transaction-from-hd-wallet-root-key.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.
