> For the complete documentation index, see [llms.txt](https://prizm.gitbook.io/pzm/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://prizm.gitbook.io/pzm/prizm-api/account-operations.md).

# Account Operations

## Get Account

Get account information given an account ID.

**Request:**

* requestType is getAccount
* account is the account ID
* includeEffectiveBalance is true to include effectiveBalancePrizm and guaranteedBalanceNQT (optional)
* requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)
* requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

**Response:**

* unconfirmedBalanceNQT (S) is balanceNQT less unconfirmed outgoing transactions, the balance displayed in the client
* effectiveBalancePrizm (N) is the balance (in PRIZM) of the account available for forging
* forgedBalanceNQT (S) is the balance (in NQT) that the account has forged
* balanceNQT (S) is the minimally confirmed basic balance (in NQT) of the account
* publicKey (S) is the public key of the account
* requestProcessingTime (N) is the API request processing time (in millisec)
* guaranteedBalanceNQT (S) is the balance (in NQT) of the account with at least 1440 confirmations
* unconfirmedAssetBalances (A) is an array of asset objects including the fields unconfirmedBalanceQNT (S) and asset (S) ID
* accountRS (S) is the Reed-Solomon address of the account
* name (S) is the name associated with the account, if applicable
* description (S) is the description of the account, if applicable
* account (S) is the account number
* lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)

**Example:** Refer to [Get Account](/pzm/prizm-api/prizm-api-examples.md#get-account) example.

## Get Account Block Count

Get the number of blocks forged by an account.

**Request:**

* requestType is getAccountBlockCount
* account is an account ID
* requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)
* requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

**Response:**

* numberOfBlocks (N) is the number of blocks forged by the account
* lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
* requestProcessingTime (N) is the API request processing time (in millisec)

**Example:** Refer to [Get Account Block Count](/pzm/prizm-api/prizm-api-examples.md#get-account-block-count) example.

## Get Account Block Ids

Get the block IDs of all blocks forged (generated) by an account in reverse block height order.

**Request:**

* requestType is getAccountBlockIds
* account is the account ID
* timestamp is the earliest block (in seconds since the genesis block) to retrieve (optional)
* firstIndex is a zero-based index to the first block ID to retrieve (optional)
* lastIndex is a zero-based index to the last block ID to retrieve (optional)
* requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)
* requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

**Response:**

* blockIds (A) is an array of block IDs
* lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
* requestProcessingTime (N) is the API request processing time (in millsec)

**Example:** Refer to [Get Account Block Ids](/pzm/prizm-api/prizm-api-examples.md#get-account-block-ids) example.

## Get Account Blocks

Get all blocks forged (generated) by an account in reverse block height order.

**Request:**

* requestType is getAccountBlocks
* account is the account ID
* timestamp is the earliest block (in seconds since the genesis block) to retrieve (optional)
* firstIndex is a zero-based index to the first block to retrieve (optional)
* lastIndex is a zero-based index to the last block to retrieve (optional)
* includeTransactions is true to retrieve transaction details, otherwise only transaction IDs are retrieved (optional)
* requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)
* requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

**Response:**

