Skip to content

Templates

The template endpoints allow you to retrieve, create, update and delete templates in Printlane.

These endpoints help you to automatically synchronize externally managed template data, such as a Product Information Management system or a custom database. This integration eliminates the need without the need to manually create and update templates in Printlane Studio.

Integrating these endpoints in your software or service guarantee that new templates and updates are immediately available in Printlane.

Please take into account the best practices when implementing these API calls.

Changelog

Version 2023-10 (latest)

  • You can now use api version 2023-10
  • The domain name of all API endpoints has changed from colorlab.io to printlane.com.
  • header X-Colorlab-Shop has changed to X-Printlane-Store (notice the change from Shop to Store)
  • header X-Colorlab-Api-Key has changed to X-Printlane-Api-Key
  • header X-Colorlab-Api-Signature has changed to X-Printlane-Api-Signature
  • Please find the overview of all URL changes below:
    New URLOld URL
    https://api.printlane.com/2023-10/templateshttps://api.colorlab.io/2022-08/templates
    https://api.printlane.com/2023-10/templates/:templateIdhttps://api.colorlab.io/2022-08/templates/:templateId

Version 2022-08

  • You can now use api version 2022-08
  • all properties of the template object are now required. Empty properties should be sent as an empty string or null.

Version v1 (deprecrated)

Initial API version. Will be deprecated in August 2023. Please update your implementation to point to the latest API version.

Retrieving templates

To retrieve a list of templates currently in the store, use the GET http method to the following endpoint:

GET https://api.printlane.com/2023-10/templates

Verification string for API Signature

The verification string to generate the signature is Store ID.

Read here how to generate the X-Printlane-Api-Signature header with this verification string.

Example output
json
{
  "count": 2,
  "results": [
    {
      "_id": "62c7ef6cdb61038d8d79b67b",
      "name": "Smartphone Case",
      "productId": "smartphone-case",
      "shopify": null,
      "static": false,
      "_created": "2022-07-08T08:48:44.384Z",
      "_updated": "2022-10-18T09:50:53.434Z",
      "template": {
        "_id": "62c7ef61fe092a42b5bb83b3",
        "token": "6abc2b56-4b85-449c-85a3-3927d273568e"
      }
    },
    {
      "_id": "628de8e044954ccab38212d5",
      "name": "Business Card",
      "productId": "business-card",
      "shopify": null,
      "static": false,
      "_created": "2022-05-25T08:29:20.618Z",
      "_updated": "2022-05-25T13:44:47.071Z",
      "template": {
        "_id": "628de8e044954ccab38212d6",
        "token": "41d45422-10a2-40ba-b644-1a867e007aec"
      }
    },
  ],
  "total": 2
}

To navigate to the next page, use the skip query parameter:

GET https://api.printlane.com/2023-10/templates?skip=20

Retrieving a template

To retrieve a single template, use the following endpoint:

GET https://api.printlane.com/2023-10/templates/:templateId

And replace :id with the ID of the template.

Verification string for API Signature

The verification string to generate the signature is Store ID + Template ID.

Read here how to generate the X-Printlane-Api-Signature header with this verification string.

Creating a template

To create an template, use the POST http method to send a JSON payload to the following endpoint:

POST https://api.printlane.com/2023-10/templates

Verification string for API Signature

The verification string to generate the signature is Store ID.

Read here how to generate the X-Printlane-Api-Signature header with this verification string.

