Connecting UDS Loyalty Points to Shopify
A technical look at connecting the UDS loyalty system to Shopify using API. How we enabled dynamic point redemption in the shopping cart.
We built a custom integration to let customers redeem external UDS loyalty points directly inside the Shopify shopping cart.
Connecting UDS Loyalty Points to Shopify
Shopify API
UDS API
Custom App
AJAX/JavaScript
The Request
A client came to us with a specific need. They run a Shopify store and use UDS for their loyalty program. They wanted these two systems to talk to each other.
The goal was simple: allow customers to spend their UDS points when buying online.
The Challenge
Shopify has its own discount system, but it doesn't know what UDS is. UDS is an external service with its own database of users and point balances. There is no native "switch" to flip to make them work together.
Required Logic
The Solution
We asked for the UDS API documentation to see if this was possible. The documentation is open, which made things easier.
We broke the logic down into a few steps:
1. Identification
We added a custom input field in the cart. When a user types their code, our script sends a request to the UDS API.
It asks: "Does this user exist?" and "What is their balance?"
2. User Choice
If the user has points, we show them the balance. We added a simple interface where they can input the amount they want to use.
It's better than auto-applying everything because maybe they want to save some points for later.
3. Applying the Discount
This is the tricky part. Shopify needs to know that the price has changed.
Once the user confirms the amount, we effectively convert those points into a discount on the Shopify side.
How It Works in Practice
Customer enters UDS ID
AJAX request sent to UDS API for validation
System displays point balance
Shows available points and conversion rate
Customer selects amount
Manual input gives full control over points usage
Discount applied to cart
Cart total updates in real-time via JavaScript
Purchase completed
Points deducted from UDS account, order processed in Shopify
The Result
We confirmed with the client that this manual entry logic—where the user decides the amount—was exactly what they needed.