About This Article
Since Shopify and POS use different address formats, storing them as-is causes issues with search and display. Japanese addresses in particular have prefecture names in different formats between English and Japanese. This article explains address data normalization.
Why Normalization is Needed
Address Format Differences Between Shopify and POS
| Field | Shopify (International Format) | POS (Japanese Format) |
|---|---|---|
| Country | Japan | - |
| Prefecture | Tokyo (English) | 東京都 (Japanese) |
| City | Shibuya | 渋谷区 |
| Address | 1-2-3 Dogenzaka | 道玄坂1-2-3 |
| Postal Code | 150-0001 | 150-0001 |
Problem: Storing as-is results in mixed "Tokyo" and "東京都"
Problems Without Normalization
| Problem | Example | Impact |
|---|---|---|
| Search mismatch | Searching '東京都' doesn't find 'Tokyo' | Customer search issues |
| Inconsistent documents | DM addresses mixed English/Japanese | Brand image degradation |
| Analysis difficulty | Same region counted separately in regional stats | Impaired business decisions |
| Delivery errors | Address format inconsistencies cause delivery issues | Reduced customer satisfaction |
Normalization Approach
Prefecture Conversion
| English | Japanese |
|---|---|
| Tokyo | 東京都 |
| Osaka | 大阪府 |
| Hokkaido | 北海道 |
| Kyoto | 京都府 |
| Aichi | 愛知県 |
| Kanagawa | 神奈川県 |
| Saitama | 埼玉県 |
| Chiba | 千葉県 |
| Hyogo | 兵庫県 |
| Fukuoka | 福岡県 |
(All 47 prefectures defined)
Conversion rules:
- Exact match conversion
- Case insensitive
- Keep original value if not found
Conversion Process Flow
Retrieve customer address information from Shopify
Convert English notation to Japanese notation
Combine prefecture, city, and street address
Save normalized address to POS
Conversion Details
Full Address Normalization
Province: Tokyo, City: Shibuya, Address1: 1-2-3 Dogenzaka, Address2: ABC Building 5F
Province: Tokyo → 東京都, City: As-is, Address: Keep original value
Address: 東京都 Shibuya 1-2-3 Dogenzaka ABC Building 5F
Note: Perfect Japanese conversion is difficult, so prioritize prefecture conversion and keep other values as input
Conversion Table Example
| English | Japanese | Note |
|---|---|---|
| Tokyo | 東京都 | Metropolis |
| Osaka | 大阪府 | Prefecture |
| Kyoto | 京都府 | Prefecture |
| Hokkaido | 北海道 | Territory |
| Aichi | 愛知県 | Prefecture |
| Fukuoka | 福岡県 | Prefecture |
| Okinawa | 沖縄県 | Prefecture |
Implementation Considerations
Handling Unconvertible Cases
| Case | Input Example | Handling | Reason |
|---|---|---|---|
| Province is empty | Province = "" | Save as empty | May not be a required field |
| Not in conversion table | Province = "Toky" (typo) | Save original value | Better to keep original than convert incorrectly |
| Non-Japan address | Country = "United States" | Save without conversion | No need to convert to Japanese format |
Bidirectional Considerations
| Sync Direction | Conversion Content |
|---|---|
| Shopify → POS | Convert English → Japanese |
| POS → Shopify | Convert Japanese → English (when needed) |
Considerations:
- Conversion is not reversible ("渋谷区" → "Shibuya" is complex)
- Store original data in separate field (original_address metafield, etc.)
- Basically one-way from Shopify → POS
Maintaining Data Quality
Validation Rules
| Field | Rule | Error Handling |
|---|---|---|
| Postal code | 7-digit number (remove hyphens) | Warning log, save value |
| Prefecture | Exists in conversion table | Save original if conversion fails |
| Full address | Not empty | Warning log if empty |
Logging and Monitoring
| Log Item | Normal Case | Conversion Failure Case |
|---|---|---|
| type | address_normalization | address_normalization |
| status | success | partial_failure |
| input.province | Tokyo | Toky |
| output.prefecture | 東京都 | Toky |
| warning | - | Province not found in conversion table |
Monitoring alert: Notify when conversion failure rate exceeds threshold
Operational Notes
Customer Address Changes
Customer updates address in Shopify My Page
Detect change via Webhook
Apply English → Japanese conversion
Save normalized address to POS
Considerations:
- Change timing (real-time or batch)
- Conflict possibility (simultaneous change at store)
- History retention (keep old address for delivery history)
Allowing Manual Corrections
Example of imperfect auto-conversion: "東京都 Shibuya 1-2-3"
| Method | Details |
|---|---|
| Manual correction in POS admin | Admin corrects to proper address |
| Prioritize manual value after correction | Prioritize manual correction over auto-sync |
| Prevent overwrite | Consider setting to not overwrite on next sync |
Operational rules:
- Manual correction OK for obvious errors
- Keep record of corrections
- Enable "Protect manual corrections" in sync settings
Benefits of This Normalization
Data Quality
- Prefectures stored in unified format
- Search and aggregation work accurately
- Improved document output quality
Operational Efficiency
- Reduced address-related inquiries
- Prevention of delivery issues
- Regional analysis becomes possible