The situation
Yeprem is a luxury jewellery brand with boutiques across the Middle East and a clientele that does not respond well to the phrase 'we're sorry, that item was actually sold in our Dubai boutique.' The e-commerce platform had to be held to a standard appropriate for what it sells: absolute inventory accuracy, zero transaction errors, and a purchasing experience that communicates the same premium quality as a physical boutique visit. The core technical challenge is this: Yeprem's boutiques sell in real time. A sales associate in Riyadh can complete a sale on a piece that a customer in London has in their checkout basket. Without real-time inventory sync and checkout-time stock reservation, that London customer completes payment — and then gets an apology email. We built two things to prevent this. First, real-time ERP integration: every boutique sale triggers a webhook that updates the web store's inventory within seconds. Second, database-level transaction locking on the checkout flow itself: when a customer initiates payment, their selected items are locked at the database row level for the duration of the transaction — no concurrent checkout can touch them. If the lock can't be acquired (someone else is checking out the same item), the customer is told immediately before payment, not after. The result is a platform where it is technically impossible to sell a piece of jewellery twice.
What had to change
Boutique sales happen in real time, independently of the web store. Previous system updated web inventory on a 24-hour batch sync — meaning items could appear available online for up to a day after being sold in-store. High-ticket item overselling was an occasional reality that damaged client relationships and required manual intervention every time.
What we changed
Webhook-driven ERP integration: boutique systems fire events on every completed sale, updating web store inventory within seconds. SELECT FOR UPDATE transaction locking at payment initiation — the row-level lock is held for the transaction duration. Concurrent checkout attempts on the same item fail early (before payment) with a clear message. Zero oversells since launch.
What the client gained
- 01 Physically impossible to oversell — row-level DB locking
- 02 Real-time ERP sync — boutique sales reflected in seconds
- 03 Arabic RTL and English storefronts both first-class
- 04 Security-first API design for luxury-scale transactions