Jump to content

How to integrate the spot price of gold and silver into my products price.

Recommended Posts

I have several products that I make out of gold and silver.

Each product has a base price, then you add the spot price of each metal using a calculation (i.e. pull through metals-api 1oz spot price and divide by 31.1 for gram price and multiply by the product weight and add to the base price to create the final price. 

Is that possible to do?

 

Link to comment
  • Replies 3
  • Views 513
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

On Squarespace, product prices must be fixed. They cannot be adjusted with code.

Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥.
Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. 
Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links.
Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.

Link to comment
On 4/5/2023 at 10:41 AM, EZKEEL said:

I have several products that I make out of gold and silver.

Each product has a base price, then you add the spot price of each metal using a calculation (i.e. pull through metals-api 1oz spot price and divide by 31.1 for gram price and multiply by the product weight and add to the base price to create the final price. 

Is that possible to do?

Yes, it is definitely possible to use an API such as metals-api to retrieve the current spot price of gold and silver, and then use that information to calculate the final price of your products. Here is a general outline of the steps you could take:

  1. Determine the base price of each product.
  2. Use the metals-api to retrieve the current spot price of gold and silver.
  3. Convert the spot price from ounces to grams (if needed).
  4. Multiply the spot price per gram by the weight of the product to determine the metal cost.
  5. Add the metal cost to the base price to determine the final price of the product.

You could automate this process using a programming language like Python, which can make API requests and perform calculations. Alternatively, you could use a spreadsheet program like Excel or Google Sheets to create a pricing template that automatically pulls in the spot price information and calculates the final price for each product.

 

Edited by ashu3131
Link to comment

Thank you for the quick reply.

Is there any way to adjust a static price through automation?

Like could I run a script on my end that would log into my squarespace account and adjust the price to something else?

My product is made of gold, price of gold changes everyday so I don't want to lose money when the price goes up. Trying to find an easier way than logging in everyday to change it.

Edited by EZKEEL
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.