Free Shipping Worldwide

Integration spec

Embed the designer. Keep your cart and your prices.

This is the reference for a patch maker or shop that puts the AI patch designer on its own pages. It lists every setting, script attribute and event field, and the typical way a Shopify store connects it to its own cart. The basic install is on the installation guide; the script loader and SDK are on the SDK page.

How it works

Your customer designs a patch with the AI on your page. When they press Get It Made, one of two things happens, depending on one account setting:

Checkout modeWhat Get It Made doesWho prices and charges
quote (default)Opens the quote form. The request is emailed to your quote address, and the customer gets a confirmation.You, by email, after the quote.
hostOpens no form. The designer sends the design and its choices to your page as the order_intent event.Your store, from your own variants and your cart. We send no price.

Host mode is part of the Scale plan. It is how DTF Virginia runs its Shopify pages.

Typical setup (Shopify)

  1. Sign up as a manufacturer and note your client key (it starts with mfr-), shown in the dashboard under your embed snippet.
  2. Dashboard, Settings: set your patch types, your backings, and (optional) hide prices so the designer shows none. Set your quote email as the fallback.
  3. On the Scale plan, tick Take the order in my own cart under "Where your quotes go".
  4. Add the script tag to each product page (one type per page, below). On Shopify, paste it into a Custom Liquid block or the theme file.
  5. Add the listener below to the theme. It maps the event to one of your variants and adds it to the cart.
  6. Set your prices in Shopify: one variant per type and size, with quantity breaks. We never see them.
  7. Place a test order. The design file link and its choices are on the cart line and on the Shopify order.
<script src="https://patchdesign.ai/embed.js"
        data-client="mfr-yourshop-com-1a2b"
        data-target="#patch-designer"
        data-patch-type="uv-leatherette"
        async defer></script>
<div id="patch-designer"></div>

Account settings

Set in the partner dashboard. Settings marked manufacturer apply only to mfr- keys.

SettingValuesWhat it does
checkoutModequote | hostManufacturer, Scale and up for host. quote opens the quote form. host sends the order_intent event instead. A plan that loses Scale goes back to quote.
hidePricingtrue | falseManufacturer, any plan. Lead-only mode: the designer shows no price and the quote confirmation prints none. Use it when your store does the pricing.
enabledPatchTypeslist of type idsWhich types appear. Empty means every type. A page can narrow this list with data-patch-type, never widen it.
pricingOverridesprice tableYour own prices per type, size and quantity, shown in the designer when prices are not hidden.
customPatchTypeslistYour own named types, priced from your table.
enabledBackingsper typeWhich backings each type offers.
enabledUvFinisheslistWhich UV base finishes you stock. Empty means every finish.
quoteEmailup to 5 addressesWhere quote requests go. Blank uses your sign-up email. Not used by host mode.
leadRoutesrulesPro and up. Sends each quote to a person by patch type, region or size.
safetyDailyLimit / safetyMonthlyLimitwhole numbersYour own cap on designs a day and a month. Default 100 and 2,000. You can only lower the plan limit, not raise it.
brand and lookcolors, logo, textName, logo, colors, greeting and example prompts. The embed carries your brand, not ours.

Script attributes

On the embed.js script tag. Only data-client is required.

AttributeDefaultWhat it does
data-clientnone (required)Your client key.
data-targetafter the script tagA CSS selector for the element to mount the designer in.
data-heightautoauto grows with the content, or a fixed number of pixels such as 720.
data-min-height640Minimum height in pixels.
data-max-height4000Maximum height in pixels when height is auto.
data-themeyour brandlight or dark. A hint only; your branding still applies.
data-referrernoneA short label for the placement, such as product_page.
data-patch-typeall enabled typesLocks this page to one type id, or a comma list. It narrows your enabled types and can never add one. Up to 3 locked pages on each plan below Custom; unlimited on Custom.

The pinned SDK script (patch-designer.sdk.v1.x.js) is a separate way to embed. A version you pin keeps the code it shipped with, so new attributes and events arrive in the next SDK version. The iframe loader above gets them at once. From v1.5.8 the SDK also reads the page lock: put patch-types="uv-leatherette" on the <patch-designer> tag, with the same rules and the same 3-page limit as data-patch-type. Host checkout works in the SDK too: the same patchdesign:order_intent event is dispatched on window, so the listener above works unchanged.

Events

The loader fires these on window and document. Read the payload from event.detail.

