Using Shopify ID as POS Member Number

ID design approach for linking online and offline customers

customer IDmember numbermappinglinking
5 min read

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

Separate ID systems
DetailsShopify and POS each have their own unique IDs
Need for linking
DetailsWant to identify same customer in both systems
Avoid new systems
DetailsDon't want to create a new system for ID management
Reduce operational load
DetailsManual ID mapping is impractical

Solution: Shopify ID as Member Number

ID Mapping Concept
Shopify side

Customer ID = gid://shopify/Customer/8840734670934

Extract numeric part

8840734670934 (numeric part of Shopify ID)

POS side

Member number (customerNo) = 8840734670934

During matching

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.

Prefix
Valuegid://
DescriptionGlobal ID prefix
Platform
Valueshopify
DescriptionPlatform name
Resource type
ValueCustomer
DescriptionResource type
Numeric ID
Value8840734670934
DescriptionThis is used as member number

Format: gid://shopify/Customer/8840734670934

Extracting Numeric Part

ID Extraction Flow
Input

gid://shopify/Customer/8840734670934

Extraction process

Extract everything after the last "/"

Output

8840734670934 (approximately 17-digit number)

Point: This number becomes the POS member number

Registering Member Number to POS

Registration Timing

Online member registration

Customer completes online membership registration

Create Shopify customer

Create customer via Shopify Admin API, ID is issued

Extract numeric part

Extract numeric part from GraphQL format ID

Create/update POS customer

Register extracted number as member number in POS

POS Data Structure

Member number
Value8840734670934
NotesNumeric part of Shopify customer ID
Name
ValueTaro Yamada
Notes-
Email address
Valueyamada@example.com
Notes-
Point balance
Value1250
Notes-
Member rank
ValueGold
Notes-

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

Matching Process Flow
Login online

Shopify customer ID is stored in session

Point balance request

Shopify ID: gid://shopify/Customer/8840734670934

Extract numeric part

8840734670934

Search member number in POS

Search with member number = 8840734670934

Get customer data

Point balance: 1250pt

Return result

Display points on screen

Benefits of This Design

Development Perspective

No additional DB
DetailsDon't need to create database for mapping table
Simple logic
DetailsMatching possible with just string-to-number extraction
Few failure points
DetailsSimple mechanism is less likely to break
Easy maintenance
DetailsEasy to understand and hand off

Operations Perspective

Automatic linking
DetailsLinking completes automatically at registration
No manual work
DetailsNo manual ID mapping work needed
Immediately usable
DetailsAvailable at store upon registration completion
Data consistency
DetailsConsistency maintained with Shopify as master

Considerations

Member Number Digit Count

Shopify customer ID
ContentUp to about 18 digits
POS member number field
ContentVerification 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

Handling Existing Members
Store members before online launch

Existing member number: 00001 (sequential)

At online registration

Match by email -> Existing member found -> Overwrite member number with Shopify ID

After overwrite

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

Related Topics