Generate Packing Slip

Generate a packing slip PDF with order details, item list, and shipping address.

Who this is for

Fulfillment centers and e-commerce platforms generate packing slips with order number, shipping address, and itemized contents — ready for printing and including in shipments.

Request
curl -X POST https://api.iterationlayer.com/document-generation/v1/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "format": "pdf",
    "document": {
      "metadata": {
        "title": "Packing Slip - Order #WH-88421",
        "author": "Summit Outdoor Gear"
      },
      "page": {
        "size": { "preset": "A4" },
        "margins": {
          "top_in_pt": 72,
          "right_in_pt": 72,
          "bottom_in_pt": 72,
          "left_in_pt": 72
        }
      },
      "styles": {
        "text": {
          "font_family": "Helvetica",
          "font_size_in_pt": 11.0,
          "line_height": 1.5,
          "color": "#333333"
        },
        "headline": {
          "font_family": "Helvetica",
          "font_size_in_pt": 24.0,
          "color": "#111111",
          "spacing_before_in_pt": 12.0,
          "spacing_after_in_pt": 6.0,
          "is_bold": true
        },
        "link": {
          "color": "#0066CC",
          "is_underlined": true
        },
        "list": {
          "text_style": {
            "font_family": "Helvetica",
            "font_size_in_pt": 11.0,
            "line_height": 1.5,
            "color": "#333333"
          },
          "marker_color": "#333333",
          "marker_gap_in_pt": 8.0
        },
        "table": {
          "header": {
            "background_color": "#333333",
            "text_color": "#FFFFFF",
            "font_size_in_pt": 11.0,
            "is_bold": true
          },
          "body": {
            "background_color": "#FFFFFF",
            "text_color": "#333333",
            "font_size_in_pt": 11.0
          },
          "border": {
            "outer": {
              "top": { "color": "#CCCCCC", "width_in_pt": 1.0 },
              "right": { "color": "#CCCCCC", "width_in_pt": 1.0 },
              "bottom": { "color": "#CCCCCC", "width_in_pt": 1.0 },
              "left": { "color": "#CCCCCC", "width_in_pt": 1.0 }
            },
            "inner": {
              "horizontal": { "color": "#EEEEEE", "width_in_pt": 0.5 },
              "vertical": { "color": "#EEEEEE", "width_in_pt": 0.5 }
            }
          }
        },
        "grid": {
          "background_color": "#FFFFFF",
          "border_color": "#CCCCCC",
          "border_width_in_pt": 0.0,
          "gap_in_pt": 12.0
        },
        "separator": {
          "color": "#CCCCCC",
          "thickness_in_pt": 1.0,
          "spacing_before_in_pt": 12.0,
          "spacing_after_in_pt": 12.0
        },
        "image": {
          "border_color": "#000000",
          "border_width_in_pt": 0.0
        }
      },
      "footer": [
        {
          "type": "paragraph",
          "runs": [{
            "text": "Summit Outdoor Gear · 1200 Warehouse Pkwy, Denver, CO 80216 · summitoutdoorgear.com"
          }]
        }
      ],
      "content": [
        { "type": "headline", "level": "h1", "text": "Packing Slip" },
        {
          "type": "grid",
          "columns": [
            {
              "column_span": 4,
              "blocks": [
                { "type": "paragraph", "runs": [
                  { "text": "Order #: ", "is_bold": true },
                  { "text": "WH-88421\n" },
                  { "text": "Date: ", "is_bold": true },
                  { "text": "March 14, 2026" }
                ] }
              ]
            },
            {
              "column_span": 4,
              "blocks": [
                { "type": "paragraph", "runs": [
                  { "text": "Ship To:\n", "is_bold": true },
                  { "text": "Jordan Rivera\n4521 Pine Crest Ave\nPortland, OR 97201" }
                ] }
              ]
            },
            {
              "column_span": 4,
              "blocks": [
                { "type": "paragraph", "runs": [
                  { "text": "Shipping Method:\n", "is_bold": true },
                  { "text": "UPS Ground\n" },
                  { "text": "Tracking: ", "is_bold": true },
                  { "text": "1Z999AA10123456784" }
                ] }
              ]
            }
          ]
        },
        { "type": "separator" },
        {
          "type": "table",
          "column_widths_in_percent": [20, 55, 25],
          "header": {
            "cells": [
              { "text": "SKU" },
              { "text": "Item" },
              { "text": "Qty", "horizontal_alignment": "center" }
            ]
          },
          "rows": [
            { "cells": [
              { "text": "SOG-TN-440" },
              { "text": "Alpine Pro 4-Person Tent" },
              { "text": "1", "horizontal_alignment": "center" }
            ] },
            { "cells": [
              { "text": "SOG-SB-220" },
              { "text": "Down Sleeping Bag (-10°C)" },
              { "text": "2", "horizontal_alignment": "center" }
            ] },
            { "cells": [
              { "text": "SOG-MP-115" },
              { "text": "Foam Sleeping Pad (Regular)" },
              { "text": "2", "horizontal_alignment": "center" }
            ] },
            { "cells": [
              { "text": "SOG-HL-330" },
              { "text": "LED Headlamp (400 Lumens)" },
              { "text": "3", "horizontal_alignment": "center" }
            ] }
          ]
        },
        { "type": "separator" },
        { "type": "paragraph", "runs": [
          { "text": "Total Items: ", "is_bold": true },
          { "text": "8 · Please verify all items upon receipt. For returns or exchanges, visit summitoutdoorgear.com/returns or contact support@summitoutdoorgear.com within 30 days." }
        ] }
      ]
    }
  }'