EventWhenPayload
patchdesign:viewThe designer finished loading.clientKey
patchdesign:generationThe customer generated a design.clientKey and details of the generation. No prompt text.
patchdesign:quote_submittedThe customer sent a quote (quote mode).clientKey, patchType, quantity
patchdesign:order_intentThe customer pressed Get It Made (host mode).The fields in the next section.

The order_intent event, field by field

Sent once per press. Sizes are always in inches. The event never carries a price.

FieldTypeMeaning
typestringAlways patchdesign:order_intent.
vnumberThe version of this payload. Currently 1. New fields are added without changing v; a change that breaks a field changes v.
clientKeystringYour key, so a page with two designers can tell them apart.
designIdstringThe id of this design in the chat. Quote it in support requests.
designNamestringThe customer's own description of the design, up to 300 characters.
imageUrlstring (https)The clean design as a PNG with a transparent background. A public link. See Design files.
patchTypestringA type id from the list below, or one of your own custom types.
materialstringThe type's display name, such as UV Printed - Leatherette.
width, heightnumberThe chosen size in inches. height equals width when the design is square.
unitstringAlways in.
quantitynumberHow many patches the customer chose. Null when none was chosen.
backingstringThe chosen backing label, such as Iron-on. Empty when none was chosen.
uvobject or nullUV orders only: base (leatherette, tpu or acrylic), finish (the color or finish name) and tpuColor.
commentsstringThe customer's notes, up to 1,000 characters.
customValuesobjectAnswers to the custom questions you set in your dashboard, keyed by question.
sessionIdstringOur id for the design session. Useful when you ask us about a design.
orderRefstringYour own quote number for this press (for example ICS-1042), also printed on the production files we email you. Empty if we could not record the order; the event is still sent.

Patch type ids

IdType
embroideredEmbroidered
wovenWoven
chenilleChenille
printedPrinted (sublimation)
leatherLeather
pvc-2dPVC, flat
pvc-3dPVC, raised
uv-leatheretteUV printed, leatherette base
uv-tpuUV printed, TPU base
uv-acrylicUV printed, acrylic base

A custom type you define in your dashboard has its own id, which is what the event reports for it.

Shopify: the cart code

The pattern below is what we hand a Shopify shop. Keep one variant per type and size, with quantity breaks as a Shopify price rule or a theme-side tier table. The listener maps the event to that variant and adds it to the cart. The cart then shows your price, and your checkout takes the payment.

// Theme code on the product page. Check the origin, never trust a price.
window.addEventListener('patchdesign:order_intent', async (e) => {
  const o = e.detail                       // the order_intent fields below
  const variantId = VARIANTS[o.patchType]?.[sizeKey(o.width, o.height)]
  if (!variantId) return showMessage('That size is not available.')

  await fetch('/cart/add.js', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      items: [{
        id: variantId,
        quantity: o.quantity,              // a quantity-break price rule prices it
        properties: {
          'Design file': o.imageUrl,
          'Design ID': o.designId,
          'Order ref': o.orderRef,
          'Size (in)': o.width + ' x ' + o.height,
          'Backing': o.backing,
          'Finish': o.uv ? o.uv.finish : '',
        },
      }],
    }),
  })
  window.location.href = '/cart'
})

Design files

FileWhere it comes fromNotes
imageUrlThe order_intent event.The design as generated, a PNG with a transparent background at the generator's size (about 1,000 pixels). Good for the cart and for review. Copy it to your own storage when the order is placed.
300 dpi print PNG, print PDF, vector (SVG, PDF, EPS), cut lines (SVG, PDF, DXF), UV specs and white underbase, production sheet, job sheet, ZIPThe production package we build when the customer presses Get It Made (host mode) or sends a quote (quote mode), and email to your quote address.Built at the ordered size, titled with your orderRef. Download links last one year. Which files each channel receives is set in your dashboard.

We do not promise a storage period for a design, so copy what you need when the order comes in. In host mode the package is built when the customer presses the button, not when your store takes payment, so an abandoned cart also produces one. Each build counts against a monthly build allowance that matches your plan. Match a package to a Shopify order by orderRef, which you add to the cart line.

Plans and limits

PlanDesigns a monthIncludes
Free20The embed, your branding, quotes to your inbox.
Starter200The above.
Pro1,000Spanish and German, lead routing rules.
Scale2,000Host checkout, the partner API and webhooks, the currency picker, brand guidelines.
Custom (Enterprise)No plan limitEverything in Scale, a fixed color list per type, and any number of type-locked pages.

Every image the AI makes counts as one design, edits included. Your own safety limits (100 a day, 2,000 a month by default) can only lower these.

Security checklist

Questions, or a platform other than Shopify? Contact us.