Cartons | Separators | becf-11f07
3D Mockup

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 create custom dieline using the dieline template (becf-11f07) via the API, please make a
POST request to https://api.diecuttemplates.com/dieline-templates/becf-11f07/dielines


Code Examples



curl -i -X POST \
https://api.diecuttemplates.com/dieline-templates/becf-11f07/dielines\
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer <YOUR_DIELINES_API_KEY_HERE>" \
  -d '{
  "format": "pdf",
  "variables": {
    "unit": "in",
    "material": 0.4826,
    "length": 10.5,
    "width": 6.5,
    "number_of_pages": 4
  }
}'

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

url = URI('https://api.diecuttemplates.com/dieline-templates/becf-11f07/dielines')

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

request = Net::HTTP::Post.new(url)
request['Content-Type'] = 'application/json'
request['Dielines-Api-Version'] = '1.0'
request['Authorization'] = 'Bearer <YOUR_DIELINES_API_KEY_HERE>'
params = {
  "format": "pdf",
  "variables": {
    "unit": "in",
    "material": 0.11,
    "length": 4.25,
    "width": 3.00,
    "height": 5.00,
    "top_tuck_flap": 0.53
  }
}

request.body = params.to_json

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


$url = 'https://api.diecuttemplates.com/dieline-templates/becf-11f07/dielines';
$data = [
    "format" => "pdf",
    "variables" => [
      "unit" => "in",
      "material" => "0.4826",
      "length" => "10.5",
      "width" => "6.5",
      "number_of_pages" => "4"
    ]
];

$ch = curl_init($url);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Content-Type: application/json',
    'Authorization: Bearer <YOUR_DIELINES_API_KEY_HERE>'
]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));

$response = curl_exec($ch);

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

curl_close($ch);

Example Response

application/json
{
  "dieline": {
    "type": "dieline",
    "id": "ueipnpyp0rlw",
    "dieline_template_id": "becf-10301",
    "variables": {
      "unit": "mm",
      "length": 251.13,
      "width": 102,
      "height": 253,
      "material": 2.22
    },
    "format": "pdf",
    "url": "https://d2atdwxjx7uc4i.cloudfront.net/campaigns/0e9d742f-bdcd-4b41-8122-88e0426d263f20241218-14172-y29ocn.pdf",
    "artwork_dimensions": {
      "unit": "mm",
      "width": "723.06",
      "height": "502.44"
    },
    "created_at": "2024-12-18T19:27:22Z"
  }
} 



List of variables that are available for the template

Variable name length required
Description length
Data type length

Variable name width required
Description width
Data type length

Variable name finger_area optional
Description finger area
Data type length
Default value 0.9843 in

Variable name number_of_pages required
Description number of pages
Data type integer
Allowed values 1, 2, 3, 4, 5, 6, 7, 8, 9, 10

Variable name cross optional
Description cross
Data type boolean
Default value false
Allowed values true, false, 0, 1

Variable name edge_margin optional
Description edge margin
Data type length
Default value 0.6 in

Variable name corner_radius_1 optional
Description corner radius
Data type length
Default value 0.2 in

Variable name corner_radius_2 optional
Description corner radius
Data type length
Default value 0.2 in

Variable name page_width_1 optional
Description 1st page width
Data type length
Default value 2.325 in

Variable name page_width_2 optional
Description 2nd page width
Data type length
Default value 2.325 in

Variable name page_width_3 optional
Description 3rd page width
Data type length
Default value 2.325 in

Variable name page_width_4 optional
Description 4th page width
Data type length
Default value 2.325 in

Variable name page_width_5 optional
Description 5th page width
Data type length
Default value 0.0 in

Variable name page_width_6 optional
Description 6th page width
Data type length
Default value 0.0 in

Variable name page_width_7 optional
Description 7th page width
Data type length
Default value 0.0 in

Variable name page_width_8 optional
Description 8th page width
Data type length
Default value 0.0 in

Variable name page_width_9 optional
Description 9th page width
Data type length
Default value 0.0 in

Variable name page_width_10 optional
Description 10th page width
Data type length
Default value 0.0 in

Variable name dimension_texts optional
Description
Data type boolean
Default value true
Allowed values true, false



Read Dielines API documentation