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
Problem: Storing as-is results in mixed "Tokyo" and "東京都"
Problems Without Normalization
Normalization Approach
Prefecture Conversion
(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
Implementation Considerations
Handling Unconvertible Cases
Bidirectional Considerations
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
Logging and Monitoring
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"
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