tx
The tx
method retrieves information on a single transaction, by its identifying hash or its CTID.
Request Format
An example of the request format:
{ "id": 1, "command": "tx", "transaction": "C53ECF838647FA5A4C780377025FEC7999AB4182590510CA461444B207AB74A9", "binary": false, "api_version": 2 }
The request includes the following parameters:
Field | Type | Required? | Description |
---|---|---|---|
ctid | String | No | The compact transaction identifier of the transaction to look up. Must use uppercase hexadecimal only. (Not supported in Clio v2.0 and earlier) |
transaction | String | No | The 256-bit hash of the transaction to look up, as hexadecimal. |
binary | Boolean | No | If true , return transaction data and metadata as binary serialized to hexadecimal strings. If false , return transaction data and metadata as JSON. The default is false . |
min_ledger | Number | No | Use this with max_ledger to specify a range of up to 1000 ledger indexes, starting with this ledger (inclusive). If the server cannot find the transaction, it confirms whether it was able to search all the ledgers in this range. |
max_ledger | Number | No | Use this with min_ledger to specify a range of up to 1000 ledger indexes, ending with this ledger (inclusive). If the server cannot find the transaction, it confirms whether it was able to search all the ledgers in the requested range. |
You must provide either ctid
or transaction
, but not both.
min_ledger
to max_ledger
.Response Format
An example of a successful response:
{ "result": { "tx_json": { "Account": "r3PDtZSa5LiYp1Ysn1vMuMzB59RzV3W9QH", "DeliverMax": { "currency": "USD", "issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", "value": "1" }, "Destination": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", "Fee": "10", "Flags": 0, "Paths": [ [ { "account": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV", "currency": "USD", "issuer": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV", "type": 49 } ], [ { "account": "rD1jovjQeEpvaDwn9wKaYokkXXrqo4D23x", "currency": "USD", "issuer": "rD1jovjQeEpvaDwn9wKaYokkXXrqo4D23x", "type": 49 }, { "account": "rB5TihdPbKgMrkFqrqUC3yLdE8hhv4BdeY", "currency": "USD", "issuer": "rB5TihdPbKgMrkFqrqUC3yLdE8hhv4BdeY", "type": 49 }, { "account": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV", "currency": "USD", "issuer": "r3kmLJN5D28dHuH8vZNUZpMC43pEHpaocV", "type": 49 } ] ], "SendMax": { "currency": "USD", "issuer": "r3PDtZSa5LiYp1Ysn1vMuMzB59RzV3W9QH", "value": "1.01" }, "Sequence": 88, "SigningPubKey": "02EAE5DAB54DD8E1C49641D848D5B97D1B29149106174322EDF98A1B2CCE5D7F8E", "TransactionType": "Payment", "TxnSignature": "30440220791B6A3E036ECEFFE99E8D4957564E8C84D1548C8C3E80A87ED1AA646ECCFB16022037C5CAC97E34E3021EBB426479F2ACF3ACA75DB91DCC48D1BCFB4CF547CFEAA0", "date": 416445410, "ledger_index": 348734 }, "ctid": "C005523E00000000", "hash": "E08D6E9754025BA2534A78707605E0601F03ACE063687A0CA1BDDACFCD1698C7", "meta": { "AffectedNodes": [ { "ModifiedNode": { "FinalFields": { "Account": "r3PDtZSa5LiYp1Ysn1vMuMzB59RzV3W9QH", "Balance": "59328999119", "Flags": 0, "OwnerCount": 11, "Sequence": 89 }, "LedgerEntryType": "AccountRoot", "LedgerIndex": "E0D7BDE68B468FF0B8D948FD865576517DA987569833A05374ADB9A72E870A06", "PreviousFields": { "Balance": "59328999129", "Sequence": 88 }, "PreviousTxnID": "C26AA6B4F7C3B9F55E17CD0D11F12032A1C7AD2757229FFD277C9447A8815E6E", "PreviousTxnLgrSeq": 348700 } }, { "ModifiedNode": { "FinalFields": { "Balance": { "currency": "USD", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "-1" }, "Flags": 131072, "HighLimit": { "currency": "USD", "issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", "value": "100" }, "HighNode": "0", "LowLimit": { "currency": "USD", "issuer": "r3PDtZSa5LiYp1Ysn1vMuMzB59RzV3W9QH", "value": "0" }, "LowNode": "0" }, "LedgerEntryType": "RippleState", "LedgerIndex": "EA4BF03B4700123CDFFB6EB09DC1D6E28D5CEB7F680FB00FC24BC1C3BB2DB959", "PreviousFields": { "Balance": { "currency": "USD", "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", "value": "0" } }, "PreviousTxnID": "53354D84BAE8FDFC3F4DA879D984D24B929E7FEB9100D2AD9EFCD2E126BCCDC8", "PreviousTxnLgrSeq": 343570 } } ], "TransactionIndex": 0, "TransactionResult": "tesSUCCESS", "delivered_amount": "unavailable" }, "validated": true, "ledger_index": 348734, "ledger_hash": "195F62F34EB2CCFA4C5888BA20387E82EB353DDB4508BAE6A835AF19FB8B0C09", "close_time_iso": "2013-03-12T23:16:50Z" }, "api_version": 2, "status": "success", "type": "response" }
The response follows the standard format, with a successful result containing the fields of the Transaction object as well as the following additional fields:
Field | Type | Description |
---|---|---|
ctid | String | The transaction's compact transaction identifier. (Not supported in Clio v2.0 and earlier.) |
date | Number | The close time of the ledger in which the transaction was applied, in seconds since the Ripple Epoch. |
hash | String | The unique identifying hash of the transaction |
inLedger | Number | (Deprecated) Alias for ledger_index . |
ledger_index | Number | The ledger index of the ledger that includes this transaction. |
meta | Object (JSON) | (JSON mode) Transaction metadata, which describes the results of the transaction. |
meta_blob | String (binary) | (Binary mode) Transaction metadata, which describes the results of the transaction, represented as a hex string. |
tx_blob | String (binary) | (Binary mode) The transaction data represented as a hex string. |
tx_json | Object (JSON) | The transaction data represented in JSON. |
validated | Boolean | If true , this data comes from a validated ledger version; if omitted or set to false , this data is not final. |
Not Found Response
If the server does not find the transaction, it returns a txnNotFound
error, which could mean two things:
- The transaction has not been included in any ledger version, and has not been executed.
- The transaction was included in a ledger version that the server does not have available.
This means that a txnNotFound
on its own is not enough to know the final outcome of a transaction.
To further narrow down the possibilities, you can provide a range of ledgers to search using the min_ledger
and max_ledger
fields in the request. If you provide both of those fields, the txnNotFound
response includes the following field:
Field | Type | Description |
---|---|---|
searched_all | Boolean | (Omitted unless the request provided min_ledger and max_ledger ) If true , the server was able to search all of the specified ledger versions, and the transaction was in none of them. If false , the server did not have all of the specified ledger versions available, so it is not sure if one of them might contain the transaction. |
An example of a txnNotFound
response that fully searched a requested range of ledgers:
{ "error": "txnNotFound", "error_code": 29, "error_message": "Transaction not found.", "id": 1, "request": { "binary": false, "command": "tx", "id": 1, "max_ledger": 54368673, "min_ledger": 54368573, "transaction": "E08D6E9754025BA2534A78707605E0601F03ACE063687A0CA1BDDACFCD1698C7" }, "searched_all": true, "status": "error", "type": "response" }
Possible Errors
- Any of the universal error types.
invalidParams
- One or more fields are specified incorrectly, or one or more required fields are missing.txnNotFound
- Either the transaction does not exist, or it was part of an ledger version thatrippled
does not have available.excessiveLgrRange
- Themin_ledger
andmax_ledger
fields of the request are more than 1000 apart.invalidLgrRange
- The specifiedmin_ledger
is larger than themax_ledger
, or one of those parameters is not a valid ledger index.