The project is in a healthy, maintained state
spree_zip_autocomplete is a Spree extension that provides an API for address lookup by zipcode and auto-fills Spree::Address forms based on the input zipcode, supporting Japanese addresses.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

 Project Readme

SpreeZipAutocomplete

spree_zip_autocomplete is an extension for Spree that provides an API to search for addresses by zipcode. It also enables automatic form filling for Spree::Address forms based on the input zipcode.

Installation

Add the gem to your Spree Gemfile:

# Gemfile
gem 'spree_zip_autocomplete', path: 'engines/spree_zip_autocomplete'

Run the following commands:

bundle install
rails g spree_zip_autocomplete:install

API

Search for Address by Zipcode

Endpoint:

GET /api/v2/zip_autocomplete/search?zipcode={zipcode}

Notes:

  • The zipcode parameter can be in the format 1510051 or 151-0051.
  • This API only supports addresses in Japan.

Request:

curl -X GET "http://yourstore.com/api/v2/zip_autocomplete/search?zipcode=1510051" \
     -H "Content-Type: application/json"

Response:

{
  "zipcode": "1510051",
  "prefecture": "東京都",
  "city": "渋谷区",
  "town": "千駄ヶ谷",
  "state_id": 1214,
  "country_id": 347
}

License

This extension is available as open source under the terms of either:

Credits

Originally created by Vinsol. Fork maintained by be agile Co., Ltd..%