Generate Invoice Spreadsheet

Generate an XLSX invoice with company info, line items, subtotal/tax/total formulas, and currency formatting.

No credit card required — start with free trial credits

Who this is for

Finance teams and billing platforms use this recipe to generate branded invoice spreadsheets on demand. Define your company details, line items with quantities and rates, and let formulas compute subtotals, tax, and totals automatically.

Request
curl -X POST https://api.iterationlayer.com/sheet-generation/v1/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "format": "xlsx",
    "styles": {
      "header": {
        "font_family": "Helvetica",
        "font_size_in_pt": 11,
        "is_bold": true,
        "background_color": "#2B579A",
        "font_color": "#FFFFFF"
      },
      "body": {
        "font_family": "Helvetica",
        "font_size_in_pt": 11,
        "font_color": "#333333"
      }
    },
    "sheets": [
      {
      "name": "Invoice #2026-0187",
      "columns": [
        {
          "name": "Description",
          "width": 35,
        },
        {
          "name": "Quantity",
          "width": 12,
        },
        {
          "name": "Unit Price",
          "width": 15,
        },
        {
          "name": "Amount",
          "width": 15,
        }
      ],
      "rows": [
        [
          {
            "value": "Acme Consulting LLC — Invoice #2026-0187",
            "styles": {
              "is_bold": true,
              "font_size_in_pt": 14,
            },
            "from_col": 0,
            "to_col": 3,
          }
        ],
        [
          {
            "value": "Bill To: Northwind Industries, 1200 Industrial Blvd, Denver, CO 80202",
            "from_col": 0,
            "to_col": 3,
          }
        ],
        [
          {
            "value": "Date: March 21, 2026 | Due: April 20, 2026",
            "from_col": 0,
            "to_col": 3,
          }
        ],
        [
          {
            "value": "",
          }
        ],
        [
          {
            "value": "Brand Strategy Workshop (2 days)",
          },
          {
            "value": 1,
            "format": "number",
          },
          {
            "value": 8500,
            "format": "currency",
          },
          {
            "value": 8500,
            "format": "currency",
          }
        ],
        [
          {
            "value": "UI/UX Design Sprint (5 days)",
          },
          {
            "value": 1,
            "format": "number",
          },
          {
            "value": 15000,
            "format": "currency",
          },
          {
            "value": 15000,
            "format": "currency",
          }
        ],
        [
          {
            "value": "Frontend Development (120 hrs)",
          },
          {
            "value": 120,
            "format": "number",
          },
          {
            "value": 175,
            "format": "currency",
          },
          {
            "value": 21000,
            "format": "currency",
          }
        ],
        [
          {
            "value": "QA & User Acceptance Testing (40 hrs)",
          },
          {
            "value": 40,
            "format": "number",
          },
          {
            "value": 150,
            "format": "currency",
          },
          {
            "value": 6000,
            "format": "currency",
          }
        ],
        [
          {
            "value": "",
          }
        ],
        [
          {
            "value": "",
          },
          {
            "value": "",
          },
          {
            "value": "Subtotal",
            "styles": {
              "is_bold": true,
            },
          },
          {
            "value": null,
          }
        ],
        [
          {
            "value": "",
          },
          {
            "value": "",
          },
          {
            "value": "Tax (8.25%)",
            "styles": {
              "is_bold": true,
            },
          },
          {
            "value": null,
          }
        ],
        [
          {
            "value": "",
          },
          {
            "value": "",
          },
          {
            "value": "Total Due",
            "styles": {
              "is_bold": true,
              "font_size_in_pt": 13,
            },
          },
          {
            "value": null,
            "styles": {
              "is_bold": true,
              "font_size_in_pt": 13,
            },
          }
        ]
      ],
      "formulas": [
        {
          "row": 9,
          "col": 3,
          "expression": "=SUM(D5:D8)",
        },
        {
          "row": 10,
          "col": 3,
          "expression": "=D10*0.0825",
        },
        {
          "row": 11,
          "col": 3,
          "expression": "=D10+D11",
        }
      ],
      "merged_cells": [
        {
          "start_row": 0,
          "start_col": 0,
          "end_row": 0,
          "end_col": 3,
        },
        {
          "start_row": 1,
          "start_col": 0,
          "end_row": 1,
          "end_col": 3,
        },
        {
          "start_row": 2,
          "start_col": 0,
          "end_row": 2,
          "end_col": 3,
        }
      ]
    }
    ]
  }'
