About This Article
To link online and offline customers, we adopted the idea of using Shopify's customer ID as the POS member number. This article explains the background of this design decision and implementation method.
Challenge and Solution
Challenges Faced
| Challenge | Details |
|---|---|
| Separate ID systems | Shopify and POS each have their own unique IDs |
| Need for linking | Want to identify same customer in both systems |
| Avoid new systems | Don't want to create a new system for ID management |
| Reduce operational load | Manual ID mapping is impractical |
Solution: Shopify ID as Member Number
Customer ID = gid://shopify/Customer/8840734670934
8840734670934 (numeric part of Shopify ID)
Member number (customerNo) = 8840734670934
Shopify ID -> Extract number -> Search by POS member number -> Identify customer
Why We Chose This Approach
Comparison with Other Options
Reasons for Choosing Method 3
- Simplicity: No additional systems or databases required
- Reliability: IDs issued by Shopify are guaranteed unique
- Ease of operation: No mapping table maintenance
- Fault tolerance: Simple mechanism has fewer failure points
Shopify Customer ID Structure
GraphQL Format ID
Shopify customer IDs are returned in the following format via GraphQL API.
| Component | Value | Description |
|---|---|---|
| Prefix | gid:// | Global ID prefix |
| Platform | shopify | Platform name |
| Resource type | Customer | Resource type |
| Numeric ID | 8840734670934 | This is used as member number |
Format: gid://shopify/Customer/8840734670934
Extracting Numeric Part
gid://shopify/Customer/8840734670934
Extract everything after the last "/"
8840734670934 (approximately 17-digit number)
Point: This number becomes the POS member number
Registering Member Number to POS
Registration Timing
Customer completes online membership registration
Create customer via Shopify Admin API, ID is issued
Extract numeric part from GraphQL format ID
Register extracted number as member number in POS
POS Data Structure
| Field | Value | Notes |
|---|---|---|
| Member number | 8840734670934 | Numeric part of Shopify customer ID |
| Name | Taro Yamada | - |
| Email address | yamada@example.com | - |
| Point balance | 1250 | - |
| Member rank | Gold | - |
Point: Member number field is used as "storage for Shopify ID". Using POS standard functionality minimizes additional development
Processing During Matching
Flow When Retrieving Points
Shopify customer ID is stored in session
Shopify ID: gid://shopify/Customer/8840734670934
8840734670934
Search with member number = 8840734670934
Point balance: 1250pt
Display points on screen
Benefits of This Design
Development Perspective
| Benefit | Details |
|---|---|
| No additional DB | Don't need to create database for mapping table |
| Simple logic | Matching possible with just string-to-number extraction |
| Few failure points | Simple mechanism is less likely to break |
| Easy maintenance | Easy to understand and hand off |
Operations Perspective
| Benefit | Details |
|---|---|
| Automatic linking | Linking completes automatically at registration |
| No manual work | No manual ID mapping work needed |
| Immediately usable | Available at store upon registration completion |
| Data consistency | Consistency maintained with Shopify as master |
Considerations
Member Number Digit Count
| Check Item | Content |
|---|---|
| Shopify customer ID | Up to about 18 digits |
| POS member number field | Verification needed |
Pre-verification points:
- How many digits does POS member number support?
- Numbers only? Alphanumeric also?
- How are leading zeros handled?
- Verify POS field specifications to ensure Shopify ID fits
Handling Existing POS Members
Existing member number: 00001 (sequential)
Match by email -> Existing member found -> Overwrite member number with Shopify ID
New member number: 8840734670934, Point balance: Preserved as-is
Note: Consider saving old member number in separate field as history
Benefits of This Mechanism
As System Design
- Achieve linking without introducing additional complexity
- Consistent data management with Shopify as master
- Easy to accommodate future expansion (other system integrations)
As Business
- Foundation for omnichannel experience established
- Recognized as same customer across all channels
- Unified customer data analysis possible