I want to auto fill state and City. When i enter zip code in magento 2 checkout shipping address.
2 Answers
This functionality doesn't come out of box with Magento 2 but you can implement this.
You'll need to add all the pincodes in a table with State and City name.
You might get this list online or APIs are also available to do so.
I'll prefer to store this data on your database as this will be a constant information and will give you better performance and control.
Then create a ajax controller to return city and state information based on given pincode which you can fetch from db or API.
Write js function to update the form.
I hope this will be helpful.
Let me know if you stuck somewhere in implementation.
There is a plugin called Wezz Postcodem2 (https://github.com/wezzco/postcode-m2) but that one only works for addresses in the Netherlands.
You could look into Google Address Magento 2 plugins but as i have seen most of them support only auto completion for Streetname. I haven't looked to far into it so maybe it does have some kind of possibility for the function you want.