{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/invoicepdfs-com/json-schema/invoicepdfs-com-batch-create-request-schema.json",
  "title": "BatchCreateRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/invoicepdfs-com-batches-api-openapi.yml#/components/schemas/BatchCreateRequest",
  "properties": {
    "operation": {
      "type": "string",
      "const": "render",
      "title": "Operation",
      "default": "render"
    },
    "items": {
      "items": {
        "$ref": "#/$defs/BatchItemInput"
      },
      "type": "array",
      "maxItems": 500,
      "minItems": 1,
      "title": "Items"
    },
    "template_id": {
      "type": "string",
      "title": "Template Id",
      "default": "tpl_modern"
    },
    "template_version": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Template Version",
      "description": "Render the config this version of the template recorded, instead of the config it holds now. Only a custom (`ctpl_`) template has versions."
    },
    "output": {
      "$ref": "#/$defs/BatchOutputOptions"
    }
  },
  "type": "object",
  "required": [
    "items"
  ],
  "$defs": {
    "BatchItemInput": {
      "properties": {
        "external_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "External Id"
        },
        "document_type": {
          "type": "string",
          "const": "invoice",
          "title": "Document Type",
          "default": "invoice"
        },
        "data": {
          "additionalProperties": true,
          "type": "object",
          "title": "Data",
          "description": "Document data payload"
        }
      },
      "type": "object",
      "required": [
        "data"
      ],
      "title": "BatchItemInput"
    },
    "BatchOutputOptions": {
      "properties": {
        "format": {
          "type": "string",
          "const": "pdf",
          "title": "Format",
          "default": "pdf"
        },
        "combine": {
          "type": "boolean",
          "title": "Combine",
          "default": false
        },
        "archive_format": {
          "type": "string",
          "const": "zip",
          "title": "Archive Format",
          "default": "zip"
        }
      },
      "type": "object",
      "title": "BatchOutputOptions"
    }
  }
}