The subscription service ReCharge doesn't offer multi-currency support, so when customers purchase items from within the Recharge portal instead of our regular website, they can access the products at different prices than what we intended. I've been trying to solve this several ways, but most recently I am trying to create a script that simply detects when there is a new international order, checks if the order has a 'Subscription' tag, and if so, compares the sale price to the fixed price saved in our shopify markets settings. If the sale price was more than $1.5 above/below the fixed price (with a 10% discount applied to the fixed price because its a subscription), it should add a tag to the order (something like 'PRICE-CHECK-PENDING'), and send an email notifying me. I first ran into issues because the fixed prices don't seem to be easily accessible from within a mechanic script, so I tried adding the fixed prices as a custom variant metafield, but couldn't get that working either. So I tried manually defining a 'dictionary'-like object in the script that stores the fixed prices for each product, but no luck yet with that either. Here's the code I'm currently working on: --- name: "USD subscription price check" author: "LR" options: fixed_usd_prices: "gid: //shopify/ProductVariant/41XXXXXXXXXXX ": 54.50 "gid: //shopify/ProductVariant/41XXXXXXXXXXX ": 88.50 . . . discount_percent: 0.10 # 10 % off list threshold_abs: 1.50 # tolerance in USD dollars review_tag: "PRICE-CHECK" # order-level flag tag debug: false # true → echo diagnostics events: - shopify/orders/paid --- {% comment %} Task purpose: guard against mispriced subscription orders paid in USD. On each paid-order event, detect international subscriptions, compare each line‑item’s unit price to the expected discounted list price, and tag the order when any variance exceeds the configured absolute threshold. {% endcomment %} {% assign fixed_prices = options.fixed_usd_prices %} {% assign discount_pcent = options.discount _percent | times: 1.0 %} {% assign discount_mult = 1 | minus: discount_pcent %} {% assign threshold = options.threshold_abs | times: 1.0 %} {% assign review_tag = options.review _tag %} {%- comment -%}--------- subscription detection ----------{%- endcomment -%} {% assign is_subscription = false %} {% for li in order.line_items %}{% if li.selling_plan_allocation %}{% assign is_subscription = true %}{% break %}{% endif %}{% endfor %} {% if order.tags contains "Subscription" %}{% assign is_subscription = true %}{% endif %} {% if order.source_name == "subscription_contract" %}{% assign is_subscription = true %}{% endif %} {% for na in order.note_attributes %}{% if na.name == "rc_subscription_ids" and na.value != blank %}{% assign is_subscription = true %}{% break %}{% endif %}{% endfor %} {% if is_subscription and order.presentment_currency == "USD" %} {%- comment -%}--------- price verification ----------{%- endcomment -%} {% assign flag = false %} {% for item in order.line_items %} {% assign gid = item.variant.admin_graphql_api_id %} {% assign fixed = fixed_prices[gid] | times: 1.0 %} {% if fixed > 0 %} {% assign expected = fixed | times: discount_mult %} {% assign diff = expected | minus: item.price | abs %} {% if diff > threshold %}{% assign flag = true %}{% endif %} {% if options.debug %}{% echo "#{{ item.sku }} fixed: ${{ fixed }} expected: ${{ expected }} actual: ${{ item.price }} diff: ${{ diff }}" %}{% endif %} {% endif %} {% endfor %} {% if flag %} {% action "shopify" %} mutation { tagsAdd(id: {{ order.admin_graphql_api_id | json }}, tags: [{{ review_tag | json }}]) { userErrors { field message } } } {% endaction %} {% if options.debug %}{% echo "Added tag {{ review_tag }} to order #{{ order.name }}" %}{% endif %} {% endif %} {% endif %}