Subscription-based payments I'm writing a web application that will require subscription fees from users. I'd like to automate this process without relying heavily on 3rd party services (web-based wallets, etc).

Currently, this is how it is designed:


Web app connects to a websocket on the server using a JWT bearer token for authentication and requests an address.
The server calls the getnewaddress method to the RPC daemon and returns this address over the websocket
The wallet's pub (is priv necessary?) keys are stored in the webapp's database as well as the user that requested the address.
The websocket will provide periodic progress updates along with a refreshed JWT (tokens expire every 2 minutes) while waiting for the transaction. If the user disconnects, no harm done.


Once the transaction is completed, a curl command is triggered by walletnotify and submits this TXID to the web server, which ensures "confirmations" are > 0, and the "receive" address is used as the database query to determine which user added time to his/her subscription.

Questions:


Does getnewaddress generate a new wallet? Or am I free to receive as many as I'd like?
Running getbalance &lt;account&gt; shows the summation of all addresses listed in listaddressgroupings. Is this all usable from the same wallet?
How can I consolidate or remove addresses when they're no longer necessary? Do the BTC stay in the "account"?
getnewaddress will generate a new Bitcoin address for your existing wallet, Yes you can get as many as you like.  

I would use getreceivedbyaddress which returns the total amount received by the specified address in transactions with the specified number of confirmations or listunspent to get all transactions for specific address with confirmations

AFAICT, You can't remove an address from your wallet using any RPC call, but by editing wallet.dat manually.