The problem
Two pricing jobs that kept going wrong by hand.
A trade lighting brand sells retail and wholesale from one Shopify store. Its sales ran by hand: change the prices when the sale starts, then find and restore every original price and compare-at price when it ends. Any variant that got missed kept its sale price.
Once Metra was running those sales, the merchant raised a second problem. The store’s B2B catalog applied its percentage discount to whatever the current price was, so a retail sale quietly cut wholesale prices too. A $100 product at a 20% trade discount should stay $80; a 30% retail sale dragged it to $56.
Retail promotion
$70
$100 − 30%. Retail gets the sale, as intended.
Wholesale without Trade Lock
$56
$70 − 20%. Both discounts stacked.
Wholesale with Trade Lock
$80
$100 − 20%. Agreed wholesale discount off original retail.
Illustrative pricing math, not measured merchant savings.
What was built
Metra Price Automation, built by Eryn Tech.
We built Metra as a Shopify app that schedules sale prices and restores the originals when each sale ends. The merchant picks products, variants, or a collection, previews every new price, and sets a start and end time. When the sale ends, Metra puts back each variant’s price and compare-at price and records the result variant by variant.
Trade Lock came next, at the merchant’s request. It keeps B2B catalog prices at the agreed discount off original retail while any sale runs.
Engineering approach
Ending a sale is harder than starting one
Restoring a price sounds like writing the old value back. But during a sale, the merchant or another app may change a price on purpose. Before restoring a variant, Metra checks whether its price or compare-at price changed during the sale. If it did, Metra leaves it alone and marks it “Changed during sale” in the results.
Two sales on the same products could undo each other’s prices, so Metra blocks a sale whose window overlaps another. The preview uses the same price math as the job that applies the sale, so what the merchant reviews is what goes live. A scheduler checks every minute for sales to start or end, and the work runs in Sidekiq background jobs through Shopify’s GraphQL API.
Trade Lock has to hold whatever changed the price
Trade Lock monitors product pricing and uses price and compare-at price signals to identify relevant changes. A sale can come from Metra, a manual edit, a Matrixify import, or another app, and the B2B price should stay at the agreed discount off original retail either way.
The results
From a merchant’s manual sales to a live Shopify product.
- Metra has been on the Shopify App Store since May 2026. Source: App Store listing
- A trade lighting merchant schedules its sales with Metra. Source: Merchant account
- The same merchant asked for Trade Lock and runs it in its live store. Source: Merchant account
No revenue, conversion, or savings claims.
What this demonstrates
Most of the work in pricing automation happens after the price changes.
Starting a sale is the easy part. The real work was undoing it correctly: restoring the right prices without overwriting the merchant’s own edits, and holding a wholesale pricing rule while other tools changed the same prices.
Metra demonstrates Eryn Tech’s experience building Shopify applications around specific operational requirements, including pricing logic, background processing, and integrations with Shopify’s APIs.
Stack
- Shopify
- Shopify GraphQL API
- Ruby on Rails
- Sidekiq
- Background Jobs
- Pricing Automation