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>