There is no "message" field in Bitcoin transactions, only the payment information is transferred on the network. While you can generate a label for a payment requests on your end, or include a label in the QR code for the benefit of the payer, neither would be transferred on the Bitcoin network. The proper way of distinguishing payments on Bitcoin is to give each payment a unique invoice address.
Instead of using plain Bitcoin Core, you may want to take a look at BTCPay Server, which is a self-hosted open-source payment processing solution that facilitates on-chain and Lightning Network payments. If you want to continue using Bitcoin Core, look into the listunspent
call.
H/T to @Anonymous and @darosior, whose comments I've collected to write this answer.
bitcoind
, look for thelistunspent
call exposed by the JSONRPC API.