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
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.
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
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
Operations Perspective
Considerations
Member Number Digit Count
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