How can I split online sales with my dealers based on customer area code?

I may have a unique situation and hopefully someone can point me in the right direction. I have a network of US dealers that buy wholesale from me, stock and sell my products to retail through physical locations. I also sell direct to retail through shopify. I would like to give my dealer network a cut of each sale based on the purchasing customers area code so they do not feel slighted for me “stealing” a potential sale from them. Is there an app for that?

There are lot of apps are very you differently handle your business