Response
{
  "success": true,
  "data": {
    "buffer": "JVBERi0xLjcKMSAwIG9iago8...",
    "mime_type": "application/pdf"
  }
}
Request
import { IterationLayer } from "iterationlayer";
const client = new IterationLayer({ apiKey: "YOUR_API_KEY" });

const result = await client.generateDocument({
  format: "pdf",
  document: {
    metadata: {
      title: "Packing Slip - Order #WH-88421",
      author: "Summit Outdoor Gear",
    },
    page: {
      size: { preset: "A4" },
      margins: {
        top_in_pt: 72,
        right_in_pt: 72,
        bottom_in_pt: 72,
        left_in_pt: 72,
      },
    },
    styles: {
      text: {
        font_family: "Helvetica",
        font_size_in_pt: 11.0,
        line_height: 1.5,
        color: "#333333",
      },
      headline: {
        font_family: "Helvetica",
        font_size_in_pt: 24.0,
        color: "#111111",
        spacing_before_in_pt: 12.0,
        spacing_after_in_pt: 6.0,
        is_bold: true,
      },
      link: {
        color: "#0066CC",
        is_underlined: true,
      },
      list: {
        text_style: {
          font_family: "Helvetica",
          font_size_in_pt: 11.0,
          line_height: 1.5,
          color: "#333333",
        },
        marker_color: "#333333",
        marker_gap_in_pt: 8.0,
      },
      table: {
        header: {
          background_color: "#333333",
          text_color: "#FFFFFF",
          font_size_in_pt: 11.0,
          is_bold: true,
        },
        body: {
          background_color: "#FFFFFF",
          text_color: "#333333",
          font_size_in_pt: 11.0,
        },
        border: {
          outer: {
            top: { color: "#CCCCCC", width_in_pt: 1.0 },
            right: { color: "#CCCCCC", width_in_pt: 1.0 },
            bottom: { color: "#CCCCCC", width_in_pt: 1.0 },
            left: { color: "#CCCCCC", width_in_pt: 1.0 },
          },
          inner: {
            horizontal: { color: "#EEEEEE", width_in_pt: 0.5 },
            vertical: { color: "#EEEEEE", width_in_pt: 0.5 },
          },
        },
      },
      grid: {
        background_color: "#FFFFFF",
        border_color: "#CCCCCC",
        border_width_in_pt: 0.0,
        gap_in_pt: 12.0,
      },
      separator: {
        color: "#CCCCCC",
        thickness_in_pt: 1.0,
        spacing_before_in_pt: 12.0,
        spacing_after_in_pt: 12.0,
      },
      image: {
        border_color: "#000000",
        border_width_in_pt: 0.0,
      },
    },
    footer: [
      {
        type: "paragraph",
        runs: [{
          text: "Summit Outdoor Gear · 1200 Warehouse Pkwy, Denver, CO 80216 · summitoutdoorgear.com",
        }],
      },
    ],
    content: [
      { type: "headline", level: "h1", text: "Packing Slip" },
      {
        type: "grid",
        columns: [
          {
            column_span: 4,
            blocks: [
              { type: "paragraph", runs: [
                { text: "Order #: ", is_bold: true },
                { text: "WH-88421\n" },
                { text: "Date: ", is_bold: true },
                { text: "March 14, 2026" },
              ] },
            ],
          },
          {
            column_span: 4,
            blocks: [
              { type: "paragraph", runs: [
                { text: "Ship To:\n", is_bold: true },
                { text: "Jordan Rivera\n4521 Pine Crest Ave\nPortland, OR 97201" },
              ] },
            ],
          },
          {
            column_span: 4,
            blocks: [
              { type: "paragraph", runs: [
                { text: "Shipping Method:\n", is_bold: true },
                { text: "UPS Ground\n" },
                { text: "Tracking: ", is_bold: true },
                { text: "1Z999AA10123456784" },
              ] },
            ],
          },
        ],
      },
      { type: "separator" },
      {
        type: "table",
        column_widths_in_percent: [20, 55, 25],
        header: {
          cells: [
            { text: "SKU" },
            { text: "Item" },
            { text: "Qty", horizontal_alignment: "center" },
          ],
        },
        rows: [
          { cells: [
            { text: "SOG-TN-440" },
            { text: "Alpine Pro 4-Person Tent" },
            { text: "1", horizontal_alignment: "center" },
          ] },
          { cells: [
            { text: "SOG-SB-220" },
            { text: "Down Sleeping Bag (-10°C)" },
            { text: "2", horizontal_alignment: "center" },
          ] },
          { cells: [
            { text: "SOG-MP-115" },
            { text: "Foam Sleeping Pad (Regular)" },
            { text: "2", horizontal_alignment: "center" },
          ] },
          { cells: [
            { text: "SOG-HL-330" },
            { text: "LED Headlamp (400 Lumens)" },
            { text: "3", horizontal_alignment: "center" },
          ] },
        ],
      },
      { type: "separator" },
      { type: "paragraph", runs: [
        { text: "Total Items: ", is_bold: true },
        { text: "8 · Please verify all items upon receipt. For returns or exchanges, visit summitoutdoorgear.com/returns or contact support@summitoutdoorgear.com within 30 days." },
      ] },
    ],
  },
});

