Media editor: build vs buy in the age of AI
Polotno

PRINT ON DEMAND

Printful API: build a custom product designer with Polotno

Build on the Printful API with an embedded design editor that exports print-ready files and creates orders. Live demo and code included.

Polotno + Printful pairs Polotno's embedded design editor SDK with Printful's API and in-house production network. Your customers design products inside your app, your backend submits print files and orders to Printful, and Printful prints and ships from its own facilities.

Try it below. Design the shirt, then press Send to Printful. The demo exports the print file at Printful's size and shows the mockups Printful renders from it, with the API requests behind them. Nothing is ordered.

The full code, editor and server, is on GitHub: polotno-printful-demo. It runs on Polotno SDK, so it needs a Polotno API key. To compare it with the other print APIs, see the print on demand API comparison.

The problem Printful doesn't quite solve

Printful is the quality benchmark in print on demand: in-house facilities, tight QC, a mature API for products, files, and orders. And unlike most POD vendors, Printful has an answer for design: the Embedded Design Maker (EDM), an iframe of Printful's own designer you can place in your site.

For many stores EDM is enough. But teams building serious custom experiences run into its shape:

  • It's an iframe of Printful's designer. Your control over UI, flow, and branding ends at the frame border
  • The design data lives in Printful's system, in Printful's format, tied to Printful's catalog
  • One vendor's designer means one vendor's products; adding a second supplier means a second design stack
  • Templates, automation, and AI-generation workflows run through what the iframe exposes, not your code

Polotno is the alternative for teams that want the design layer as their infrastructure: an editor composed into your UI, design JSON in your database, and Printful as one (excellent) fulfillment endpoint behind it.

How to create Printful orders with the API

  • Design: Customer opens a template in the embedded Polotno editor, canvas sized to the print file spec of the Printful variant, which your backend reads from Printful's catalog.
  • Edit: Customer personalizes within your constraints: locked brand elements, bounded print zones, your fonts and asset libraries.
  • Export: Your app exports a print-resolution PNG (or renders it server-side with polotno-node) and hosts it at a URL Printful can fetch.
  • Order: Your backend creates the order via Printful's API, referencing the file URL against the variant and placement.
  • Fulfill: Printful prints in-house and ships. Status updates arrive on your webhook.

Polotno owns the creation experience and the design data. Printful owns production. Your backend connects the two.

What a request looks like

js
// 0. Backend: read the print file size from Printful's catalog.
const { result } = await fetch(
  `https://api.printful.com/mockup-generator/printfiles/${PRODUCT_ID}`,
  { headers: { Authorization: `Bearer ${PRINTFUL_API_TOKEN}` } },
).then((r) => r.json())
const printfileId = result.variant_printfiles
  .find((v) => v.variant_id === PRINTFUL_VARIANT_ID).placements.front
const printFile = result.printfiles
  .find((p) => p.printfile_id === printfileId)
// printFile.width × printFile.height is the print file size.

// 1. Export a print-resolution PNG from the design JSON.
//    Printful print files are spec'd per product and placement:
//    sRGB, 150+ DPI at print size.
const imageDataUrl = await store.toDataURL({
  pixelRatio: printFile.width / store.width,
  mimeType: "image/png",
})
const fileUrl = await uploadToYourStorage(imageDataUrl)

// 2. Create the order with the print file on the placement.
await fetch("https://api.printful.com/orders", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${PRINTFUL_API_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    recipient: {
      name: customer.name,
      address1: shipping.address1,
      city: shipping.city,
      country_code: shipping.country,
      zip: shipping.zip,
    },
    items: [
      {
        variant_id: PRINTFUL_VARIANT_ID,
        quantity: 1,
        files: [{ type: "default", url: fileUrl }],
      },
    ],
  }),
})
// 3. Confirm the order; Printful prints, ships, and posts status
//    updates to your webhook.

What Polotno handles vs. what Printful handles

Polotno (in your app)

  • Embedded, white-label editor composed into your own UI
  • Design JSON stored in your database: portable across vendors
  • Brand locking, templates, variable data, AI-driven generation
  • Print-file export at spec resolution, client- or server-side
  • One creative layer even if you fulfill through multiple vendors

Printful (backend)

  • In-house printing with consistent QC
  • 350+ product catalog
  • Warehousing and global fulfillment
  • Mockup generation API
  • Order status webhooks

Technical details

  • Export format: PNG at Printful's per-product print-file dimensions via store.toDataURL; batch export server-side via polotno-node or the Cloud Render API.
  • Placements: Printful accepts one file per placement (front, back, sleeve, label). Model each placement as a page or template in the design JSON and export separately.
  • Mockups: Pair Printful's Mockup Generator API with live Polotno previews. Polotno shows the editable design, Printful renders the on-product mockup for cart and checkout.
  • EDM coexistence: Teams migrating from the Embedded Design Maker keep the same order flow. Only the file source changes, from EDM output to your own export pipeline.
  • Handoff to Printful: POST the order with file URLs, confirm, listen for webhooks.

What you can build

Anything in Printful's catalog that takes a print file:

  • Apparel: DTG tees, embroidery, all-over prints
  • Wall art: posters, framed prints, canvases
  • Accessories: hats, bags, phone cases
  • Home & living: mugs, pillows, blankets

FAQ

Printful already has an Embedded Design Maker, why Polotno?

EDM is Printful's designer in an iframe: quick to add, bounded in control. Polotno is design infrastructure you own: your UI, your data, your automation, and vendor-neutral by design. Teams choose it when the design experience is core product, or when they fulfill through more than one vendor.

What file format does Printful expect?

PNG (or JPEG) print files at the product's spec'd dimensions, referenced by URL at order time. Polotno exports these from the design JSON.

Can I keep the design data?

Yes. That's the architectural difference. Every design is JSON in your database. Customers can re-edit, you can re-render, and nothing is locked to a vendor's format.

Does this work with Printful's mockup API?

Yes. Export the print file, request the mockup, show it at checkout, all from the same design JSON.

Is this self-serve yet?

Yes. Try the demo above, then start from its code with a Polotno API key and your own Printful account.

Start building

The code for the demo above is on GitHub: polotno-printful-demo. Clone it, add a Polotno API key (a trial key from your Polotno dashboard works) and your Printful API key, and the editor-to-order flow runs locally.

Skip the build, cut dev costs, launch faster

TRUSTED BY

100,000+

CREATORS

300+

BUSINESSES

ExpediaUnbounceLovePopPostGridPredis.ai