Tatum
Search…
How to send a feeless instant transaction
Not every transaction should be recorded on the blockchain. To be more precise, almost no transaction is significant enough in and of itself to be stored on the blockchain. Why? Every transaction incurs a transaction fee. And it makes no sense to pay, for example, $1 for a transaction worth $5 in bitcoin.
To avoid these types of transactions and the fees that come along with them, virtual accounts are an ideal solution.
It's both extremely easy and highly practical to utilize virtual accounts to send instant transactions. As a prerequisite, you must have at least two virtual accounts with assets on at least one of them.

Performing a transaction between virtual accounts

A virtual account transaction is a transaction that is settled immediately with no blockchain fee incurred. It is a transaction between two virtual accounts with the same account currency, i.e., Bitcoin accounts, Ethereum accounts, or your custom fiat accounts.
Tatum supports microtransactions. You can send as little as 1/1000000 of a Satoshi for Bitcoin or 1/1000000 of a Wei of Ethereum between virtual accounts.
JavaScript
Request
1
import {storeTransaction} from '@tatumio/tatum';
2
/**
3
* Sends a payment from one virtual account to another
4
* @param transaction - body of the request - https://apidoc.tatum.io/tag/Transaction/#operation/sendTransaction
5
*/
6
7
const body = {
8
senderAccountId: "5fad2aa1cac7f2e8aeac0e6b",
9
recipientAccountId: "5fbaca3001421166273b3779",
10
amount: "0.000001",
11
anonymous: false,
12
compliant: false,
13
transactionCode: "1_01_EXTERNAL_CODE",
14
paymentId: "9625",
15
recipientNote: "Private note",
16
baseRate: 1,
17
senderNote: "Sender note"
18
};
19
20
const txReference = storeTransaction(body);
Copied!
1
curl --location --request POST 'https://api-eu1.tatum.io/v3/ledger/transaction' \
2
--header 'x-api-key: YOUR_API_KEY ' \
3
--header 'Content-Type: application/json' \
4
--data-raw '{
5
"senderAccountId": "5fad2aa1cac7f2e8aeac0e6b",
6
"recipientAccountId": "5fbaca3001421166273b3779",
7
"amount": "0.000001"
8
"anonymous": false,
9
"compliant": false,
10
"transactionCode": "1_01_EXTERNAL_CODE",
11
"paymentId": "9625",
12
"recipientNote": "Private note",
13
"baseRate": 1,
14
"senderNote": "Sender note"
15
}'
Copied!
The response contains a transaction reference ID that can be used to get the details of the transaction.
Response
1
{
2
"reference": "9e179f90-0221-480f-adb4-28bd1937bb20"
3
}
Copied!

Getting the details of the transaction

When you perform a virtual account transaction, there are actually two transactions written inside the virtual accounts - one for the sender and one for the recipient of the transaction, each with slightly different data.
  • the accountID and counterAccountID for the transaction are opposite
  • the transactionType is DEBIT or CREDIT based on the sender and recipient account
  • the marketValue might be different based on the settings of the accounts in the transaction
To get the details of both transactions, enter the reference ID of the virtual account transaction from the previous step into the following API call:
JavaScript
cURL
1
import {getTransactionsByReference} from '@tatumio/tatum';
2
/**
3
* Finds transactions for all accounts with the given reference.
4
* @param reference - transaction reference within Tatum Private Ledger
5
*/
6
7
const tx = getTransactionsByReference("9e179f90-0221-480f-adb4-28bd1937bb20");
Copied!
1
curl --location --request GET 'https://api-eu1.tatum.io/v3/ledger/transaction/reference/9e179f90-0221-480f-adb4-28bd1937bb20' \
2
--header 'x-api-key: YOUR_API_KEY '
Copied!
The response will contain details about both virtual account transactions.
Response
1
[
2
{
3
"amount": "-0.000001",
4
"operationType": "PAYMENT",
5
"currency": "BTC",
6
"transactionType": "DEBIT_PAYMENT",
7
"accountId": "5fad2aa1cac7f2e8aeac0e6b",
8
"anonymous": false,
9
"reference": "9e179f90-0221-480f-adb4-28bd1937bb20",
10
"counterAccountId": "5fbaca3001421166273b3779",
11
"senderNote": null,
12
"recipientNote": null,
13
"paymentId": null,
14
"transactionCode": null,
15
"marketValue": {
16
"currency": "EUR",
17
"source": "CoinGecko",
18
"sourceDate": 1606076765607,
19
"amount": "-0.01566745999999999889"
20
},
21
"created": 1606076989819
22
},
23
{
24
"amount": "0.000001",
25
"operationType": "PAYMENT",
26
"currency": "BTC",
27
"transactionType": "CREDIT_PAYMENT",
28
"accountId": "5fbaca3001421166273b3779",
29
"anonymous": false,
30
"reference": "9e179f90-0221-480f-adb4-28bd1937bb20",
31
"counterAccountId": "5fad2aa1cac7f2e8aeac0e6b",
32
"senderNote": null,
33
"recipientNote": null,
34
"paymentId": null,
35
"transactionCode": null,
36
"marketValue": {
37
"currency": "EUR",
38
"source": "CoinGecko",
39
"sourceDate": 1606076765607,
40
"amount": "0.01566745999999999889"
41
},
42
"created": 1606076989819
43
}
44
]
Copied!
The market value in the transaction is part of the compliance engine built into Tatum Virtual Accounts. It records the transaction's exact value in the fiat currencies - US Dollars, Euros, etc. Currency is obtained from the accountingCurrency property of the account.
And that's it. You can easily perform instant transactions and get details about them with 2 API calls. You can also obtain a list of transactions for the specific account or find customer transactions across multiple accounts.