---
title: "Add a photo book editor to Squarespace | Prodigi Studio"
description: "Add the Prodigi Studio photo book editor to Squarespace with code injection and a code block, then send customers to a product page to buy."
url: "https://studio.prodigi.com/help/squarespace"
---

# Add the photo book editor to Squarespace

Load the Studio embed script through code injection and add a code block where the editor should appear.

Squarespace has no API for adding items to the cart, so the example sends the customer to a product page with their Studio order reference. Your backend confirms it after payment.

## Squarespace example

```
<!-- Add via Settings > Advanced > Code Injection > Footer -->
<script src="https://studio.prodigi.com/embed.js" defer></script>
<script>
  window.addEventListener('DOMContentLoaded', function() {
    var container = document.querySelector('.studio-container');
    if (!container) return;

    PhotobookGenerator.create(container, {
      merchantId: 'YOUR_MERCHANT_ID',
      onComplete: function(payload) {
        // Squarespace doesn't support programmatic cart addition.
        // Redirect to a Squarespace product page with the Studio order
        // reference, which your backend confirms after payment with
        // POST /v1/orders/{reference}/submit.
        var productUrl = '/photobook-order?order=' + encodeURIComponent(payload.order.reference);
        window.location.href = productUrl;
      },
    });
  });
</script>

<!-- In your page content, add a Code Block with: -->
<div class="studio-container"></div>
```

## Other guides

-   [Add the photo book editor to any website](https://studio.prodigi.com/help/html-embed)
-   [Add the photo book editor to WordPress](https://studio.prodigi.com/help/wordpress)
-   [Add the photo book editor to Shopify](https://studio.prodigi.com/help/shopify)
-   [Add the photo book editor to Wix](https://studio.prodigi.com/help/wix)
-   [Create photo books with the Studio API](https://studio.prodigi.com/help/studio-api)
-   [Frequently asked questions](https://studio.prodigi.com/help/faq)