Response
{
  "success": true,
  "data": {
    "buffer": "UEsDBBQAAAAIAA...",
    "mime_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
  }
}
Request
import { IterationLayer } from "iterationlayer";
const client = new IterationLayer({
  apiKey: "YOUR_API_KEY",
});

const result = await client.generateSheet({
  format: "xlsx",
  styles: {
    header: {
      font_family: "Helvetica",
      font_size_in_pt: 11,
      is_bold: true,
      background_color: "#2B579A",
      font_color: "#FFFFFF",
    },
    body: {
      font_family: "Helvetica",
      font_size_in_pt: 11,
      font_color: "#333333",
    },
  },
  sheets: [
    {
    name: "Invoice #2026-0187",
    columns: [
      {
        name: "Description",
        width: 35,
      },
      {
        name: "Quantity",
        width: 12,
      },
      {
        name: "Unit Price",
        width: 15,
      },
      {
        name: "Amount",
        width: 15,
      },
    ],
    rows: [
      [
        {
          value: "Acme Consulting LLC — Invoice #2026-0187",
          styles: {
            is_bold: true,
            font_size_in_pt: 14,
          },
          from_col: 0,
          to_col: 3,
        },
      ],
      [
        {
          value: "Bill To: Northwind Industries, 1200 Industrial Blvd, Denver, CO 80202",
          from_col: 0,
          to_col: 3,
        },
      ],
      [
        {
          value: "Date: March 21, 2026 | Due: April 20, 2026",
          from_col: 0,
          to_col: 3,
        },
      ],
      [
        {
          value: "",
        },
      ],
      [
        {
          value: "Brand Strategy Workshop (2 days)",
        },
        {
          value: 1,
          format: "number",
        },
        {
          value: 8500,
          format: "currency",
        },
        {
          value: 8500,
          format: "currency",
        },
      ],
      [
        {
          value: "UI/UX Design Sprint (5 days)",
        },
        {
          value: 1,
          format: "number",
        },
        {
          value: 15000,
          format: "currency",
        },
        {
          value: 15000,
          format: "currency",
        },
      ],
      [
        {
          value: "Frontend Development (120 hrs)",
        },
        {
          value: 120,
          format: "number",
        },
        {
          value: 175,
          format: "currency",
        },
        {
          value: 21000,
          format: "currency",
        },
      ],
      [
        {
          value: "QA & User Acceptance Testing (40 hrs)",
        },
        {
          value: 40,
          format: "number",
        },
        {
          value: 150,
          format: "currency",
        },
        {
          value: 6000,
          format: "currency",
        },
      ],
      [
        {
          value: "",
        },
      ],
      [
        {
          value: "",
        },
        {
          value: "",
        },
        {
          value: "Subtotal",
          styles: {
            is_bold: true,
          },
        },
        {
          value: null,
        },
      ],
      [
        {
          value: "",
        },
        {
          value: "",
        },
        {
          value: "Tax (8.25%)",
          styles: {
            is_bold: true,
          },
        },
        {
          value: null,
        },
      ],
      [
        {
          value: "",
        },
        {
          value: "",
        },
        {
          value: "Total Due",
          styles: {
            is_bold: true,
            font_size_in_pt: 13,
          },
        },
        {
          value: null,
          styles: {
            is_bold: true,
            font_size_in_pt: 13,
          },
        },
      ],
    ],
    formulas: [
      {
        row: 9,
        col: 3,
        expression: "=SUM(D5:D8)",
      },
      {
        row: 10,
        col: 3,
        expression: "=D10*0.0825",
      },
      {
        row: 11,
        col: 3,
        expression: "=D10+D11",
      },
    ],
    merged_cells: [
      {
        start_row: 0,
        start_col: 0,
        end_row: 0,
        end_col: 3,
      },
      {
        start_row: 1,
        start_col: 0,
        end_row: 1,
        end_col: 3,
      },
      {
        start_row: 2,
        start_col: 0,
        end_row: 2,
        end_col: 3,
      },
    ],
  }
  ],
});
Response
{
  "success": true,
  "data": {
    "buffer": "UEsDBBQAAAAIAA...",
    "mime_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
  }
}
Request
from iterationlayer import IterationLayer
client = IterationLayer(api_key="YOUR_API_KEY")