await Bun.write("packing-slip-wh-88421.pdf", Buffer.from(result.data.buffer, "base64"));
Response
{
  "success": true,
  "data": {
    "buffer": "JVBERi0xLjcKMSAwIG9iago8...",
    "mime_type": "application/pdf"
  }
}
Request
import base64

from iterationlayer import IterationLayer
client = IterationLayer(api_key="YOUR_API_KEY")

result = client.generate_document(
    format="pdf",
    document={
        "metadata": {
            "title": "Packing Slip - Order #WH-88421",
            "author": "Summit Outdoor Gear",
        },
        "page": {
            "size": {"preset": "A4"},
            "margins": {
                "top_in_pt": 72,
                "right_in_pt": 72,
                "bottom_in_pt": 72,
                "left_in_pt": 72,
            },
        },
        "styles": {
            "text": {
                "font_family": "Helvetica",
                "font_size_in_pt": 11.0,
                "line_height": 1.5,
                "color": "#333333",
            },
            "headline": {
                "font_family": "Helvetica",
                "font_size_in_pt": 24.0,
                "color": "#111111",
                "spacing_before_in_pt": 12.0,
                "spacing_after_in_pt": 6.0,
                "is_bold": True,
            },
            "link": {
                "color": "#0066CC",
                "is_underlined": True,
            },
            "list": {
                "text_style": {
                    "font_family": "Helvetica",
                    "font_size_in_pt": 11.0,
                    "line_height": 1.5,
                    "color": "#333333",
                },
                "marker_color": "#333333",
                "marker_gap_in_pt": 8.0,
            },
            "table": {
                "header": {
                    "background_color": "#333333",
                    "text_color": "#FFFFFF",
                    "font_size_in_pt": 11.0,
                    "is_bold": True,
                },
                "body": {
                    "background_color": "#FFFFFF",
                    "text_color": "#333333",
                    "font_size_in_pt": 11.0,
                },
                "border": {
                    "outer": {
                        "top": {"color": "#CCCCCC", "width_in_pt": 1.0},
                        "right": {"color": "#CCCCCC", "width_in_pt": 1.0},
                        "bottom": {"color": "#CCCCCC", "width_in_pt": 1.0},
                        "left": {"color": "#CCCCCC", "width_in_pt": 1.0},
                    },
                    "inner": {
                        "horizontal": {"color": "#EEEEEE", "width_in_pt": 0.5},
                        "vertical": {"color": "#EEEEEE", "width_in_pt": 0.5},
                    },
                },
            },
            "grid": {
                "background_color": "#FFFFFF",
                "border_color": "#CCCCCC",
                "border_width_in_pt": 0.0,
                "gap_in_pt": 12.0,
            },
            "separator": {
                "color": "#CCCCCC",
                "thickness_in_pt": 1.0,
                "spacing_before_in_pt": 12.0,
                "spacing_after_in_pt": 12.0,
            },
            "image": {
                "border_color": "#000000",
                "border_width_in_pt": 0.0,
            },
        },
        "footer": [
            {
                "type": "paragraph",
                "runs": [{
                    "text": "Summit Outdoor Gear · 1200 Warehouse Pkwy, Denver, CO 80216 · summitoutdoorgear.com",
                }],
            },
        ],
        "content": [
            {"type": "headline", "level": "h1", "text": "Packing Slip"},
            {
                "type": "grid",
                "columns": [
                    {
                        "column_span": 4,
                        "blocks": [
                            {"type": "paragraph", "runs": [
                                {"text": "Order #: ", "is_bold": True},
                                {"text": "WH-88421\n"},
                                {"text": "Date: ", "is_bold": True},
                                {"text": "March 14, 2026"},
                            ]},
                        ],
                    },
                    {
                        "column_span": 4,
                        "blocks": [
                            {"type": "paragraph", "runs": [
                                {"text": "Ship To:\n", "is_bold": True},
                                {"text": "Jordan Rivera\n4521 Pine Crest Ave\nPortland, OR 97201"},
                            ]},
                        ],
                    },
                    {
                        "column_span": 4,
                        "blocks": [
                            {"type": "paragraph", "runs": [
                                {"text": "Shipping Method:\n", "is_bold": True},
                                {"text": "UPS Ground\n"},
                                {"text": "Tracking: ", "is_bold": True},
                                {"text": "1Z999AA10123456784"},
                            ]},
                        ],
                    },
                ],
            },
            {"type": "separator"},
            {
                "type": "table",
                "column_widths_in_percent": [20, 55, 25],
                "header": {
                    "cells": [
                        {"text": "SKU"},
                        {"text": "Item"},
                        {"text": "Qty", "horizontal_alignment": "center"},
                    ],
                },
                "rows": [
                    {"cells": [
                        {"text": "SOG-TN-440"},
                        {"text": "Alpine Pro 4-Person Tent"},
                        {"text": "1", "horizontal_alignment": "center"},
                    ]},
                    {"cells": [
                        {"text": "SOG-SB-220"},
                        {"text": "Down Sleeping Bag (-10°C)"},
                        {"text": "2", "horizontal_alignment": "center"},
                    ]},
                    {"cells": [
                        {"text": "SOG-MP-115"},
                        {"text": "Foam Sleeping Pad (Regular)"},
                        {"text": "2", "horizontal_alignment": "center"},
                    ]},
                    {"cells": [
                        {"text": "SOG-HL-330"},
                        {"text": "LED Headlamp (400 Lumens)"},
                        {"text": "3", "horizontal_alignment": "center"},
                    ]},
                ],
            },
            {"type": "separator"},
            {"type": "paragraph", "runs": [
                {"text": "Total Items: ", "is_bold": True},
                {"text": "8 · Please verify all items upon receipt. For returns or exchanges, visit summitoutdoorgear.com/returns or contact support@summitoutdoorgear.com within 30 days."},
            ]},
        ],
    },
)

