Create a design session
The storefront sends product, return URL, and customer references to WebPrintEditor.
Product pages can open the designer with the right template, size, and return path so customers can edit artwork without leaving the buying flow.
<iframe
src="https://www.webprinteditor.com/embed/{sessionId}"
title="Customize your design"
width="100%"
height="840"
allow="clipboard-write"
></iframe>The storefront sends product, return URL, and customer references to WebPrintEditor.
The editor opens with the selected product size, page setup, proofing guides, and starter artwork.
The buyer customizes text, images, clipart, colors, and layout without leaving the product page.
The final response contains a design ID, preview image, editable project, and print file links.
import crypto from "node:crypto";
const body = JSON.stringify({
"tenantId": "tenant_modern_print",
"productId": "product_business_card",
"returnUrl": "https://modernprint.example/cart",
"storefrontDomain": "modernprint.example",
"customerReference": "cart_line_123",
"startBlank": false,
"metadata": {
"storefront": "modernprint.example",
"productPage": "/products/premium-business-card"
}
});
const timestamp = Math.floor(Date.now() / 1000).toString();
const signature = crypto
.createHmac("sha256", process.env.WEBPRINTEDITOR_EMBED_SECRET)
.update(`${timestamp}.${body}`)
.digest("hex");
const response = await fetch("https://www.webprinteditor.com/api/embed/sessions", {
method: "POST",
headers: {
"Content-Type": "application/json",
"x-wpe-timestamp": timestamp,
"x-wpe-signature": signature
},
body
});
const session = await response.json();When the buyer clicks Finish Order, the iframe saves the design and sends the parent website a message containing the saved design ID, preview image, proof PDF, production PDF, and production SVG. The storefront stores those values on the cart or order line.
Attach the savedDesignId to the cart line so the print shop can reopen or locate the exact artwork.
Use previewUrl for cart thumbnails, order review, and customer confirmation screens.
Save productionPdfUrl and productionSvgUrl with the order for prepress and fulfillment.
Shopify, WooCommerce, custom carts, and POS systems can keep their existing payment flow.