Skip to content

Shopify Integration โ€‹

This page covers the full Shopify integration โ€” how the builder connects to your store's product, cart, and webhook system.

Architecture Overview โ€‹

Shopify Product Page
  โ””โ”€ "Create Gang Sheet" button
       โ””โ”€ Opens builder URL with ?variant=VAR_ID&size=22x48&shop=store.myshopify.com
            โ””โ”€ Customer builds layout
                 โ””โ”€ "Save & Add to Cart" clicked
                      โ””โ”€ POST /api/upload-gang-sheet โ†’ returns downloadUrl
                           โ””โ”€ GET /cart/add?id=VAR_ID&qty=1&properties[Gang Sheet File]=URL
                                โ””โ”€ Customer redirected to Shopify cart
                                     โ””โ”€ Checkout โ†’ Order placed
                                          โ””โ”€ Shopify webhook โ†’ backend email โ†’ you download & print

URL Parameters โ€‹

The builder reads the following URL parameters when launched from the product page:

ParameterDescriptionExample
variantShopify variant ID for the selected size?variant=43890123456
sizeSheet dimensions in WxH format (inches, no spaces)?size=22x48
shopYour Shopify store domain?shop=mystore.myshopify.com
quantityPre-fill the quantity field?quantity=2
priceOverride the price display?price=40.00

The button script on the product page constructs and passes these automatically.


Supported Sheet Sizes โ€‹

Sheet sizes are configured in the backend's tenant config (see Branding & White-Label). The default sizes are:

LabelWidthHeightDefault Price
22" ร— 12"2212$7.00
22" ร— 24"2224$20.00
22" ร— 36"2236$30.00
22" ร— 48"2248$40.00
22" ร— 60"2260$50.00
22" ร— 72"2272$60.00
22" ร— 84"2284$70.00
22" ร— 96"2296$80.00
22" ร— 108"22108$90.00
22" ร— 120"22120$100.00

Custom sizes

You can configure custom width/height combinations โ€” not just 22" wide. Update the sizes array in your tenant configuration on the backend.


Cart Line Item Properties โ€‹

When the customer clicks "Save & Add to Cart," the following properties are attached to the Shopify cart line item:

PropertyExample Value
Gang Sheet Filehttps://backend.com/api/download/abc123...
Sheet Size22" ร— 48"
_file_url(internal, hidden from customer)

These properties appear on your Shopify order detail page and packing slips.


Shopify Webhook โ€‹

Configure a single webhook to enable order notification emails:

  • Event: Order creation
  • Format: JSON
  • URL: https://your-backend-url.com/api/shopify/webhook/order-created

When the webhook fires after a customer checks out, the backend:

  1. Records the order in the database.
  2. Finds the gang sheet file associated with the order's variant.
  3. Sends you an email with the order details and a direct download link.

Webhook Security (Optional) โ€‹

For production, enable HMAC webhook verification:

  1. In Shopify admin, note the Signing secret for your webhook.
  2. Add it to your backend environment variables:
    env
    SHOPIFY_WEBHOOK_SECRET=your-secret-here
  3. The backend will verify the X-Shopify-Hmac-Sha256 header on every webhook request.

Adding More Sheet Sizes โ€‹

To add a new size:

  1. Add a Shopify variant to your gang sheet product with the new size as the option value.
  2. Note the new variant ID.
  3. Update the tenant config on the backend to include the new size with its variant ID mapping.
  4. Update the button script on the product page if needed to handle the new size format.
  5. Test by selecting the new size and launching the builder.

SaasyLlama โ€” Niche Apps. Built Different.