with open("packing-slip-wh-88421.pdf", "wb") as f:
    f.write(base64.b64decode(result["data"]["buffer"]))
Response
{
  "success": true,
  "data": {
    "buffer": "JVBERi0xLjcKMSAwIG9iago8...",
    "mime_type": "application/pdf"
  }
}
Request
package main

import (
    "encoding/base64"
    "os"

    il "github.com/iterationlayer/sdk-go"
)

func main() {
    client := il.NewClient("YOUR_API_KEY")

    result, err := client.GenerateDocument(il.GenerateDocumentRequest{
        Format: "pdf",
        Document: il.DocumentDefinition{
            Metadata: il.DocumentMetadata{
                Title:  "Packing Slip - Order #WH-88421",
                Author: "Summit Outdoor Gear",
            },
            Page: il.PageConfig{
                Size:    il.PageSize{Preset: "A4"},
                Margins: il.Margins{TopInPt: 72, RightInPt: 72, BottomInPt: 72, LeftInPt: 72},
            },
            Content: []il.ContentBlock{
                il.NewHeadlineBlock("h1", "Packing Slip"),
                il.ParagraphBlock{Type: "paragraph", Runs: []il.TextRun{
                    {Text: "Order #: ", IsBold: true},
                    {Text: "WH-88421\n"},
                    {Text: "Date: ", IsBold: true},
                    {Text: "March 14, 2026"},
                }},
                il.NewSeparatorBlock(),
                il.NewTableBlock([]il.TableRow{
                    {Cells: []il.TableCell{{Text: "SOG-TN-440"}, {Text: "Alpine Pro 4-Person Tent"}, {Text: "1"}}},
                    {Cells: []il.TableCell{{Text: "SOG-SB-220"}, {Text: "Down Sleeping Bag (-10°C)"}, {Text: "2"}}},
                    {Cells: []il.TableCell{{Text: "SOG-MP-115"}, {Text: "Foam Sleeping Pad (Regular)"}, {Text: "2"}}},
                    {Cells: []il.TableCell{{Text: "SOG-HL-330"}, {Text: "LED Headlamp (400 Lumens)"}, {Text: "3"}}},
                }),
                il.NewSeparatorBlock(),
                il.ParagraphBlock{Type: "paragraph", Markdown: "**Total Items:** 8 · Please verify all items upon receipt."},
            },
        },
    })
    if err != nil {
        panic(err)
    }

    decoded, _ := base64.StdEncoding.DecodeString(result.Data.Buffer)
    os.WriteFile("packing-slip-wh-88421.pdf", decoded, 0644)
}
Response
{
  "success": true,
  "data": {
    "buffer": "JVBERi0xLjcKMSAwIG9iago8...",
    "mime_type": "application/pdf"
  }
}

Related Recipes

Start building in minutes

Free trial credits included. No credit card required.