Hedera
Search…
Get a transaction receipt
The transaction receipt gives you information about a transaction including whether or not the transaction reached consensus on the network. You request the receipt for every transaction type and there is currently no transaction fee associated with this network request.
Receipts can be requested from a Hedera network for up to 3 minutes.

Transaction Receipt Contents

The transaction receipt returns the following information about a transaction:
  • Whether the transaction reached consensus or not (success or fail)
  • The newly generated account ID, topic ID, token ID, file ID, schedule ID, scheduled transaction ID or smart contract ID
  • The exchange rate
  • The topic running hash
  • The topic sequence number
  • The total supply of token
  • The serial numbers for of the newly created NFTs after a token mint transaction was executed
Transaction Signing Requirements
  • Transaction receipt requests do not have an associated fee at this time so there is no signature requirement
Constructor
Description
new TransactionReceiptQuery()
Initializes the TransactionReceiptQuery Object
  • Transaction ID: The ID of the transaction to return the receipt for
  • Include Duplicates: Whether or not to include the receipts for duplicate transactions
  • Include Children: Whether or not to include the receipt for children transactions triggered by a parent transaction
Method
Type
Requirement
setTransactionId(<transactionId>)
​TransactionID​
Required
setIncludeDuplicates(<value>)
boolean
Optional
setIncludeChildren(<value>)
boolean
Optional
Java
JavaScript
Go
1
new TransactionReceiptQuery()
2
.setTransactionId(transactionId)
3
.execute(client)
Copied!
1
new TransactionReceiptQuery()
2
.setTransactionId(transactionId)
3
.execute(client)
Copied!
1
hedera.NewTransactionReceiptQuery().
2
SetTransactionId(transactionId).
3
Execute(client)
Copied!

Helper Methods

V2
Method
Type
Description
<TransactionResponse>.getReceipt(<client>)
TransactionReceipt
Returns the receipt of a transaction
<TransactionResponse>.getReceipt(<client, timeout>)
Client, Duration
Request the receipt from the network for this duration
<TransactionResponse>.getReceiptQuery()
TransactionReceiptQuery
Returns the TransactionReceiptQuery response for a transaction. This will not error on bad status like RECEIPT_NOT_FOUND and will return information about a failed transaction if necessary.
<TransactionResponse>.getReceiptAsync(<client, timeout>)
Client, Duration
Request receipt asynchronously for the provided duration
<TransactionReceipt>.status
Status
Whether the transaction reached consensus or not
<TransactionReceipt>.accountId
AccountId
The newly generated account ID
<TransactionReceipt>.topicId
TopicId
The newly generated topic ID
<TransactionReceipt>).fileId
FileId
The newly generated file ID
<TransactionReceipt>).contractId
ContractId
The newly generated contract ID
<TransactionReceipt>).tokenId
TokenId
The newly generated token ID
<TransactionReceipt>).scheduleId
ScheduleId
The newly generated schedule ID
<TransactionReceipt>).scheduledTransactionId
TransactionId
The generated scheduled transaction ID
<TransactionReceipt>).exchangeRate
ExchangeRate
The exchange rate in hbar, cents, and expiration time
<TransactionReceipt>.topicRunningHash
ByteString
The topic running hash
<TransactionReceipt>.topicSequenceNumber
long
The topic sequence number
<TransactionReceipt>.totalSupply
long
The total supply of a token
<TransactionReceipt>.serials
List<long>
The list of newly created serial numbers upon execution of a token mint transaction.
Java
1
//Get the receipt of the transaction
2
TransactionReceipt receipt = txResponse.getReceipt(client);
3
​
4
System.out.println("The transaction receipt: " +receipt);
5
​
6
//v2.0.0
Copied!
JavaScript
1
//Get the receipt of the transaction
2
const receipt = await txResponse.getReceipt(client);
3
​
4
console.log("The transaction receipt: " +receipt);
5
​
6
//v2.0.0
Copied!
Go
1
//Request the receipt of the transaction
2
receipt, err := txResponse.GetReceipt(client)
3
​
4
if err != nil {
5
panic(err)
6
}
7
​
8
fmt.Printf("The transaction receipt %v\n", receipt)
9
​
10
//v2.0.0
Copied!

Sample Output:

1
TransactionReceipt{
2
status=SUCCESS,
3
exchangeRate=ExchangeRate{
4
hbars=1,
5
cents=12,
6
expirationTime=2100-01-01T00:00:00Z
7
},
8
accountId=null,
9
fileId=null,
10
contractId=null,
11
topicId=null,
12
tokenId=null,
13
topicSequenceNumber=null,
14
topicRunningHash=null,
15
totalSupply=0,
16
scheduleId=0.0.2531
17
schdeduledTransactionId=null,
18
serials=[]
19
}
Copied!
​
Copy link