Question on getaccountaddress, getnewaddress, getAddressesByAccount I would like to get some feedback. I am new to the bitcoin development and I don't want to misunderstand something important before I start designing the application. I am working on bitcoin online-store integration. We are planning to show btc payment instructions to customers after order acknowledgment page so that they can send the payment from their private wallets. 

We want to create one address per transaction. (take Transaction No = "abc"). My plan: 


First call getaddressesbyaccount("abc"). If it returns blank address
list, then call getnewaddress("abc") to create new address for this
order. (Then create QR code and show to customer with expected
amount). 
Otherwise, if the getaddressesbyaccount("abc") returns an address,
use that returning address.


This page says "getaccountaddress will return the same address until coins are received on that address; once coins have been received, it will generate and return a new address.". 

I am planning not to use this function because if we expect 1 btc from the customer and he sends 0.5 btc, I don't want to create a new address. This is just to keep things simplified (1 address per 1 account). getaddressesbyaccount function returns a list of addressess associated with the account "abc". 
I find getaccountaddress redundant for my needs. Is there any benefit to "getaccountaddress" creating new address if the current address has balance on it? Do you see any pitfall with my logic. Your feedback is appreciated. 

Thank you,
I recommend that you do not use Bitcoin Core's internal accounting system because it is deprecated and will be removed in the future. Once it is removed, whatever code you have written that depends on it will be broken. Furthermore, the accounts system is not all that good.

I suggest that you instead maintain a separate database where you keep your own accounting system. That database would record each user's address and how much has been paid to that address. To figure out how much has been paid to each address, you would have a script that is called by -walletnotify which then looks up what address is being paid and how much for each transaction that you receive.



There are software that handle this sort of payment processing for you already that can be used with Bitcoin Core. One such software is BTCPay.