{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dhl/json-schema/dhl-customs-document-upload-request-schema.json",
  "title": "CustomsDocumentUploadRequest",
  "description": "Multipart/form-data request body for uploading customs documents. Currently, only one document can be uploaded per request. Support for up to four documents per request is planned for a future release.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dhl-parcel-de-shipping-post-parcel-germany-v2-openapi.yml#/components/schemas/CustomsDocumentUploadRequest",
  "type": "object",
  "required": [
    "documents"
  ],
  "properties": {
    "documents": {
      "minItems": 1,
      "maxItems": 1,
      "type": "array",
      "description": "List of customs documents to upload. Submitted as multipart form fields using bracket notation, e.g. documents[0].documentType, documents[0].userDefinedReference, documents[0].data, documents[1]...",
      "items": {
        "$ref": "#/$defs/CustomsDocumentUploadItem"
      }
    }
  },
  "$defs": {
    "CustomsDocumentUploadItem": {
      "required": [
        "documentType",
        "data"
      ],
      "type": "object",
      "properties": {
        "documentType": {
          "type": "string",
          "description": "Type of the customs document.",
          "enum": [
            "Invoice",
            "CN23"
          ]
        },
        "userDefinedReference": {
          "maxLength": 60,
          "minLength": 0,
          "type": "string",
          "description": "Optional customer-defined reference for the document, e.g. an order or file reference. Values exceeding 60 characters are truncated and result in a warning."
        },
        "data": {
          "type": "string",
          "format": "binary",
          "description": "The PDF file content. Only application/pdf is accepted. Maximum file size 1 MB, maximum filename length 60 characters."
        }
      },
      "description": "A single customs document and its metadata."
    }
  }
}