{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/invoicepdfs-com/json-schema/invoicepdfs-com-recurring-invoice-create-request-schema.json",
  "title": "RecurringInvoiceCreateRequest",
  "x-generated": "2026-10-30",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/invoicepdfs-com-openapi.json#/components/schemas/RecurringInvoiceCreateRequest",
  "properties": {
    "business_profile_id": {
      "type": "string",
      "title": "Business Profile Id"
    },
    "customer_id": {
      "type": "string",
      "title": "Customer Id"
    },
    "frequency": {
      "type": "string",
      "title": "Frequency",
      "description": "daily, weekly, monthly, quarterly, or yearly"
    },
    "interval": {
      "type": "integer",
      "minimum": 1.0,
      "title": "Interval",
      "description": "Every N periods",
      "default": 1
    },
    "start_date": {
      "type": "string",
      "format": "date",
      "title": "Start Date",
      "description": "Date of the first invoice"
    },
    "end_date": {
      "anyOf": [
        {
          "type": "string",
          "format": "date"
        },
        {
          "type": "null"
        }
      ],
      "title": "End Date",
      "description": "Stop generating after this date"
    },
    "max_occurrences": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Max Occurrences",
      "description": "Stop after N invoices"
    },
    "numbering_sequence_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Numbering Sequence Id",
      "description": "Auto-generate invoice numbers from this sequence"
    },
    "auto_finalize": {
      "type": "boolean",
      "title": "Auto Finalize",
      "description": "Automatically finalize generated invoices",
      "default": false
    },
    "invoice_template": {
      "$ref": "#/$defs/InvoiceDraftRequest",
      "description": "Invoice payload used as template for each occurrence"
    }
  },
  "type": "object",
  "required": [
    "business_profile_id",
    "customer_id",
    "frequency",
    "start_date",
    "invoice_template"
  ],
  "$defs": {
    "InvoiceBankAccountInput": {
      "properties": {
        "bank_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Bank Name"
        },
        "account_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Account Name"
        },
        "account_number": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Account Number"
        },
        "routing_number": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Routing Number"
        },
        "swift": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Swift"
        },
        "iban": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Iban"
        }
      },
      "type": "object",
      "title": "InvoiceBankAccountInput"
    },
    "InvoiceBrandingInput": {
      "properties": {
        "logo_file_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Logo File Id"
        },
        "primary_color": {
          "type": "string",
          "title": "Primary Color",
          "default": "#111827"
        },
        "accent_color": {
          "type": "string",
          "title": "Accent Color",
          "default": "#111827"
        },
        "font_family": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Font Family"
        },
        "header_text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Header Text"
        },
        "footer_text": {
          "type": "string",
          "title": "Footer Text",
          "default": "Generated by InvoicePDFs"
        },
        "hide_invoicepdfs_branding": {
          "type": "boolean",
          "title": "Hide Invoicepdfs Branding",
          "default": false
        }
      },
      "type": "object",
      "title": "InvoiceBrandingInput"
    },
    "InvoiceCustomFieldInput": {
      "properties": {
        "label": {
          "type": "string",
          "title": "Label"
        },
        "value": {
          "type": "string",
          "title": "Value"
        }
      },
      "type": "object",
      "required": [
        "label",
        "value"
      ],
      "title": "InvoiceCustomFieldInput"
    },
    "InvoiceDiscountInput": {
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "percentage",
            "fixed"
          ],
          "title": "Type",
          "default": "percentage"
        },
        "value": {
          "type": "string",
          "title": "Value"
        },
        "reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reason"
        }
      },
      "type": "object",
      "required": [
        "value"
      ],
      "title": "InvoiceDiscountInput"
    },
    "InvoiceDraftRequest": {
      "properties": {
        "invoice_number": {
          "type": "string",
          "title": "Invoice Number"
        },
        "document_type": {
          "type": "string",
          "enum": [
            "invoice",
            "credit_note",
            "debit_note",
            "quote",
            "receipt",
            "proforma",
            "purchase_order",
            "delivery_note"
          ],
          "title": "Document Type",
          "default": "invoice"
        },
        "issue_date": {
          "type": "string",
          "format": "date",
          "title": "Issue Date"
        },
        "due_date": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Due Date"
        },
        "currency": {
          "type": "string",
          "title": "Currency"
        },
        "locale": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Locale",
          "default": "en-US"
        },
        "business_profile_id": {
          "type": "string",
          "title": "Business Profile Id"
        },
        "customer_id": {
          "type": "string",
          "title": "Customer Id"
        },
        "ship_to": {
          "anyOf": [
            {
              "$ref": "#/$defs/PostalAddress"
            },
            {
              "type": "null"
            }
          ]
        },
        "buyer_reference": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Buyer Reference"
        },
        "tax_scheme": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tax Scheme",
          "description": "UNCL5153 — what kind of tax this invoice states. One document, one answer: an invoice is issued under a tax regime, not a different one per line. Optional, and deliberately not defaulted, because a PDF does not need it and assuming `VAT` would put a claim in a tax document that you did not make. Required to produce or check an e-invoice, where it must be `VAT` — every ruleset built on EN 16931 describes VAT and tests for that string literally, so a document stating anything else is refused rather than relabelled."
        },
        "delivery_date": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Delivery Date",
          "description": "When the goods or services were actually supplied (BT-72). Not the issue date, and it is what decides the VAT period. XRechnung requires this, an invoicing period, or a period on every line."
        },
        "preceding_invoice_number": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Preceding Invoice Number"
        },
        "line_items": {
          "items": {
            "$ref": "#/$defs/InvoiceLineItemInput"
          },
          "type": "array",
          "title": "Line Items"
        },
        "discounts": {
          "items": {
            "$ref": "#/$defs/InvoiceDiscountInput"
          },
          "type": "array",
          "title": "Discounts"
        },
        "shipping": {
          "anyOf": [
            {
              "$ref": "#/$defs/InvoiceShippingInput"
            },
            {
              "type": "null"
            }
          ]
        },
        "notes": {
          "items": {
            "$ref": "#/$defs/InvoiceNoteInput"
          },
          "type": "array",
          "title": "Notes"
        },
        "terms": {
          "items": {
            "$ref": "#/$defs/InvoiceTermInput"
          },
          "type": "array",
          "title": "Terms"
        },
        "custom_fields": {
          "items": {
            "$ref": "#/$defs/InvoiceCustomFieldInput"
          },
          "type": "array",
          "title": "Custom Fields"
        },
        "payment": {
          "anyOf": [
            {
              "$ref": "#/$defs/InvoicePaymentInput"
            },
            {
              "type": "null"
            }
          ]
        },
        "branding": {
          "anyOf": [
            {
              "$ref": "#/$defs/InvoiceBrandingInput"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "type": "object",
      "required": [
        "invoice_number",
        "issue_date",
        "currency",
        "business_profile_id",
        "customer_id",
        "line_items"
      ],
      "title": "InvoiceDraftRequest"
    },
    "InvoiceLineItemInput": {
      "properties": {
        "name": {
          "type": "string",
          "title": "Name"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Description"
        },
        "quantity": {
          "type": "string",
          "title": "Quantity",
          "description": "Decimal string"
        },
        "unit_price": {
          "type": "string",
          "title": "Unit Price",
          "description": "Decimal string in major units"
        },
        "unit": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Unit"
        },
        "unit_code": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Unit Code",
          "description": "BT-130. UN/ECE Rec 20 code — HUR, C62. Not the printed label."
        },
        "sku": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Sku"
        },
        "discount": {
          "anyOf": [
            {
              "$ref": "#/$defs/InvoiceDiscountInput"
            },
            {
              "type": "null"
            }
          ]
        },
        "taxes": {
          "items": {
            "$ref": "#/$defs/InvoiceLineItemTaxInput"
          },
          "type": "array",
          "title": "Taxes"
        }
      },
      "type": "object",
      "required": [
        "name",
        "quantity",
        "unit_price"
      ],
      "title": "InvoiceLineItemInput"
    },
    "InvoiceLineItemTaxInput": {
      "properties": {
        "tax_rate_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tax Rate Id"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Name"
        },
        "rate": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Rate"
        },
        "inclusive": {
          "type": "boolean",
          "title": "Inclusive",
          "default": false
        },
        "category": {
          "anyOf": [
            {
              "$ref": "#/$defs/TaxCategory"
            },
            {
              "type": "null"
            }
          ],
          "description": "How this tax is treated — required for e-invoicing formats, which keep zero-rated, exempt and reverse-charge in separate VAT groups."
        }
      },
      "type": "object",
      "title": "InvoiceLineItemTaxInput"
    },
    "InvoiceNoteInput": {
      "properties": {
        "type": {
          "type": "string",
          "title": "Type"
        },
        "content": {
          "type": "string",
          "title": "Content"
        }
      },
      "type": "object",
      "required": [
        "type",
        "content"
      ],
      "title": "InvoiceNoteInput"
    },
    "InvoicePaymentInput": {
      "properties": {
        "bank_account": {
          "anyOf": [
            {
              "$ref": "#/$defs/InvoiceBankAccountInput"
            },
            {
              "type": "null"
            }
          ]
        },
        "payment_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Payment Url"
        },
        "accepted_methods": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Accepted Methods"
        },
        "instructions": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Instructions"
        }
      },
      "type": "object",
      "title": "InvoicePaymentInput"
    },
    "InvoiceShippingInput": {
      "properties": {
        "description": {
          "type": "string",
          "title": "Description",
          "default": "Shipping"
        },
        "amount": {
          "type": "string",
          "title": "Amount"
        },
        "taxable": {
          "type": "boolean",
          "title": "Taxable",
          "default": false
        }
      },
      "type": "object",
      "required": [
        "amount"
      ],
      "title": "InvoiceShippingInput"
    },
    "InvoiceTermInput": {
      "properties": {
        "type": {
          "type": "string",
          "title": "Type"
        },
        "content": {
          "type": "string",
          "title": "Content"
        }
      },
      "type": "object",
      "required": [
        "type",
        "content"
      ],
      "title": "InvoiceTermInput"
    },
    "PostalAddress": {
      "properties": {
        "line1": {
          "type": "string",
          "title": "Line1"
        },
        "line2": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Line2"
        },
        "city": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "City"
        },
        "state": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "State"
        },
        "postal_code": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Postal Code"
        },
        "country": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Country"
        }
      },
      "type": "object",
      "required": [
        "line1"
      ],
      "title": "PostalAddress"
    },
    "TaxCategory": {
      "properties": {
        "code": {
          "type": "string",
          "minLength": 1,
          "title": "Code",
          "description": "UNCL5305 tax category code — S standard, Z zero-rated, E exempt, AE reverse charge, K intra-community, G export, O outside scope"
        },
        "exemption_reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Exemption Reason",
          "description": "Required by EN 16931 whenever the category is not standard."
        },
        "exemption_reason_code": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Exemption Reason Code"
        }
      },
      "type": "object",
      "required": [
        "code"
      ],
      "title": "TaxCategory",
      "description": "How a tax is treated, as opposed to what it is called.\n\n`name` and `rate` do not say this: two taxes at 0% may be zero-rated,\nexempt, reverse-charge or outside scope, and EN 16931 keeps them in\nseparate VAT breakdown groups with different mandatory fields. Optional,\nso an invoice that never mentions a category calculates exactly as before."
    }
  }
}