This documentation page is intended for developers looking to integrate the Dielines API into their systems. If you have any questions, please get in touch.

Die Cut Templates provides a hosted API available via HTTPS.

Dielines API allows for generating custom dielines in PDF, DXF, and SVG formats, along with 3D mockups.

To retrieve nesting templates (also known as imposition or layout templates) for a dieline, you first need to create a dieline. Once you have the dieline ID, you can fetch the list of available nesting templates filtered for that specific dieline configuration.

Please make a
GET request to https://api.diecuttemplates.com/dielines/{dieline_id}/nesting-templates


Code Examples



curl -i -X GET \
https://api.diecuttemplates.com/dielines/di_fwe4iu3vngty/nesting-templates \
  -H 'Authorization: Bearer <YOUR_DIELINES_API_KEY_HERE>' \
  -H 'Dielines-Api-Version: 1.0'

require 'uri'
require 'net/http'
require 'openssl'

url = URI('https://api.diecuttemplates.com/dielines/di_fwe4iu3vngty/nesting-templates')

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request['Dielines-Api-Version'] = '1.0'
request['Authorization'] = 'Bearer <YOUR_DIELINES_API_KEY_HERE>'

response = http.request(request)
puts response.read_body

$url = 'https://api.diecuttemplates.com/dielines/di_fwe4iu3vngty/nesting-templates';

$ch = curl_init($url);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Dielines-Api-Version: 1.0',
    'Authorization: Bearer <YOUR_DIELINES_API_KEY_HERE>'
]);

$response = curl_exec($ch);

if (curl_errno($ch)) {
    echo 'Error: ' . curl_error($ch);
} else {
    echo 'Response: ' . $response;
}

curl_close($ch);

Example Response

application/json
{
  "nesting_template_list": {
    "type": "nesting_template_list",
    "id": "ntl_kw4Z80qKP6",
    "dieline_id": "di_aretrmecuekx",
    "dieline_template_id": "becf-30203",
    "total": 2,
    "nesting_template_components": [],
    "nesting_templates": [
      {
        "type": "nesting_template",
        "id": "lt_NJYkRajK70",
        "nesting_template_components": [
          {
            "type": "nesting_template_component",
            "id": "hard-cardboard-of-the-box",
            "name": "Hard cardboard of the box",
            "category": "hard_cardboard"
          }
        ],
        "variables": [
          {
            "type": "dieline_template_variable",
            "name": "sheet_dimensions",
            "description": "Sheet dimensions including sheet_width, sheet_height, margin_top, margin_bottom and margin_side",
            "data_type": "sheet_dimensions",
            "required": true,
            "children": []
          },
          {
            "type": "dieline_template_variable",
            "name": "num_x",
            "description": "Number of dielines on the x axis.",
            "data_type": "integer",
            "required": false,
            "children": []
          },
          {
            "type": "dieline_template_variable",
            "name": "num_y",
            "description": "Number of dielines on the y axis",
            "data_type": "integer",
            "required": false,
            "children": []
          },
          {
            "type": "dieline_template_variable",
            "name": "margin_x",
            "description": "Horizontal spacing ",
            "data_type": "length",
            "required": false,
            "default_value": {
              "value": "0.0",
              "unit": "mm"
            },
            "children": []
          },
          {
            "type": "dieline_template_variable",
            "name": "margin_y",
            "description": "Vertical spacing",
            "data_type": "length",
            "required": false,
            "default_value": {
              "value": "0.0",
              "unit": "mm"
            },
            "children": []
          }
        ],
        "images": [
          {
            "type": "svg",
            "url": null
          }
        ],
        "links": [
          {
            "rel": "create_nesting",
            "href": "/dielines/di_aretrmecuekx/nestings/lt_NJYkRajK70",
            "method": "POST"
          }
        ]
      },
      {
        "type": "nesting_template",
        "id": "lt_2lY22jOYP6",
        "nesting_template_components": [
          {
            "type": "nesting_template_component",
            "id": "hard-cardboard-of-the-box",
            "name": "Hard cardboard of the box",
            "category": "hard_cardboard"
          }
        ],
        "variables": [
          {
            "type": "dieline_template_variable",
            "name": "sheet_dimensions",
            "description": "Sheet dimensions including sheet_width, sheet_height, margin_top, margin_bottom and margin_side",
            "data_type": "sheet_dimensions",
            "required": true,
            "children": []
          },
          {
            "type": "dieline_template_variable",
            "name": "num_x",
            "description": "Number of dielines on the x axis.",
            "data_type": "integer",
            "required": false,
            "children": []
          },
          {
            "type": "dieline_template_variable",
            "name": "num_y",
            "description": "Number of dielines on the y axis",
            "data_type": "integer",
            "required": false,
            "children": []
          },
          {
            "type": "dieline_template_variable",
            "name": "margin_x",
            "description": "Horizontal spacing ",
            "data_type": "length",
            "required": false,
            "default_value": {
              "value": "0.0",
              "unit": "mm"
            },
            "children": []
          },
          {
            "type": "dieline_template_variable",
            "name": "margin_y",
            "description": "Vertical spacing",
            "data_type": "length",
            "required": false,
            "default_value": {
              "value": "0.0",
              "unit": "mm"
            },
            "children": []
          }
        ],
        "images": [
          {
            "type": "svg",
            "url": null
          }
        ],
        "links": [
          {
            "rel": "create_nesting",
            "href": "/dielines/di_aretrmecuekx/nestings/lt_2lY22jOYP6",
            "method": "POST"
          }
        ]
      }
    ]
  }
} 


Response Object

Returns a nesting_template_list object containing:

type string "nesting_template_list"
id string Unique identifier for the nesting_template_list
dieline_id string Unique identifier for the dieline
dieline_template_id string Unique identifier for the dieline template
total integer Total number of nesting templates in the list
nesting_templates [nesting_templates] Array of nesting templates with links for creating nestings

Read Nesting Templates API documentation