How-to for developers · Accounts, wallets and keys

Send a Single Account Batch Transaction

In plain words

This tutorial shows how a single account sends a Batch transaction, which groups several transactions and executes them as one operation. The inner transactions either all succeed together or all fail together.

Written by zerps in plain words, from the source linked below.
Section
Tutorials

What you need

You need a basic understanding of the XRP Ledger and a client library installed. The examples use JavaScript with xrpl.js, Python with xrpl-py and Go with xrpl-go. You also need a funded account to send the Batch transaction and two other accounts to receive the payments.

Preparing the inner transactions

The example prepares two payments from the sender, one to each receiving account. Both must include the tfInnerBatchTxn flag, which marks them as inner transactions of a batch. An inner transaction must have a Fee of 0 and an empty string for SigningPubKey. The outer Batch transaction handles the overall fee and the signing for all of them. The autofill function of the client library fills these fields in, so you typically do not set them by hand.

Building the Batch

The TransactionType is Batch and the Account is the address of the sending account. In Flags, the example sets tfAllOrNothing, so that either all inner transactions succeed or they all fail. The RawTransactions field holds the list of inner transactions. It must include a minimum of 2 and a maximum of 8, and they can come from one account or from multiple accounts.

Submitting and checking

The sender submits the Batch transaction and the code checks for a tesSUCCESS result. That result shows the Batch transaction was processed successfully, but it does not guarantee that the inner transactions succeeded. With the tfAllOrNothing flag, if any inner transaction fails, all of them fail and only the Batch transaction fee is deducted from the sender.

Verifying the inner transactions

The Batch result does not show the status of the inner transactions. So the code takes the inner transactions from the response, calculates the hash of each one and looks each up on the ledger by that hash. A hash is a fingerprint of data. You can also check the account balances to confirm the expected changes.

Source: xrpl.org. Read 6 December 2026.

Zerpedia states what the source says, in plain words, and gives no opinion. How Zerpedia is made

zerps Trading tokens on the XRP Ledger carries risk, including total loss. zerps is a self-custodial interface; it does not hold funds, give advice, or execute trades on your behalf.