Example JSON payload
json
{
  "name": "Test template",
  "productId": "test-template",
  "shop": "589adada754c20089ed6cfd8",
  "shopify": null,
  "static": false,
  "synchronization": [],
  "views":[
    {
      "active": true,
      "addArtwork": {
        "active": false,
        "area": null,
        "export": true,
        "id": "view-front-add-illustration",
        "name": {
          "en": "Artwork"
        },
        "order": 2,
        "removable": true,
        "required": false,
        "section": 0,
        "selectable": true,
        "type": "illustration",
        "weight": 2,
        "allColors": true,
        "allowTransparent": true,
        "autoResize": "fit",
        "colorize": false,
        "colors": [],
        "draggable": true,
        "groups": [],
        "positionX": 600,
        "positionY": 1000,
        "resizable": true,
        "rotatable": true,
        "rotation": 0,
        "scale": 1,
        "scaleArea": null,
        "value": null
      },
      "addPicture": {
        "active": false,
        "area": null,
        "export": true,
        "id": "view-front-add-picture",
        "name": {
          "en": "Picture"
        },
        "order": 2,
        "removable": true,
        "required": false,
        "section": 0,
        "selectable": true,
        "type": "picture",
        "weight": 2,
        "allowedExtensions": [],
        "autoResize": "fill",
        "colorize": false,
        "colorizeToColor": null,
        "custom": [],
        "draggable": true,
        "fx": [],
        "positionX": 600,
        "positionY": 1000,
        "resizable": true,
        "rotatable": true,
        "rotation": 0,
        "scale": 1,
        "scaleArea": null,
        "value": null
      },
      "addText": {
        "active": false,
        "area": null,
        "export": true,
        "id": "view-front-add-text",
        "name": {
          "en": "Text"
        },
        "order": 2,
        "readOnly": false,
        "removable": true,
        "required": false,
        "section": 0,
        "selectable": true,
        "type": "text",
        "weight": 2,
        "align": "center",
        "allColors": true,
        "allFonts": true,
        "bold": false,
        "charSpacing": 0,
        "colors": [
          {
            "name": {
              "en": "Black"
            },
            "color": "#000000",
            "default": true
          },
          {
            "name": {
              "en": "White"
            },
            "color": "#ffffff",
            "default": false
          },
          {
            "name": {
              "en": "Red"
            },
            "color": "#fe5a49",
            "default": false
          },
          {
            "name": {
              "en": "Blue"
            },
            "color": "#40bdff",
            "default": false
          },
          {
            "name": {
              "en": "Yellow"
            },
            "color": "#ffe459",
            "default": false
          },
          {
            "name": {
              "en": "Green"
            },
            "color": "#2dcc70",
            "default": false
          }
        ],
        "curveRadius": 0,
        "curvable": false,
        "defaultFont": "6242d653ab7fe50011fee7f2",
        "draggable": true,
        "fonts": [],
        "fontsize": 225,
        "italic": false,
        "lineHeight": 1,
        "maxCharacters": 0,
        "maxFontsize": 450,
        "minFontsize": 45,
        "multiline": true,
        "origin": "cc",
        "positionX": 600,
        "positionY": 1000,
        "resizable": true,
        "rotatable": true,
        "rotation": 0,
        "value": {
          "en": "Your text"
        }
      },
      "allowRearrangeElements": true,
      "areas": [
        {
          "height": 500,
          "id": "area-1",
          "name": "Area 1",
          "width": 500,
          "x": 0,
          "y": 0
        }
      ],
      "cutOutMask": null,
      "elements": [
        {
          "active": false,
          "area": null,
          "export": true,
          "id": "picture",
          "name": {
            "en": "Picture"
          },
          "order": 1,
          "removable": true,
          "required": false,
          "section": 0,
          "selectable": true,
          "type": "picture",
          "weight": 0,
          "allowedExtensions": [],
          "autoResize": "fill",
          "colorize": false,
          "colorizeToColor": null,
          "custom": [],
          "draggable": true,
          "fx": [],
          "positionX": 600,
          "positionY": 1000,
          "resizable": true,
          "rotatable": true,
          "rotation": 0,
          "scale": 1,
          "scaleArea": null,
          "value": null
        },
        {
          "active": true,
          "area": null,
          "export": true,
          "id": "text",
          "name": {
            "en": "Text"
          },
          "order": 0,
          "readOnly": false,
          "removable": true,
          "required": false,
          "section": 0,
          "selectable": true,
          "type": "text",
          "weight": 1,
          "align": "center",
          "allColors": true,
          "allFonts": true,
          "bold": false,
          "charSpacing": 0,
          "colors": [
            {
              "name": {
                "en":"Black"
              },
              "color": "#000000",
              "default": false
            },
            {
              "name": {
                "en":"White"
              },
              "color": "#ffffff",
              "default": true
            },
            {
              "name": {
                "en": "Red"
              },
              "color": "#fe5a49",
              "default": false
            },
            {
              "name": {
                "en":"Blue"
              },
              "color": "#40bdff",
              "default": false
            },
            {
              "name": {
                "en": "Yellow"
              },
              "color": "#ffe459",
              "default": false
            },
            {
              "name":{
                "en": "Green"
              },
              "color": "#2dcc70",
              "default": false
            }
          ],
          "curveRadius": 0,
          "curvable": false,
          "defaultFont": "6242d653ab7fe50011fee7f2",
          "draggable": true,
          "fonts": [],
          "fontsize": 225,
          "italic": false,
          "lineHeight": 1,
          "maxCharacters": 0,
          "maxFontsize": 450,
          "minFontsize": 45,
          "multiline": true,
          "origin": "cc",
          "positionX": 600,
          "positionY": 1000,
          "resizable": true,
          "rotatable": true,
          "rotation": 0,
          "value": {
            "en": "Your text"
          }
        }
      ],
      "export": {
        "area": null,
        "areaType": "template",
        "custom": [],
        "dpi": 300,
        "exportTemplate": true,
        "exportCutOutMask": true,
        "filename": "[id]-[title]",
        "height": 0,
        "mergeDimensions": null,
        "mergeInFile": null,
        "mergePosition": null,
        "type": "pdf",
        "width": 0,
        "x": 0,
        "y": 0
      },
      "groupElements": false,
      "height": 2000,
      "id": "front",
      "name": {
        "en": "Front"
      },
      "required": false,
      "template": "634e8c3a648cbd13c26b338a",
      "weight": 0,
      "width": 1200
    }
  ]
}
Template properties
PropertyDescription
nameName of the template which will be displayed in Printlane Studio.
productIdYour reference to the template. This will be used to update the template later on. Must be unique per store.
shopYour Store ID.
shopifyContains links to Shopify products, leave null.
staticUnsupported API property. Keep value false.
synchronizationUnsupported API property. Keep value [].
viewsArray of views in the template (e.g. Front and Back). See View properties for each object in this array.
View properties
PropertyDescription
activeDefines which view will be active by default in the designer. Only 1 view in the array of views can be active.
addArtworkContains the same properties as the artwork layer properties. Allows the user to add his own artwork layer based on the defaults in this property
addPictureContains the same properties as the picture layer properties. Allows the user to add his own picture layer based on the defaults in this property
addTextContains the same properties as the text layer properties. Allows the user to add his own text layers based on the defaults in this property
allowRearrangeElementsAllow the user to rearrange layers in a layer modal
areasSee view areas properties below.
cutOutMaskUnsupported API property. Keep value null.
elementsArray of layers to be displayed in the designer for this view. See Layer properties for each object in this array.
exportSee view export properties below.
groupElementsBoolean, indicates if tabs in the designer should be grouped by type
heightThe height of the template in pixels
idA string representing a unique ID for this view. You can use this ID later toa access the view, e.g. to export a specific view from the designs created from this template.
nameAn object with the name of the view which will be displayed in the designer. Provide a translation for each language activated in your account.
requiredBoolean to indicate if a view is required. Marking a view as required will require the end-user to open the view in the designer before it's possible to add the design to the cart.
templateThe ID of the media object to display in the designer (see Uploading media)
weightThe order of the views as displayed in the designer. Ascending number, starting from 0. The lowest number will be displayed first.
widthThe width of the template in pixels
View export properties
PropertyDescription
areaThis property is required when areaType is area. A valid area id must be given here.
areaTypeDefines the export dimensions type. Could be template, custom or area.
customUnsupported API property. Keep value [].
dpiThe export dpi.
exportTemplateBoolean defining if the export should contain the template.
exportCutOutMaskUnsupported API property. Keep value null.
filenameDefault filename is [id]-[title]. You can use following tokens: [id] design id, [date] date in yyyy-mm-dd format, [title] configuration name, [product] template id`
heightRequired when areaType is custom. Defines the export height.
mergeDimensionsUnsupported API property. Keep value null.
mergeInFileUnsupported API property. Keep value null.
mergePositionUnsupported API property. Keep value null.
typeCould be pdf, png or pdf-simple (PNG-based PDF).
widthRequired when areaType is custom. Defines the export width.
xRequired when areaType is custom. Defines the export x position.
yRequired when areaType is custom. Defines the export y position.
View areas properties
PropertyDescription
heightArea height in pixels.
idUnique id for this area.
nameThe human readable name for this area.
widthArea width.
xX position of the area.
yY position of the area.
Layer properties
PropertyDescription
activeDefines which layer will be active by default in the view. Only 1 layer in the array of layers can be active.
areaDefine the area this layer is visible in. Only a valid area id from the areas property is allowed.
exportDefines if the layer should be included in design exports.
idYour unique ID for this layer. This can be used to access the layer later.
nameAn object with the name of the layer which will be displayed in the designer. Provide a translation for each language activated in your account.
removableAllows the user to delete this pre-defined layer.
requiredMarks a layer required, which will trigger a message in the designer if the end user doesn't have a value selected for this layer.
sectionDetermines where the layer is rendered. -1 = footer, 0 = body, 1 = header.
selectableDefines if the user is able to edit this layer.
typeDefines the layer type. This can be text, picture, illustration or background.
weightThe order of the layers as displayed in the designer. Ascending number, starting from 0. The lowest number will be displayed below all other layers, just like layers in Photoshop.
Layer (text) properties
PropertyDescription
alignDefault alignment of the text if multiple lines are used (left, center (default) or right)
allColorsAllows the user to add and use all colors.
boldBoolean indicating if the bold version of the font should be used.
colorsAn array of the colors displayed in the designer. Each color is defined as an object containing a name (object with translations for each language in your account), default (one color can be the default in the array) and the color (a hex string defining the color to be used).
draggableAllows the user to change the position of the layer.
italicBoolean indicating if the italic version of the font should be used. When combined with bold, the boldItalic version of the font is used
maxCharactersDefines the maximum amount of characters that can be entered. Set to 0 to allow unlimited characters.
maxFontsizeThe maximum font size of the text.
minFontsizeThe minimum font size of the text.
multilineAllow the user to enter multiple lines
resizableAllows the user to change the size of the layer.
rotatableAllows the user to rotate the layer.
positionXThe horizontal position of the text in pixels. Calculated from the top left corner of the view.
positionYThe vertical position of the text in pixels. Calculated from the top left corner of the view.
rotationThe initial rotation of the layer (0 - 360).
valueAn object with the default text value which will initially be displayed in the designer. Provide a translation for each language activated in your account.
Layer (picture) properties
PropertyDescription
autoResizeResize options how the picture should behave inside an area. Allowed values are none, fill and fit
draggableAllows the user to change the position of the layer.
positionXThe horizontal position of the picture in pixels. Calculated from the top left corner of the view.
positionYThe vertical position of the picture in pixels. Calculated from the top left corner of the view.
resizableAllows the user to change the size of the layer.
rotatableAllows the user to rotate the
.
rotationThe initial rotation of the
(0 - 360).
scaleThe initial scale of the picture (if a value is set)
scaleAreaDefine the area this
is scaled to. Only a valid area from the areas property is allowed.
valueThe ID of the Media object which is used as default value when opening the designer (see Uploading media).
Layer (illustration) properties
PropertyDescription
autoResizeResize options how the picture should behave inside an area. Allowed values are none, fill and fit
draggableAllows the user to change the position of the layer.
positionXThe horizontal position of the picture in pixels. Calculated from the top left corner of the view.
positionYThe vertical position of the picture in pixels. Calculated from the top left corner of the view.
resizableAllows the user to change the size of the layer.
rotatableAllows the user to rotate the layer.
rotationThe initial rotation of the layer (0 - 360).
scaleThe initial scale of the picture (if a value is set)
scaleAreaDefine the area this layer is scaled to. Only a valid area from the areas property is allowed.
valueThe ID of the Media object which is used as default value when opening the designer.
Layer (background) properties
PropertyDescription
allColorsAllows the user to add and use all colors.
allowTransparantAllows the user to select no color (transparent).
colorsAn array of the colors displayed in the app. Each color is defined as an object containing a name (object with translations for each language in your account), default (one color can be the default in the array) and the color (a hex string defining the color to be used).

Updating a template

To update a template, use the following endpoint:

POST https://api.printlane.com/2023-10/templates/:templateId

Verification string for API Signature

The verification string to generate the signature is Store ID + Template ID.

Read here how to generate the X-Printlane-Api-Signature header with this verification string.

And replace :id with the productId property that was used used when creating the template. The endpoint uses the exact same JSON payload as the create endpoint.

Deleting a template

To delete a template, use the following endpoint:

DELETE https://api.printlane.com/2023-10/templates/:templateId

Verification string for API Signature

The verification string to generate the signature is Store ID + Template ID.

Read here how to generate the X-Printlane-Api-Signature header with this verification string.

Deleting a template does not delete designs

Created designs based on this template won't be deleted. Referenced media documents are deleted automatically.