# Initialize Hedera accounts with the API

Before you can transact with a new Hedera account, you need to send funds from an existing account to the account alias of the new Hedera account.

## Hedera account identifiers

Hedera accounts are identified using one of the following identifiers:

- Hedera account alias: An alias assigned to a newly created account before it is registered in Hedera.
- Hedera account ID: The identification number of the registered wallet in Hedera, not to be confused with the Ripple Custody account ID.


Not all Hedera wallets support sending funds to new accounts whose address is still in the alias format. For Ripple Custody accounts, any Hedera account with an address in account ID format can send funds to other Ripple Custody Hedera accounts whose address is in either the account alias or the account ID format.

For more information about the properties of accounts in Hedera, see the
Hedera developer documentation.

When you create a new account on the Hedera ledger. Ripple Custody creates an off-chain account and assigns the account a Hedera account alias as its `address`.

A call to the [Retrieve account address](/products/custody/reference/api/openapi/accounts/getaccountaddress) operation returns the following:


```json
{
  "id": "25aa54e1-3232-4d19-8594-07edc133f2dc",
  "address": "0.0.CIQCE5CRZTWEXMITWP2UYUBYRGJSWM2ZBUIQEUZL6V6SIQYJMF4H5UY", // Hedera account alias
  "keyPath": null,
  "createdAt": "2023-03-09T13:02:19.297Z",
  "scope": "External"
}
```

## Initialize the account

### Prerequisites

To initialize your Hedera account, you need the following:

| Prerequisite | Additional information |
|  --- | --- |
| An account on a Hedera ledger from which to initiate the transactions | [View account details](/products/custody/accounts-and-assets/accounts/manage-accounts-api#view-account-details) |
| Enough funds in the account to cover the transaction fees and the amount | [Check account balances](/products/custody/accounts-and-assets/accounts/manage-accounts-api#check-account-balances) |
| The account alias of the account to initialize | This is retrieved in the same way as the account address: [Retrieve account address](/products/custody/reference/api/openapi/accounts/getaccountaddress) |
| If this is a multi-ledger account, the ledger ID | [List ledgers](/products/custody/reference/api/openapi/ledgers/getledgers) |
| The following new IDs, in a standard UUID format:A transaction order IDAn intent ID |  |


### Create the transaction order

System change process
All new requests to change the system state follow the same process. To familiarize yourself with this process first, see [Manage intents and approvals](/products/custody/governance/intents/manage-intents-and-approvals).

To create the transaction order:

1. Prepare the request body in the standard intent proposal format, with a `payload` block similar to the example shown in [Payload example](#payload-example). For more information, see [User-signed proposal request body](/products/custody/governance/intents/intent-request-structure#user-signed-proposal-request-body).
2. Call the [Perform a dry run for an intent](/products/custody/reference/api/openapi/intents/intentdryrun) operation, with the `request` field excluded. For more information, see [Dry run intents](/products/custody/governance/intents/manage-intents-and-approvals#dry-run-an-intent-with-the-api).
This step is optional, but highly recommended. A dry run can reveal errors or unintended consequences of the intent, as well as estimate the fees incurred by the transaction.
You can repeat this step more than once to obtain the required result.
3. Sign the request body and call the [Propose an intent](/products/custody/reference/api/openapi/intents/createintent) operation. For more information, see [Propose an intent to create an entity](/products/custody/governance/intents/manage-intents-and-approvals#submit-an-intent-with-the-api).
4. Check the update. For more information, see [Check updates](/products/custody/governance/intents/manage-intents-and-approvals#check-state-with-the-api).


When the transaction order is successfully approved, Ripple Custody does the following:

- Creates a transaction, to broadcast the automatic token association on the blockchain.
- Creates one or more transfers, to represent the separate amounts associated with the transaction, such as the cryptocurrency amount and the fees.


#### Payload example

This example funds the account with 10000000 tinybar (or 1 HBAR):


```json
{
    "payload": {
        "id": "d28a2cce-af3d-4a4e-b589-c8d61fd824b8",
        "accountId": "5ff7cb0b-ac4e-4e9d-85bc-bd4b027740ce",
        "ledgerId": "hedera-testnet-january-2023",
        "parameters": {
            "operation": {
                "outputs": [
                    {
                        "destination": {
                            "address": "0.0.CIQCE5CRZTWEXMITWP2UYUBYRGJSWM2ZBUIQEUZL6V6SIQYJMF4H5UY",
                            "type": "Address"
                        },
                        "amount": "10000000"
                    }
                ],
                "type": "Transfer"
            },
            "feeStrategy": {
                "priority": "Low",
                "type": "Priority"
            },
            "maximumFee": "200",
            "type": "Hedera"
        },
        "description": "Hedera account initialization",
        "customProperties": {},
        "type": "v0_CreateTransactionOrder"
    }
}
```

Fields of the `payload` block to note are as follows:

| Field | Description |
|  --- | --- |
| `accountId` | Internal account ID of an existing Hedera account in Ripple Custody. |
| `parameters.operation.outputs.destination` | Details of the new account:`type` is `Address`.`address` is the account alias of the new Hedera account. |
| `parameters.operation.outputs.amount` | Amount to fund, in tinybar. |
| `parameters.operation.type` | `Transfer` |
| `parameters.feeStrategy` | Fee strategy field included in the transaction order payload. For Hedera, fees are retrieved directly from the chain and customers cannot prioritize the transaction. For more information, see [Fee strategy and maximum fee](/products/custody/transactions/reference#fee-strategy-and-maximum-fee). |
| `parameters.maximumFee` | The maximum fee, in tinybar. For more information, see [Fee strategy and maximum fee](/products/custody/transactions/reference#fee-strategy-and-maximum-fee). |
| `parameters.type` | Ledger type, in this case `Hedera`. |
| `type` | `v0_CreateTransactionOrder` |


When the transaction order is successfully approved, Ripple Custody does the following:

- Creates a transaction, to broadcast the details and register the account on the blockchain.
- Creates one or more transfers, to represent the separate amounts associated with the transaction, such as the cryptocurrency amount and the fees.
- Updates the `address` to the Hedera account ID:



```json
{
  "id": "4392f3a9-bdb4-4042-8fea-62c7c4152bbf",
  "address": "0.0.3364987", // Hedera account ID
  "keyPath": null,
  "createdAt": "2023-03-09T13:02:19.648Z",
  "scope": "External"
}
```