Jump to content

Calling Squarespace API in code block?

Recommended Posts

So I have a question. Would I be able to call the Squaresapce API through javascript thats in a code block?

As of now I have a code block which contains quite a large script and it basically involves the user adding products to an order list, but in a certain way (without going too much into the details).  The problem is that this order list is not in any way associated with products I have in my store. What I want is that when a user adds one of theese products in the code that runs in the code block, the shopping cart should be updated. Like is it possible to add a line of code in the code block that does something like the following:

When a user adds a component :

javascript pseudo code:




Link to comment
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

I am not sure that I fully understand your question (a link to the site may help) but to add products to the Squarespace cart, they must have been created as products on a Squarespace store page.

Improve your online store with our extensions.
About: Squarespace Circle Leader since 2017. I value honesty, transparency, appreciation and great design ♥.
Work: Squarespace Developer and founder of SF Digital, building the features Squarespace didn't include™.
Content: Links in my posts may refer to SF Digital products or may be affiliate links.
Catch up on all the release notes and announcements 2023 [for Circle members only] (there's a public version here)

Buy me a coffee

Link to comment


Yes I do understand that I need to add the products to my site, but the way I want to add them / remove them to/from the customers cart is where I am thinking of the possibility of using the Squarespace API to accomplish this. 

A link to the site is here:

When entering the site, select a couple of floors, and select how many rooms there are for each floor and press the generate button. 

What I am trying to accomplish is that when a user clicks on the "Add Component" button in a room and selects one, that item should be added to the cart. This should also work for removing the item and updating the amount. 



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.