Which is the grammatically correct way to write this sentence?
Ask, we may just have what you are looking for.
Ask, we just may have what you are looking for.
We just may have what you are looking for
"just may" emphasises uncertainty about whether or not the item is in stock, I would interpret "just" here as meaning only. We only may have it.
We may just have what you are looking for
I would associate the word "just" with "have" rather than "may". Here "just" can mean "exactly" and "we may just have what you are looking for" means "we may have exactly what you want". Here the uncertainty being emphasised is not about what is in stock, but the suitability of the item, whether it is just what the customer wants.
Another possibility with "we may just have what you are looking for" is using just in the sense of "barely". We may have received a delivery in the last few minutes which we have yet to unpack. Again, the uncertainty could relate to the amount. If the customer asks for five pounds of carrots, and we know we have only about five pounds left in stock it would mean we may just have five pounds, but we certainly don't have six, and we might not even have five.
These both are correct, but the first sounds more natural to me. I think this could be something that changes depending on where you are the world.
This could also change with the mood, or theme, of what you are saying or writing