Hello!
When setting up the event subscription, you should be able to set the scope to:
All users in the account
All users in the account and subaccounts
Only users who have installed this app
For your scenario, you could select 'All users in the account' and you should only receive events for the master account. To receive events for a subaccount, you would need to install the application on that subaccount.
Alternatively, you could subscribe to the account and subaccount and have your app filter inbound events based on account.
Thank you! I hope this helps.
Rick