* blocks (A) is an array of blocks (refer to [Get Block](/pzm/prizm-api/prizm-api-examples.md#get-account-blocks) for details)
* lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
* requestProcessingTime (N) is the API request processing time (in millisec)

**Example:** Refer to [Get Account Blocks](/pzm/prizm-api/prizm-api-examples.md#get-account-blocks) example.

## Get Account Id

Get an account ID given a secret passphrase or public key. POST only.

**Request:**

* requestType is getAccountId
* secretPhrase is the secret passphrase of the account (optional)
* publicKey is the public key of the account (optional if secretPhrase provided)

**Response:**

* accountRS (S) is the Reed-Solomon address of the account
* publicKey (S) is the public key of the account
* requestProcessingTime (N) is the API request processing time (in millisec)
* account (S) is the account number

**Example:** Refer to [Get Account Id](/pzm/prizm-api/prizm-api-examples.md#get-account-id) example.

## Get Account Ledger

Get multiple account ledger entries.

**Request:**

* requestType is getAccountLedger
* account is the account ID (optional)
* firstIndex is a zero-based index to the first block to retrieve (optional)
* lastIndex is a zero-based index to the last block to retrieve (optional)
* event is the event ID (optional)
* eventType is a string representing the event type (optional)
* holdingType is a string representing the holding type (optional)
* holding is the holding ID (optional)
* includeTransactions is true to retrieve transaction details, otherwise only transaction IDs are retrieved (optional)
* requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)
* requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

**Response:**

* entries (A) is an array of ledger objects including the fields:
  * change (S) is the change in the balance for the holding identified by 'holdingType'
  * eventType (S) is the event type causing the account change
  * ledgerId (S) is the ledger entry ID
  * holding (S) is the item identifier for an asset or currency balance
  * isTransactionEvent (B) is true if the event is associated with a transaction and false if it is associated with a block.
  * balance (S) is the balance for the holding identified by 'holdingType'
  * holdingType (S) is the item being changed (account balance, asset balance or currency balance)
  * accountRS (S) is the Reed-Solomon address of the account
  * block (S) is the block ID that created the ledger entry
  * event (S) is the block or transaction associated with the event
  * account (S) is the account number
  * height (N) is the the block height associated with the event
  * timestamp (N) is the the block timestamp associated with the event
* requestProcessingTime (N) is the API request processing time (in millisec)

**Example:** Refer to [Get Account Ledger](/pzm/prizm-api/prizm-api-examples.md#get-account-ledger) example.

## Get Account Ledger Entry

Get a specific account ledger entry.

**Request:**

* requestType is getAccountLedgerEntry
* ledgerId is the ledger ID
* includeTransactions is true to retrieve transaction details, otherwise only transaction IDs are retrieved (optional)
* includeHoldingInfo is true to retrieve asset or currency info (optional) with the ledger entry. The default is false.

**Response:**

* change (S) is the change in the balance for the holding identified by 'holdingType'
* eventType (S) is the event type causing the account change
* ledgerId (S) is the ledger entry ID
* holding (S) is the item identifier for an asset or currency balance
* isTransactionEvent (B) is true if the event is associated with a transaction and false if it is associated with a block.
* balance (S) is the balance for the holding identified by 'holdingType'
* holdingType (S) is the item being changed (account balance, asset balance or currency balance)
* accountRS (S) is the Reed-Solomon address of the account
* block (S) is the block ID that created the ledger entry
* event (S) is the block or transaction associated with the event
* account (S) is the account number
* height (N) is the the block height associated with the event
* timestamp (N) is the the block timestamp associated with the event
* requestProcessingTime (N) is the API request processing time (in millisec)

**Example:** Refer to [Get Account Ledger Entry](/pzm/prizm-api/prizm-api-examples.md#get-account-ledger-entry) example.

## Get Account Public Key

Get the public key associated with an account ID.

**Request:**

* requestType is getAccountPublicKey
* account is the account ID
* requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)
* requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

**Response:**

* publicKey (S) is the 32-byte public key associated with the account, returned as a hex string
* lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
* requestProcessingTime (N) is the API request processing time (in millisec)

**Example:** Refer to [Get Account Public Key](/pzm/prizm-api/prizm-api-examples.md#get-account-public-key) example.

## Get Account Transaction Ids

(Removed. Use [Get Blockchain Transactions](/pzm/prizm-api/prizm-api-examples.md#get-blockchain-transactions) instead.)

## Get Account Transactions

(Removed. Use [Get Blockchain Transactions](/pzm/prizm-api/prizm-api-examples.md#get-blockchain-transactions) instead.)

## Get Balance

Get the balance of an account.

**Request:**

* requestType is getBalance
* account is an account ID
* includeEffectiveBalance is true to include effectiveBalancePrizm and guaranteedBalanceNQT (optional)
* height is the height to retrieve account balance for, if still available (optional)
* requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)
* requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

**Response:**

* unconfirmedBalanceNQT (S) is balanceNQT less unconfirmed outgoing transactions, the balance displayed in the client
* guaranteedBalanceNQT (S) is the balance (in NQT) of the account with at least 1440 confirmations
* effectiveBalancePrizm (N) is the balance (in PRIZM) of the account available for forging: the unleased guaranteedBalance of this account plus the leased guaranteedBalance of all lessors to this account
* forgedBalanceNQT (S) is the balance (in NQT) that the account has forged
* balanceNQT (S) is the minimally confirmed basic balance (in NQT) of the account
* lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
* requestProcessingTime (N) is the API request processing time (in millisec)

**Example:** Refer to [Get Balance](/pzm/prizm-api/prizm-api-examples.md#get-balance) example.

## Get Blockchain Transactions

Get the transactions associated with an account in reverse block timestamp order.

\
**Request:**

* requestType is getBlockchainTransactions
* account is the account ID
* timestamp is the earliest block (in seconds since the genesis block) to retrieve (optional)
* type is the type of transactions to retrieve (optional)
* subtype is the subtype of transactions to retrieve (optional)
* firstIndex is a zero-based index to the first transaction to retrieve (optional)
* lastIndex is a zero-based index to the last transaction to retrieve (optional)
* numberOfConfirmations is the required number of confirmations per transaction (optional)
* withMessage is true to retrieve only only transactions having a message attachment, either non-encrypted or decryptable by the account (optional)
* includeExpiredPrunable is true' to retrieve pruned data if available (optional)
* requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)
* requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

**Note:** Refer to [Get Constants](/pzm/prizm-api/prizm-api-examples.md#get-constants) for definitions of types and subtypes

**Response:**

* transactions (A) is an array of transactions (refer to [Get Transaction](/pzm/prizm-api/prizm-api-examples.md#get-transaction) for details)
* lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
* requestProcessingTime (N) is the API request processing time (in millisec)

**Example:** Refer to [Get Blockchain Transactions](/pzm/prizm-api/prizm-api-examples.md#get-blockchain-transactions) example.

## Get Guaranteed Balance

Get the guaranteed balance of an account. This is the minimum balance the account had in the interval

```
(currentHeight - numberOfConfirmations, currentHeight]
```

Amounts in unconfirmed transactions are not deduced from the result (or included to the result).

**Request:**

* requestType is getGuaranteedBalance
* account is an account ID
* numberOfConfirmations is the minimum number of confirmations for a transaction to be included in the guaranteed balance (optional, if omitted or zero then minimally confirmed transactions are included)
* requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)
* requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

**Response:**

* guaranteedBalanceNQT (S) is the balance (in NQT) of the account with at least numberOfConfirmations confirmations
* lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
* requestProcessingTime (N) is the API request processing time (in millisec)

**Example:** Refer to [Get Guaranteed Balance](/pzm/prizm-api/prizm-api-examples.md#get-guaranteed-balance) example.

## Get Unconfirmed Transaction Ids

Get a list of unconfirmed transaction IDs associated with an account.

**Request:**

* requestType is getUnconfirmedTransactionIds
* account is one account ID (optional)
* account is one account ID (optional)

⋮

* requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)
* requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)
* firstIndex is a zero-based index to the first transaction ID to retrieve (optional)
* lastIndex is a zero-based index to the last transaction ID to retrieve (optional)

**Response:**

* unconfirmedTransactionIds (A) is an array of unconfirmed transaction IDs
* lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
* requestProcessingTime (N) is the API request processing time (in millisec)

**Example:** Refer to [Get Unconfirmed Transaction Ids](/pzm/prizm-api/prizm-api-examples.md#get-unconfirmed-transaction-ids) example.

## Get Unconfirmed Transactions

Get a list of unconfirmed transactions associated with an account.

**Request:**

* requestType is getUnconfirmedTransactions
* account is one account ID (optional)
* account is one account ID (optional)

⋮

* requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)
* requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)
* firstIndex is a zero-based index to the first unconfirmed transaction to retrieve (optional)
* lastIndex is a zero-based index to the last unconfirmed transaction to retrieve (optional)

**Response:**

* unconfirmedTransactions (A) is an array of unconfirmed transactions (refer to [Get Transaction](/pzm/prizm-api/prizm-api-examples.md#get-account-transactions) for details)
* lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
* requestProcessingTime (N) is the API request processing time (in millisec)

**Example:** Refer to [Get Unconfirmed Transactions](/pzm/prizm-api/prizm-api-examples.md#get-unconfirmed-transactions) example.

## Search Accounts

Get accounts having a name or description that match a given query in reverse relevance order.

**Request:**

* requestType is searchAccounts
* query is a full text query on the account fields name (S) and description (S) in the [standard Lucene syntax](https://lucene.apache.org/core/2_9_4/queryparsersyntax.html#Overview)
* firstIndex is a zero-based index to the first account to retrieve (optional)
* lastIndex is a zero-based index to the last account to retrieve (optional)
* requireBlock is the block ID of a block that must be present in the blockchain during execution (optional)
* requireLastBlock is the block ID of a block that must be last in the blockchain during execution (optional)

**Response:**

* accounts (A) is an array of account objects with the following fields:
  * account (S) is the account number
  * accountRS (S) is the Reed-Solomon address of the account
  * name (S) is the name of the account
  * description (S) is the description of the account (if applicable)
* lastBlock (S) is the last block ID on the blockchain (applies if requireBlock is provided but not requireLastBlock)
* requestProcessingTime (N) is the API request processing time (in millisec)

**Example:** Refer to [Search Accounts](/pzm/prizm-api/prizm-api-examples.md#search-accounts) example.

## Send Money

Send PRIZM to an account. POST only.

**Request:** Refer to [Create Transaction Request](/pzm/prizm-api/create-transaction.md#create-transaction-request) for common parameters.

* requestType is sendMoney
* amountNQT is the amount (in NQT) in the transaction
* recipient is the account ID of the recipient
* recipientPublicKey is the public key of the receiving account (optional, enhances security of a new account)

**Response:** Refer to [Create Transaction Response](/pzm/prizm-api/create-transaction.md#create-transaction-response).

**Example:** Refer to [Send Money](/pzm/prizm-api/prizm-api-examples.md#send-money) example.

## Set Account Info

Set account information. POST only.

**Request:** Refer to [Create Transaction Request](/pzm/prizm-api/create-transaction.md#create-transaction-request) for common parameters.

* requestType is setAccountInfo
* name is a name to associate with the account (optional)
* description is a description to associate with the account (optional)

**Response:** Refer to [Create Transaction Response](/pzm/prizm-api/create-transaction.md#create-transaction-response).

**Example:** Refer to [Set Account Info](/pzm/prizm-api/prizm-api-examples.md#set-account-info) example.\ <br>
