We’re building an e-commerce platform for Saudi Arabia and would like to understand the recommended Shopify architecture for our use case.
Our requirements are:
We want to use Shopify as our product catalog and inventory management system.
Customers should complete checkout using payment methods available in Saudi Arabia, such as Mada, Tamara, Tap Payments, Apple Pay, and Google Pay.
Before payment, we need to apply:
Shopify discount codes,
promotional discounts,
our own Loyalty Points system (stored in our backend),
and other custom business rules.
Our questions are:
Is there an officially supported way to use the standard Shopify Checkout while also applying our own Loyalty Points that are managed outside Shopify?
If yes, what is the recommended approach? Should we use Shopify Functions, Checkout Extensions, Discount Functions, Storefront API, or another mechanism?
If our business logic cannot be fully implemented within Shopify Checkout, is it officially supported to build our own custom checkout in our middleware, process payments through our own integrations (such as Tap, Tamara, Mada, Apple Pay, and Google Pay), and then create the order in Shopify via the Admin API after successful payment?
If we choose this architecture, would Shopify still be the recommended solution for product management, inventory, and order fulfillment, while our middleware handles checkout and payments?
We’re looking for the Shopify-recommended and officially supported architecture rather than workarounds.
I will say that Shopify is like the foundation, the theme is like the home design, and other things like customer points are like putting appliances and furniture in the home.
You have 3 basic layers:
Shopify core system
Store Theme to present your store
Apps from the Shopify App Store
So in Shopify your loyalty program is most likely going to come from a Loyalty App. The App Store has all kinds of apps you can integrate with your store. Some apps are free, some have monthly fee based on order volume. There are also discount and sales apps, but Shopify does have native Discounts in the Admin.
Adding to the above, the piece that usually decides the architecture here isn’t the loyalty points, it’s your local payment methods. Mada, Tamara and Tap each need to exist as payment providers on Shopify for your region. Tap and Tamara do have Shopify integrations, so confirm those are live for Saudi before assuming you need a custom checkout, because an unsupported local method is what most often forces people off standard Checkout.
On the points themselves: a Shopify Discount Function can apply the reduction inside standard Checkout, but Functions run on Shopify’s side and can’t call your external loyalty API in real time. They only see data you’ve already staged. So the pattern that works is, before the customer reaches checkout, push their redeemable balance into Shopify as a customer metafield or mint a one-off discount code server-side, then the Function reads that and applies it. It can’t phone home mid-checkout.
Discount codes, automatic promos and the Function-based points discount all stack and show the reduced total before payment, so applying before payment is fine as long as every reduction is a code or a Function, not a custom price you inject.
Are the points a fixed value (say 100 pts = 1 SAR) or a dynamic rule? That decides whether a discount code or a metafield-fed Function is the cleaner path.
Thanks for your suggestion! I understand that Shopify has many loyalty apps, and they work well for stores that are fully based on the Shopify ecosystem.
However, our situation is a bit different.
Our client already has an established ERP system connected to around 100 physical stores. The loyalty program is managed centrally in the ERP, and customers earn and redeem points both online and in offline stores. This ERP is the single source of truth for loyalty points.
The client doesn’t want to maintain two separate loyalty systems—one in Shopify and another in the ERP—as that would lead to synchronization issues and duplicated business logic.
Ideally, during Shopify Checkout, we would like to:
retrieve the customer’s loyalty balance from the ERP,
allow them to redeem some or all of their points,
combine that with Shopify discounts or coupon codes,
let the customer pay the remaining balance using supported Saudi payment methods.
Is there an officially supported way to integrate an external loyalty system like this into Shopify Checkout, or is the recommended approach to build a custom checkout while using Shopify only for products, inventory, and order management?
Thanks for your explanation. Our main challenge is that the loyalty balance cannot be synchronized periodically because it changes in real time across more than 100 physical stores and our online channels. Our ERP is the single source of truth, and the balance must always be retrieved live during checkout.
Is it officially supported for Shopify Checkout (using Shopify Functions or Checkout UI Extensions) to call our backend during checkout, retrieve the customer’s current loyalty balance from our ERP, let the customer redeem part of those points, and then continue with payment? Or are these extensions limited to data already available within Shopify?
For your requirements I’d recommend using Shopifys native checkout wherever possible. It gives you the best compatibility with Shopify features, apps, and future updates.
If your loyalty points and custom business rules cant be implemented using Shopify Functions or Checkout Extensions then a custom checkout with order creation via the Admin API is possible. Just keep in mind you will be responsible for maintaining the entire checkout flow and payment integrations yourself.
It’s easy to integrate with Tamara but you need a merchant account with us first. If you don’t already have an account, you can sign up by clicking on either of the following links or contact our commercial team to set it up for you. https://partners.tamara.co/