Api/AccountApi
// Set your API Keys 👇 here
$sdk = new \Tatum\Sdk();
// MainNet API Call
$sdk->mainnet()->api()->account();
// TestNet API Call
$sdk->testnet()->api()->account();
Methods
Method | Description |
---|---|
activateAccount() | Activate account |
blockAmount() | Block an amount in an account |
createAccount() | Create a virtual account |
createAccountBatch() | Create multiple accounts in a batch call |
createAccountXpub() | Create a virtual account |
deactivateAccount() | Deactivate account |
deleteAllBlockAmount() | Unblock all blocked amounts in an account |
deleteBlockAmount() | Unblock a blocked amount in an account |
freezeAccount() | Freeze account |
getAccountBalance() | Get account balance |
getAccountByAccountId() | Get account by ID |
getAccounts() | List all accounts |
getAccountsByCustomerId() | List all customer accounts |
getAccountsCount() | Count of found entities for get accounts request |
getBlockAmount() | Get blocked amounts in an account |
getBlockAmountById() | Get blocked amount by ID |
unblockAmountWithTransaction() | Unblock an amount in an account and perform a transaction |
unfreezeAccount() | Unfreeze account |
updateAccountByAccountId() | Update account |
activateAccount()
Example
#️⃣ Execute command in terminal
Request
PUT
/v3/ledger/account/{id}/activate
Type signature
(new \Tatum\Sdk())->{mainnet/testnet}()->api()->account()->activateAccount(
string $id
)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
$id | string | Account ID |
Return type
void (empty response body)
Description
Activate account
2 credits per API call.
Activates an account.
blockAmount()
Example
#️⃣ Execute command in terminal
Request
POST
/v3/ledger/account/block/{id}
Type signature
(new \Tatum\Sdk())->{mainnet/testnet}()->api()->account()->blockAmount(
string $id,
\Tatum\Model\BlockAmount $block_amount
): \Tatum\Model\Id
Parameters
Name | Type | Description | Notes |
---|---|---|---|
$id | string | Account ID | |
$block_amount | \Tatum\Model\BlockAmount |
Return type
Description
Block an amount in an account
2 credits per API call.
Blocks an amount in an account. Any number of distinct amounts can be blocked in one account. Every new blockage has its own distinct ID, which is used as a reference. When the amount is blocked, it is debited from the available balance of the account. The account balance remains the same. The account balance represents the total amount of funds in the account. The available balance represents the total amount of funds that can be used to perform transactions. When an account is frozen, the available balance is set to 0 minus all blockages for the account.
createAccount()
Example
#️⃣ Execute command in terminal
Request
POST
/v3/ledger/account
Type signature
(new \Tatum\Sdk())->{mainnet/testnet}()->api()->account()->createAccount(
\Tatum\Model\CreateAccount $create_account
): \Tatum\Model\Account
Parameters
Name | Type | Description | Notes |
---|---|---|---|
$create_account | \Tatum\Model\CreateAccount |
Return type
Description
Create a virtual account
createAccountBatch()
Example
#️⃣ Execute command in terminal
Request
POST
/v3/ledger/account/batch
Type signature
(new \Tatum\Sdk())->{mainnet/testnet}()->api()->account()->createAccountBatch(
\Tatum\Model\CreateAccountBatch $create_account_batch
): \Tatum\Model\Account[]
Parameters
Name | Type | Description | Notes |
---|---|---|---|
$create_account_batch | \Tatum\Model\CreateAccountBatch |
Return type
Description
Create multiple accounts in a batch call
2 credits per API call + 1 credit for every account created.
Creates new accounts for the customer in a batch call.
createAccountXpub()
Example
#️⃣ Execute command in terminal
Request
POST
/v3/ledger/account
Type signature
(new \Tatum\Sdk())->{mainnet/testnet}()->api()->account()->createAccountXpub(
\Tatum\Model\CreateAccountXpub $create_account_xpub
): \Tatum\Model\Account
Parameters
Name | Type | Description | Notes |
---|---|---|---|
$create_account_xpub | \Tatum\Model\CreateAccountXpub |
Return type
Description
Create a virtual account
2 credits per API call
Create a new virtual account for a customer.
- If the customer that you specified in the request body already exists, the newly created virtual account is added to this customer’s list of accounts.
- If the customer that you specified in the request body does not exist yet, a new customer is created together with the virtual account, and the virtual account is added to this customer.
You can create a virtual account for any supported cryptocurrency, fiat currency, Tatum virtual currency, or fungible tokens created within Tatum. Once the currency/asset is set for a virtual account, it cannot be changed.
Virtual account balance
A virtual account has its own balance. The balance can be logically presented by the account balance and available balance:
- The account balance (
accountBalance
) represents all assets on the account, both available and blocked. - The available balance (
availableBalance
) represents the account balance minus the blocked assets. Use the available balance to determine how much a customer can send or withdraw from their virtual account.
Cryptocurrency virtual accounts
When you create a virtual account based on a cryptocurrency (for example, BTC or ETH), you have to provide the extended public key (xpub
) of the blockchain wallet that will be connected to this account.
NOTE: Adding xpub
to the virtual account does not connect any specific blockchain address to this account. xpub
is a generator of addresses, not an address itself.
Not all blockchains provide xpub
for wallets, or Tatum may not support wallets on some blockchains. In such cases, use the wallet address or the account address instead.
- ALGO: No
xpub
provided; useaddress
from the generated wallet instead. - BCH: Obtain
xpub
from the generated wallet. - BNB: No
xpub
provided; useaddress
from the generated wallet instead. - BSC: Obtain
xpub
from the generated wallet instead. - BTC: Obtain
xpub
from the generated wallet instead. - CELO: Obtain
xpub
from the generated wallet. - DOGE: Obtain
xpub
from the generated wallet. - EGLD: No
xpub
provided; useaddress
from the generated blockchain address instead. Blockchain addresses on Elrond are generated based on the mnemonic of an Elrond wallet. If you do not have an Elrond wallet, create one. - ETH: Obtain
xpub
from the generated wallet. - FLOW: Obtain
xpub
from the generated wallet. - KCS: Obtain
xpub
from the generated wallet. - KLAY: Obtain
xpub
from the generated wallet. - LTC: Obtain
xpub
from the generated wallet. - MATIC: Obtain
xpub
from the generated wallet. - SOL: No
xpub
provided; useaddress
from the generated wallet instead. - TRON: Obtain
xpub
from the generated wallet. - XDC: Obtain
xpub
from the generated wallet. - XLM: No
xpub
provided; useaddress
from the generated account instead. - XRP: No
xpub
provided; useaddress
from the generated account instead.
Connect a virtual account to the blockchain
- If the virtual account was created with the wallet’s
xpub
, generate a new blockchain address for this account. - If the virtual account was created with the wallet’s or account’s address instead of the wallet’s
xpub
, assign an existing blockchain address to this account.
You can connect multiple blockchain addresses to one virtual account.
deactivateAccount()
Example
#️⃣ Execute command in terminal
Request
PUT
/v3/ledger/account/{id}/deactivate
Type signature
(new \Tatum\Sdk())->{mainnet/testnet}()->api()->account()->deactivateAccount(
string $id
)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
$id | string | Account ID |
Return type
void (empty response body)
Description
Deactivate account
2 credits per API call.
Deactivates an account. Only accounts with account and available balances of zero can be deactivated. Deactivated accounts are not visible in the list of accounts, it is not possible to send funds to these accounts or perform transactions. However, they are still present in the ledger and all transaction histories.
deleteAllBlockAmount()
Example
#️⃣ Execute command in terminal
Request
DELETE
/v3/ledger/account/block/account/{id}
Type signature
(new \Tatum\Sdk())->{mainnet/testnet}()->api()->account()->deleteAllBlockAmount(
string $id
)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
$id | string | Account ID |
Return type
void (empty response body)
Description
Unblock all blocked amounts in an account
1 credit per API call, 1 credit for each deleted blockage. 1 API call + 2 blockages = 3 credits.
Unblocks previously blocked amounts in an account. Increases the available balance in the account where the amount was blocked.
deleteBlockAmount()
Example
#️⃣ Execute command in terminal
Request
DELETE
/v3/ledger/account/block/{id}
Type signature
(new \Tatum\Sdk())->{mainnet/testnet}()->api()->account()->deleteBlockAmount(
string $id
)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
$id | string | Blockage ID |
Return type
void (empty response body)
Description
Unblock a blocked amount in an account
1 credit per API call.
Unblocks a previously blocked amount in an account. Increases the available balance in the account where the amount was blocked.
freezeAccount()
Example
#️⃣ Execute command in terminal
Request
PUT
/v3/ledger/account/{id}/freeze
Type signature
(new \Tatum\Sdk())->{mainnet/testnet}()->api()->account()->freezeAccount(
string $id
)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
$id | string | Account ID |
Return type
void (empty response body)
Description
Freeze account
2 credits per API call.
Disables all outgoing transactions. Incoming transactions to the account are available. When an account is frozen, its available balance is set to 0. This operation will create a new blockage of type ACCOUNT_FROZEN, which is automatically deleted when the account is unfrozen.
getAccountBalance()
Example
#️⃣ Execute command in terminal
Request
GET
/v3/ledger/account/{id}/balance
Type signature
(new \Tatum\Sdk())->{mainnet/testnet}()->api()->account()->getAccountBalance(
string $id
): \Tatum\Model\AccountBalance
Parameters
Name | Type | Description | Notes |
---|---|---|---|
$id | string | Account ID |
Return type
Description
Get account balance
1 credit per API call.
Get balance for the account.
getAccountByAccountId()
Example
#️⃣ Execute command in terminal
Request
GET
/v3/ledger/account/{id}
Type signature
(new \Tatum\Sdk())->{mainnet/testnet}()->api()->account()->getAccountByAccountId(
string $id
): \Tatum\Model\Account
Parameters
Name | Type | Description | Notes |
---|---|---|---|
$id | string | Account ID |
Return type
Description
Get account by ID
1 credit per API call.
Gets active account by ID. Displays all information regarding the given account.
getAccounts()
Example
#️⃣ Execute command in terminal
Request
GET
/v3/ledger/account
Type signature
(new \Tatum\Sdk())->{mainnet/testnet}()->api()->account()->getAccounts(
[ float $page_size, ]
[ float $page, ]
[ string $sort, ]
[ string $sort_by, ]
[ bool $active, ]
[ bool $only_non_zero_balance, ]
[ bool $frozen, ]
[ string $currency, ]
[ string $account_number ]
): \Tatum\Model\Account[]
Parameters
Name | Type | Description | Notes |
---|---|---|---|
$page_size | float | Max number of items per page is 50. | [optional] |
$page | float | Page number | [optional] |
$sort | string | Direction of sorting. Can be asc or desc | [optional] |
$sort_by | string | Sort by | [optional] |
$active | bool | Filter only active or non active accounts | [optional] |
$only_non_zero_balance | bool | Filter only accounts with non zero balances | [optional] |
$frozen | bool | Filter only frozen or non frozen accounts | [optional] |
$currency | string | Filter by currency | [optional] |
$account_number | string | Filter by account number | [optional] |
Return type
Description
List all accounts
1 credit per API call.
Lists all accounts. Inactive accounts are also visible.
getAccountsByCustomerId()
Example
#️⃣ Execute command in terminal
Request
GET
/v3/ledger/account/customer/{id}
Type signature
(new \Tatum\Sdk())->{mainnet/testnet}()->api()->account()->getAccountsByCustomerId(
float $page_size,
string $id,
[ float $offset, ]
[ string $account_code ]
): \Tatum\Model\Account[]
Parameters
Name | Type | Description | Notes |
---|---|---|---|
$page_size | float | Max number of items per page is 50. | |
$id | string | Internal customer ID | |
$offset | float | Offset to obtain the next page of data. | [optional] |
$account_code | string | For bookkeeping to distinct account purpose. | [optional] |
Return type
Description
List all customer accounts
1 credit per API call.
Lists all accounts associated with a customer. Only active accounts are visible.
getAccountsCount()
Example
#️⃣ Execute command in terminal
Request
GET
/v3/ledger/account/count
Type signature
(new \Tatum\Sdk())->{mainnet/testnet}()->api()->account()->getAccountsCount(
[ float $page_size, ]
[ float $page, ]
[ string $sort, ]
[ string $sort_by, ]
[ bool $active, ]
[ bool $only_non_zero_balance, ]
[ bool $frozen, ]
[ string $currency, ]
[ string $account_number ]
): \Tatum\Model\EntitiesCount
Parameters
Name | Type | Description | Notes |
---|---|---|---|
$page_size | float | Max number of items per page is 50. | [optional] |
$page | float | Page number | [optional] |
$sort | string | Direction of sorting. Can be asc or desc | [optional] |
$sort_by | string | Sort by | [optional] |
$active | bool | Filter only active or non active accounts | [optional] |
$only_non_zero_balance | bool | Filter only accounts with non zero balances | [optional] |
$frozen | bool | Filter only frozen or non frozen accounts | [optional] |
$currency | string | Filter by currency | [optional] |
$account_number | string | Filter by account number | [optional] |
Return type
Description
Count of found entities for get accounts request
1 credit per API call.
Count of accounts that were found from /v3/ledger/account
getBlockAmount()
Example
#️⃣ Execute command in terminal
Request
GET
/v3/ledger/account/block/{id}
Type signature
(new \Tatum\Sdk())->{mainnet/testnet}()->api()->account()->getBlockAmount(
string $id,
float $page_size,
[ float $offset ]
): \Tatum\Model\Blockage[]
Parameters
Name | Type | Description | Notes |
---|---|---|---|
$id | string | Account ID | |
$page_size | float | Max number of items per page is 50. | |
$offset | float | Offset to obtain the next page of data. | [optional] |
Return type
Description
Get blocked amounts in an account
1 credit per API call.
Gets blocked amounts for an account.
getBlockAmountById()
Example
#️⃣ Execute command in terminal
Request
GET
/v3/ledger/account/block/{id}/detail
Type signature
(new \Tatum\Sdk())->{mainnet/testnet}()->api()->account()->getBlockAmountById(
string $id
): \Tatum\Model\Blockage
Parameters
Name | Type | Description | Notes |
---|---|---|---|
$id | string | Blocked amount ID |
Return type
Description
Get blocked amount by ID
1 credit per API call.
Gets blocked amount by id.
unblockAmountWithTransaction()
Example
#️⃣ Execute command in terminal
Request
PUT
/v3/ledger/account/block/{id}
Type signature
(new \Tatum\Sdk())->{mainnet/testnet}()->api()->account()->unblockAmountWithTransaction(
string $id,
\Tatum\Model\UnblockAmount $unblock_amount
): \Tatum\Model\TransactionResult
Parameters
Name | Type | Description | Notes |
---|---|---|---|
$id | string | Blockage ID | |
$unblock_amount | \Tatum\Model\UnblockAmount |
Return type
\Tatum\Model\TransactionResult
Description
Unblock an amount in an account and perform a transaction
2 credits per API call.
Unblocks a previously blocked amount in an account and invokes a ledger transaction from that account to a different recipient. If the request fails, the amount is not unblocked.
unfreezeAccount()
Example
#️⃣ Execute command in terminal
Request
PUT
/v3/ledger/account/{id}/unfreeze
Type signature
(new \Tatum\Sdk())->{mainnet/testnet}()->api()->account()->unfreezeAccount(
string $id
)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
$id | string | Account ID |
Return type
void (empty response body)
Description
Unfreeze account
2 credits per API call.
Unfreezes a previously frozen account. Unfreezing a non-frozen account not affect the account.
updateAccountByAccountId()
Example
#️⃣ Execute command in terminal
Request
PUT
/v3/ledger/account/{id}
Type signature
(new \Tatum\Sdk())->{mainnet/testnet}()->api()->account()->updateAccountByAccountId(
string $id,
\Tatum\Model\UpdateAccount $update_account
)
Parameters
Name | Type | Description | Notes |
---|---|---|---|
$id | string | Account ID | |
$update_account | \Tatum\Model\UpdateAccount |
Return type
void (empty response body)
Description
Update account
2 credits per API call.
Update account by ID. Only a small number of fields can be updated.