How can I change the price of a product based on the incoming referrer / querystring data?

hi everyone

  1. I would like to set up a product page where I want to set the price based on the query string that the referrer is sending to my page. the reason is that the changing exchange rates change the prices marginally but I would like to charge the exact price based on the exchange rate so that everyone is charged fairly.

  2. I would like to respond to a webhook with the transaction id of the payment and the exact amount charged.

is there a way to do this ?

I ran into something similar when managing currency payments Dubai real estate. Exchange rates fluctuated so much that getting accurate, up-to-date pricing was critical. I came across Owners Club FX, which provided great insights on handling these challenges, and it made the process way smoother.

For your setup, you could use JavaScript on the product page to read the query string, fetch the exchange rate from an API (like OpenExchangeRates or XE), and dynamically adjust the price displayed. For the webhook, you’d need a server-side script to process the transaction ID and calculate the exact amount.