As far as I know, there is no single endpoint in horizon API that allows you to check the account's balance and/ or filtered by memo at the same time. If you want to differentiate incoming transactions by memo, what you can do is to use event streaming transactions for a particular account to extract the memo and consider injecting your logic in there, let me know what you want to exactly achieve. sample code using the javascript sdk below:
var StellarSdk = require('stellar-sdk');
var server = new StellarSdk.Server('https://horizon-testnet.stellar.org');
var notifyAccount = 'GATGC7IEHN6SBRPTEGIACCWXB6VHGVA7UYZGOIBE4LFXRSKYCLWO5QH3';
var txHandler = function (txResponse) {
console.log("new transaction activity");
//get memo here
console.log('memo: ' + txResponse.memo);
console.log('memo_type: ' + txResponse.memo_type);
server.accounts().accountId(notifyAccount)
.call()
.then(function (result) {
//check balance here
console.log(JSON.stringify(result.balances, null, 2));
})
.catch(function (err) {
console.error(err);
});
}
console.log("listening for transactions to address " + notifyAccount);
var transStream = server.transactions()
.cursor('now')
.forAccount(notifyAccount)
.stream({
onmessage: txHandler
});
OUTPUT:
listening for transactions to address GATGC7IEHN6SBRPTEGIACCWXB6VHGVA7UYZGOIBE4L
FXRSKYCLWO5QH3
new transaction activity
memo: testnow
memo_type: text
[
{
"balance": "0.0000000",
"limit": "10000.0000000",
"asset_type": "credit_alphanum4",
"asset_code": "PHP",
"asset_issuer": "GDENQQVYYVD4DWAF5243RLRW4GS7H2LAUM4VVRA2KDERFKP4N2XATCIJ"
},
{
"balance": "2000.0000000",
"limit": "10000.0000000",
"asset_type": "credit_alphanum4",
"asset_code": "USD",
"asset_issuer": "GD5SBDV5OXBPSIDOQ6HGBNRE67ASQ6RHHYVXG7R7ZVGPM4AEYMT6BD7L"
},
{
"balance": "0.0000000",
"limit": "10000.0000000",
"asset_type": "credit_alphanum4",
"asset_code": "USD",
"asset_issuer": "GDENQQVYYVD4DWAF5243RLRW4GS7H2LAUM4VVRA2KDERFKP4N2XATCIJ"
},
{
"balance": "406.1607919",
"asset_type": "native"
}
]