{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/beel-es/json-schema/beel-es-create-invoice-delivery-request-schema.json",
  "title": "CreateInvoiceDeliveryRequest",
  "description": "One email delivery carrying several invoices of this company as attachments.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/beel-es-companyinvoicedelivery-api-openapi.yml#/components/schemas/CreateInvoiceDeliveryRequest",
  "type": "object",
  "required": [
    "invoice_ids",
    "recipients"
  ],
  "properties": {
    "invoice_ids": {
      "type": "array",
      "minItems": 1,
      "maxItems": 200,
      "items": {
        "$ref": "#/$defs/UUID"
      }
    },
    "recipients": {
      "type": "array",
      "description": "Email recipients. At least one is required: no address is inferred from any profile.\n",
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/Email"
      }
    },
    "cc": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Email"
      },
      "description": "CC recipients. Copied addresses count as recipients of the message: they are subject\nto the same sending restrictions and to the same quota as the addresses in `recipients`.\nWhen omitted, the CC addresses in the `defaults` of the company's email configuration apply\n(the `email_config.cc` of the invoice applies only when the delivery carries one invoice); send an\nempty array to deliver the message without any copy.\n"
    },
    "subject": {
      "type": "string",
      "description": "Custom email subject. When omitted, the `email_config.subject` of the invoice applies if the\ndelivery carries one invoice, then the `defaults.subject` of the company's email\nconfiguration, then the standard subject. Variables resolve per delivery (see `message`).\n",
      "maxLength": 200
    },
    "message": {
      "type": "string",
      "description": "Custom message body. When omitted, the `email_config.message` of the invoice applies if the\ndelivery carries one invoice, then the `defaults.message` of the company's email\nconfiguration, then the standard message. Variables in `subject` and `message` resolve per\ndelivery, which is one email: `{invoiceNumber}` is the list of invoice numbers separated by\n\", \", `{customerName}` only when every invoice has the same customer, `{issuerName}` is the\nissuer, and the others (total, dates) are empty.\n",
      "maxLength": 2000
    },
    "language": {
      "allOf": [
        {
          "$ref": "#/$defs/Language"
        }
      ],
      "description": "Email language. Defaults to the language of the requesting user."
    }
  },
  "$defs": {
    "Email": {
      "type": "string",
      "format": "email",
      "minLength": 5,
      "maxLength": 255,
      "description": "Email address (minimum valid email is 5 chars, e.g. a@b.co)"
    },
    "Language": {
      "type": "string",
      "description": "Supported languages: `es` Spanish, `en` English, `ca` Catalan.\n",
      "enum": [
        "es",
        "en",
        "ca"
      ]
    },
    "UUID": {
      "type": "string",
      "format": "uuid",
      "description": "Universally Unique Identifier (UUID v4)"
    }
  }
}