The Dielines API lets you generate dielines and create interactive 3D mockups programmatically. This post walks through the full flow, from your first sandbox request to a hosted, rotatable mockup page.
If you prefer to watch first, here is a recent screencast that demonstrates the entire process end to end:
The examples below use curl, which is a command you run in a terminal (Terminal on macOS or Linux, Command Prompt or PowerShell on Windows). curl is built into all modern versions of these operating systems.
If you would rather use a graphical client, paste the same URL, headers, and body into Postman or Insomnia. Both are free and friendlier for first-time API testing.
The Sandbox environment uses the same API key as production, but requests do not consume credits. The free demo template (becf-11f08) accepts custom dimensions and is the right way to try the API end to end. Other templates on the Sandbox return dielines in their default options — to generate custom dielines from any other template, you will need API credits and the production endpoint.
https://sandbox.api.diecuttemplates.comhttps://api.diecuttemplates.com
The following request uses our free demo template (becf-11f08) to generate a dieline PDF:
curl -X POST \
https://sandbox.api.diecuttemplates.com/dieline-templates/becf-11f08/dielines \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Dielines-Api-Version: 1.0" \
-d '{
"format": "pdf",
"variables": {
"unit": "mm",
"material": 0.5,
"length": 100.0,
"width": 50.0,
"height": 150.0,
"dimension_texts": false
}
}'
The response contains a dieline id (for example di_ueipnpyp0rlw) and a download URL for the PDF. You will need this id in the next step.
Full documentation, the list of available templates, and every variable you can set live here: Dielines API — Getting Started.
Creating a mockup is a two-step flow:
id.
Use the request shown above. Save the dieline id from the response.
Post your artwork file to the dieline you just created:
curl -X POST \
https://sandbox.api.diecuttemplates.com/dielines/di_ueipnpyp0rlw/3d-mockups \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Dielines-Api-Version: 1.0" \
-F "file=@/path/to/your/artwork.pdf" \
-F "name=My Design" \
-F "outside_design=true"
Accepted artwork formats: PDF, PNG, JPEG, SVG. The response returns the 3D mockup id and a hosted URL such as https://www.diecuttemplates.com/3d/llnmb1oh8r — open it to see what a live mockup page looks like.
You can list all mockups attached to a dieline:
curl -X GET \
https://sandbox.api.diecuttemplates.com/dielines/di_ueipnpyp0rlw/3d-mockups \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Dielines-Api-Version: 1.0"
These are two separate products:
Sandbox testing is always free, regardless of which product you have — so you can build and verify your entire integration before purchasing any credits.
The API portion of a 3D mockup pipeline is just two requests:
POST /dieline-templates/{id}/dielines — returns a dieline id.POST /dielines/{id}/3d-mockups — returns a mockup id and a hosted URL.If you hit anything specific while testing in the Sandbox, send us the request you are making and the response you are getting and we will take a look.