I want to create a jewelry store. I want the product price to be based off a markup of the current gold price from an external data source such as https://www.kitco.com/price/precious-metals/gold . Can anyone help with some tips on how to get started ?
Hi Kane213,
The way to achieve this would likely depend on how the product data of the external source is structured - eg: is there an API endpoint that you can access with a custom Shopify app that contains the data that your products should be based on? Does the kitco resource you linked have an API that you could use to query or export prie data? If so, you can use Shopify’s product update mutation to accept and display changes that are received from the external source. If not - you could look to find a reliable API that can be used to get info on the price of gold.
To apply a markup you could create a formula to calculate your jewelry prices based on the current gold price, which would be done before the product price updates on Shopify. For example, product_price = gold_price_per_gram x weight_in_grams x markup_percentage. Also, you’d need to host a custom Shopify app that would handle updating the product prices on a server (eg: Heroku).