<p>for now there is none... you can only use single destination address</p>

CC BY-SA 4.0
2018-05-16T19:13:09.483Z
2018-05-16T19:13:09.483Z
Babajide Apata
<p>In Ripple API, </p>

<p>Is there any apis available to split payment which I can pass more than one destination address in single transaction.</p>

<p>Let me share code:</p>

<pre><code>const RippleAPI = require('ripple-lib').RippleAPI;

const api = new RippleAPI({
    server: 'wss://s.altnet.rippletest.net:51233' // Public rippled server
});



//Payment API:
const address = 'r4Ct32uDZvL9e5GRbPftAnu8rpCg7aXXXX';
const secret = 'shvtBfNDJ3yf9sqGoc7XUgSTnXXXX';
const instructions = {maxLedgerVersionOffset: 5};
const payment = {
    source: {
        address: address,
        maxAmount: {
            value: '1.01',
            currency: 'XRP'
        }
    },
    destination: [{
        address: 'rn8KqzsH7b8fGZYmbaDXinLb8XffneXXXX',
        amount: {
            value: '1.01',
            currency: 'XRP'
        }
    },
    {
        address: 'rn8KqzsH7b8fGZYmbaDXinLb8XffneXXXX',
        amount: {
            value: '2.01',
            currency: 'XRP'
        }
    }]
};
function quit(message) {
    console.log(message);
    process.exit(0);
}
function fail(message) {
    console.error(message);
    process.exit(1);
}
api.connect().then(() =&gt; {
    console.log('Connected...');
    return api.preparePayment(address, payment, instructions).then(prepared =&gt; {
        console.log('Payment transaction prepared...');
        const {signedTransaction} = api.sign(prepared.txJSON, secret);
        console.log('Payment transaction signed...');
        api.submit(signedTransaction).then(quit, fail);
    });
}).catch(fail);
</code></pre>

<p>Currently, I am getting error I am passing designation address in array. But If i will as object then it will work fine. But I need to pass more than one address in single transaction.</p>

<p>Can you please give solution ASAP about it?</p>

<ripple><ripple-gateways><ripple-api><ripple-client><ripple-trust>
Ripple JSON API - Can I use more than one destination while transaction?
kiran malvi
# Ripple JSON API - Can I use more than one destination while transaction?

(Asked by: username_0 on 2018-03-23)

In Ripple API, 
Is there any apis available to split payment which I can pass more than one destination address in single transaction.
Let me share code:
const RippleAPI = require('ripple-lib').RippleAPI;

const api = new RippleAPI({
    server: 'wss://s.altnet.rippletest.net:51233' // Public rippled server
});



//Payment API:
const address = 'r4Ct32uDZvL9e5GRbPftAnu8rpCg7aXXXX';
const secret = 'shvtBfNDJ3yf9sqGoc7XUgSTnXXXX';
const instructions = {maxLedgerVersionOffset: 5};
const payment = {
    source: {
        address: address,
        maxAmount: {
            value: '1.01',
            currency: 'XRP'
        }
    },
    destination: [{
        address: 'rn8KqzsH7b8fGZYmbaDXinLb8XffneXXXX',
        amount: {
            value: '1.01',
            currency: 'XRP'
        }
    },
    {
        address: 'rn8KqzsH7b8fGZYmbaDXinLb8XffneXXXX',
        amount: {
            value: '2.01',
            currency: 'XRP'
        }
    }]
};
function quit(message) {
    console.log(message);
    process.exit(0);
}
function fail(message) {
    console.error(message);
    process.exit(1);
}
api.connect().then(() => {
    console.log('Connected...');
    return api.preparePayment(address, payment, instructions).then(prepared => {
        console.log('Payment transaction prepared...');
        const {signedTransaction} = api.sign(prepared.txJSON, secret);
        console.log('Payment transaction signed...');
        api.submit(signedTransaction).then(quit, fail);
    });
}).catch(fail);

Currently, I am getting error I am passing designation address in array. But If i will as object then it will work fine. But I need to pass more than one address in single transaction.
Can you please give solution ASAP about it?

**Tags:** ripple, ripple-gateways, ripple-api, ripple-client, ripple-trust


---

## 1 answers

### Answer by username_1 on 2018-05-16. Score: 1 | Accepted answer

for now there is none... you can only use single destination address


---