result = client.generate_sheet(
    format="xlsx",
    styles={
        "header": {
            "font_family": "Helvetica",
            "font_size_in_pt": 11,
            "is_bold": True,
            "background_color": "#2B579A",
            "font_color": "#FFFFFF",
        },
        "body": {
            "font_family": "Helvetica",
            "font_size_in_pt": 11,
            "font_color": "#333333",
        },
    },
    sheets=[
        {
        "name": "Invoice #2026-0187",
        "columns": [
            {
                "name": "Description",
                "width": 35,
            },
            {
                "name": "Quantity",
                "width": 12,
            },
            {
                "name": "Unit Price",
                "width": 15,
            },
            {
                "name": "Amount",
                "width": 15,
            },
        ],
        "rows": [
            [
                {
                    "value": "Acme Consulting LLC — Invoice #2026-0187",
                    "styles": {
                        "is_bold": True,
                        "font_size_in_pt": 14,
                    },
                    "from_col": 0,
                    "to_col": 3,
                },
            ],
            [
                {
                    "value": "Bill To: Northwind Industries, 1200 Industrial Blvd, Denver, CO 80202",
                    "from_col": 0,
                    "to_col": 3,
                },
            ],
            [
                {
                    "value": "Date: March 21, 2026 | Due: April 20, 2026",
                    "from_col": 0,
                    "to_col": 3,
                },
            ],
            [
                {
                    "value": "",
                },
            ],
            [
                {
                    "value": "Brand Strategy Workshop (2 days)",
                },
                {
                    "value": 1,
                    "format": "number",
                },
                {
                    "value": 8500,
                    "format": "currency",
                },
                {
                    "value": 8500,
                    "format": "currency",
                },
            ],
            [
                {
                    "value": "UI/UX Design Sprint (5 days)",
                },
                {
                    "value": 1,
                    "format": "number",
                },
                {
                    "value": 15000,
                    "format": "currency",
                },
                {
                    "value": 15000,
                    "format": "currency",
                },
            ],
            [
                {
                    "value": "Frontend Development (120 hrs)",
                },
                {
                    "value": 120,
                    "format": "number",
                },
                {
                    "value": 175,
                    "format": "currency",
                },
                {
                    "value": 21000,
                    "format": "currency",
                },
            ],
            [
                {
                    "value": "QA & User Acceptance Testing (40 hrs)",
                },
                {
                    "value": 40,
                    "format": "number",
                },
                {
                    "value": 150,
                    "format": "currency",
                },
                {
                    "value": 6000,
                    "format": "currency",
                },
            ],
            [
                {
                    "value": "",
                },
            ],
            [
                {
                    "value": "",
                },
                {
                    "value": "",
                },
                {
                    "value": "Subtotal",
                    "styles": {
                        "is_bold": True,
                    },
                },
                {
                    "value": None,
                },
            ],
            [
                {
                    "value": "",
                },
                {
                    "value": "",
                },
                {
                    "value": "Tax (8.25%)",
                    "styles": {
                        "is_bold": True,
                    },
                },
                {
                    "value": None,
                },
            ],
            [
                {
                    "value": "",
                },
                {
                    "value": "",
                },
                {
                    "value": "Total Due",
                    "styles": {
                        "is_bold": True,
                        "font_size_in_pt": 13,
                    },
                },
                {
                    "value": None,
                    "styles": {
                        "is_bold": True,
                        "font_size_in_pt": 13,
                    },
                },
            ],
        ],
        "formulas": [
            {
                "row": 9,
                "col": 3,
                "expression": "=SUM(D5:D8)",
            },
            {
                "row": 10,
                "col": 3,
                "expression": "=D10*0.0825",
            },
            {
                "row": 11,
                "col": 3,
                "expression": "=D10+D11",
            },
        ],
        "merged_cells": [
            {
                "start_row": 0,
                "start_col": 0,
                "end_row": 0,
                "end_col": 3,
            },
            {
                "start_row": 1,
                "start_col": 0,
                "end_row": 1,
                "end_col": 3,
            },
            {
                "start_row": 2,
                "start_col": 0,
                "end_row": 2,
                "end_col": 3,
            },
        ],
    }
    ],
)
Response
{
  "success": true,
  "data": {
    "buffer": "UEsDBBQAAAAIAA...",
    "mime_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
  }
}
Request
package main

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

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

    result, err := client.GenerateSheet(il.GenerateSheetRequest{
        Format: "xlsx",
        Styles: &il.SheetStyles{
            Header: &il.CellStyle{
                FontFamily:      "Helvetica",
                FontSizeInPt:    11,
                IsBold:          true,
                BackgroundColor: "#2B579A",
                FontColor:       "#FFFFFF",
            },
            Body: &il.CellStyle{
                FontFamily:   "Helvetica",
                FontSizeInPt: 11,
                FontColor:    "#333333",
            },
        },
        Sheets: []il.Sheet{
            {
            Name: "Invoice #2026-0187",
            Columns: []il.SheetColumn{
                {
                    Name: "Description",
                    Width: 35,
                },
                {
                    Name: "Quantity",
                    Width: 12,
                },
                {
                    Name: "Unit Price",
                    Width: 15,
                },
                {
                    Name: "Amount",
                    Width: 15,
                },
            },
            Rows: []il.SheetRow{
                {
                    {
                        Value: "Acme Consulting LLC — Invoice #2026-0187",
                        Styles: &il.CellStyle{
                            IsBold:       true,
                            FontSizeInPt: 14,
                        },
                        FromCol: intPtr(0),
                        ToCol:   intPtr(3),
                    },
                },
                {
                    {
                        Value:   "Bill To: Northwind Industries, 1200 Industrial Blvd, Denver, CO 80202",
                        FromCol: intPtr(0),
                        ToCol:   intPtr(3),
                    },
                },
                {
                    {
                        Value:   "Date: March 21, 2026 | Due: April 20, 2026",
                        FromCol: intPtr(0),
                        ToCol:   intPtr(3),
                    },
                },
                {
                    {
                        Value: "",
                    },
                },
                {
                    {
                        Value: "Brand Strategy Workshop (2 days)",
                    },
                    {
                        Value: 1,
                        Format: "number",
                    },
                    {
                        Value: 8500,
                        Format: "currency",
                    },
                    {
                        Value: 8500,
                        Format: "currency",
                    },
                },
                {
                    {
                        Value: "UI/UX Design Sprint (5 days)",
                    },
                    {
                        Value: 1,
                        Format: "number",
                    },
                    {
                        Value: 15000,
                        Format: "currency",
                    },
                    {
                        Value: 15000,
                        Format: "currency",
                    },
                },
                {
                    {
                        Value: "Frontend Development (120 hrs)",
                    },
                    {
                        Value: 120,
                        Format: "number",
                    },
                    {
                        Value: 175,
                        Format: "currency",
                    },
                    {
                        Value: 21000,
                        Format: "currency",
                    },
                },
                {
                    {
                        Value: "QA & User Acceptance Testing (40 hrs)",
                    },
                    {
                        Value: 40,
                        Format: "number",
                    },
                    {
                        Value: 150,
                        Format: "currency",
                    },
                    {
                        Value: 6000,
                        Format: "currency",
                    },
                },
                {
                    {
                        Value: "",
                    },
                },
                {
                    {
                        Value: "",
                    },
                    {
                        Value: "",
                    },
                    {
                        Value: "Subtotal",
                        Styles: &il.CellStyle{
                            IsBold: true,
                        },
                    },
                    {
                        Value: nil,
                    },
                },
                {
                    {
                        Value: "",
                    },
                    {
                        Value: "",
                    },
                    {
                        Value: "Tax (8.25%)",
                        Styles: &il.CellStyle{
                            IsBold: true,
                        },
                    },
                    {
                        Value: nil,
                    },
                },
                {
                    {
                        Value: "",
                    },
                    {
                        Value: "",
                    },
                    {
                        Value: "Total Due",
                        Styles: &il.CellStyle{
                            IsBold: true,
                            FontSizeInPt: 13,
                        },
                    },
                    {
                        Value: nil,
                        Styles: &il.CellStyle{
                            IsBold: true,
                            FontSizeInPt: 13,
                        },
                    },
                },
            },
            Formulas: []il.Formula{
                {
                    Row: 9,
                    Col: 3,
                    Expression: "=SUM(D5:D8)",
                },
                {
                    Row: 10,
                    Col: 3,
                    Expression: "=D10*0.0825",
                },
                {
                    Row: 11,
                    Col: 3,
                    Expression: "=D10+D11",
                },
            },
            MergedCells: []il.MergedCell{
                {
                    StartRow: 0,
                    StartCol: 0,
                    EndRow: 0,
                    EndCol: 3,
                },
                {
                    StartRow: 1,
                    StartCol: 0,
                    EndRow: 1,
                    EndCol: 3,
                },
                {
                    StartRow: 2,
                    StartCol: 0,
                    EndRow: 2,
                    EndCol: 3,
                },
            },
        },
        },
    })
    if err != nil {
        panic(err)
    }
    _ = result
}
Response
{
  "success": true,
  "data": {
    "buffer": "UEsDBBQAAAAIAA...",
    "mime_type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
  }
}

Related Recipes

Start building in minutes

Free trial credits included. No credit card required.