Assign order fulfillment location before order is created

Hi,

I was wondering if I can set advanced rules for fulfilling orders, like “orders from zip codes 1, 2 and 3 are fulfilled from location X, orders from zip codes 4, 5 and 6 are fulfilled from location Y”, so Shopify can assign correctly the fulfillment location before the order is created. Changing the location manually after the order creation is no good for us, because we have integrations that run based on the webhook event of the creation of a new order, so we need it to be correctly assign at that time.

An ideal scenario would be to have some sort of middleware that runs before the webhook event is triggered, so the integrations can run smoothly. This middleware could be an application from the Shopify store or a custom-made one, or any other way to get this done.

Thanks!