{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dhl/json-schema/dhl-create-or-update-production-definition-rep-schema.json",
  "title": "CreateOrUpdateProductionDefinitionRep",
  "description": "Representation of a production definition for creating.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dhl-deutsche-post-print-mailing-dispatch-preparation-post-parcel-germany-openapi.yml#/components/schemas/CreateOrUpdateProductionDefinitionRep",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "A human readable name for this production definition.",
      "maxLength": 255,
      "minLength": 0
    },
    "type": {
      "type": "integer",
      "format": "int32",
      "default": 0,
      "description": "The product definition type. See lookup resource 'DisProductionDefinitionType' for available values."
    },
    "mailingItemType": {
      "type": "integer",
      "format": "int32",
      "description": "A mailing item type. See lookup resource 'MailingItemType' for available values."
    },
    "lengthInDeciMm": {
      "type": "integer",
      "format": "int64",
      "description": "Length of the mailing item in 1/10 mm. Values will be rounded up to millimeters for the processing run.",
      "maximum": 6000,
      "minimum": 1000
    },
    "widthInDeciMm": {
      "type": "integer",
      "format": "int64",
      "description": "Width of the mailing item in 1/10 mm. Values will be rounded up to millimeters for the processing run.",
      "maximum": 4490,
      "minimum": 700
    },
    "heightInDeciMm": {
      "type": "integer",
      "format": "int64",
      "description": "Height/Thickness of the mailing item in 1/10 mm. ",
      "maximum": 3000,
      "minimum": 1
    },
    "notEnabledForAutomation": {
      "type": "boolean",
      "default": false,
      "description": "Indicates whether the mailing items are not enabled for automation. Does not apply to product Postaktuell"
    },
    "dialogpostKoop": {
      "type": "boolean",
      "default": false,
      "description": "Specifies whether Dialogpost-Koop is used. When this option is set, extra items to reach a minimum of 100,000 total mailing items will be added, if necessary. This may be useful for Dialogpost-Koop customers to gain extra discounts on the real items. This parameter is  not available for products Postwurfspezial and Postaktuell."
    },
    "remainingItems": {
      "type": "boolean",
      "default": true,
      "description": "Specifies whether Remaining Items are used. When this option is set, remaining items will be calculated for your processing. Make sure to add a contract of type LETTER for your remaining items to your processing. This parameter is not available for products Postwurfspezial and Postaktuell."
    },
    "unwrapped": {
      "type": "boolean",
      "default": false,
      "description": "Specifies whether the mailing items are unwrapped."
    },
    "weightInGram": {
      "type": "integer",
      "format": "int64",
      "description": "Weight of the mailing item in gram.",
      "maximum": 10000,
      "minimum": 1
    },
    "productionDefinitionFabricationType": {
      "type": "integer",
      "format": "int32",
      "description": "Type of a mailing item container (tray or bundle). See lookup resource 'ProductionDefinitionFabricationType' for available values. TRAYS are not available for product Postaktuell."
    },
    "trays": {
      "$ref": "#/$defs/ProductionDefinitionTraysRep",
      "description": "Relevant only if you chose ProductionDefinitionFabricationType=1: Production parameters for trays."
    },
    "bundles": {
      "$ref": "#/$defs/ProductionDefinitionBundlesRep",
      "description": "Relevant only if you chose ProductionDefinitionFabricationType=2: Production parameters for bundles."
    },
    "pallets": {
      "$ref": "#/$defs/ProductionDefinitionPalletsRep",
      "description": "Production definitions for pallets. Set pallets.usePallets false if you don't want pallet production."
    },
    "customerId": {
      "type": "integer",
      "format": "int64",
      "description": "The customer id for which to act."
    }
  },
  "required": [
    "customerId",
    "heightInDeciMm",
    "lengthInDeciMm",
    "mailingItemType",
    "name",
    "pallets",
    "productionDefinitionFabricationType",
    "weightInGram",
    "widthInDeciMm"
  ],
  "$defs": {
    "ProductionDefinitionBundlesRep": {
      "type": "object",
      "properties": {
        "maxNumberItemsPerContainer": {
          "type": "integer",
          "format": "int32",
          "description": "Contains the maximum number of mailing items in a container."
        },
        "productionDefinitionOptimizationType": {
          "type": "integer",
          "format": "int32",
          "description": "Define the optimization strategy for this production definition. See lookup resource 'ProductionDefinitionOptimizationType' for available values. For product Postwurfspezial, only FABRICATION_EFFORT is supported. This parameter does not apply to product Postaktuell."
        },
        "productionDefinitionNumberItemsDependentOptimizationType": {
          "type": "integer",
          "format": "int32",
          "description": "Relevant only if you chose ProductionDefinitionOptimizationType=3: Define the concrete number of items for this option in minNumberItemsForContainerLr or minNumberItemsForContainerPlz. See lookup resource 'ProductionDefinitionNumberItemsDependentOptimizationType' for available values. Not relevant for Postwurfspezial."
        },
        "minNumberItemsForContainerLr": {
          "type": "integer",
          "format": "int32",
          "description": "Relevant only if you chose ProductionDefinitionNumberItemsDependentOptimizationType=1:Specifies the minimum number of mailing items inside an LR mailing item container for the container to be produced. This setting is meant to provide a means of controlling gain of rebates vs. increased production complexity. Not relevant for Postwurfspezial.",
          "minimum": 0
        },
        "minNumberItemsForContainerPlz": {
          "type": "integer",
          "format": "int32",
          "description": "Relevant only if you chose ProductionDefinitionNumberItemsDependentOptimizationType=3:Specifies the minimum number of mailing items inside a PLZ mailing item container for the container to be produced. This setting is meant to provide a means of controlling gain of rebates vs. increased production complexity. Not relevant for Postwurfspezial.",
          "minimum": 0
        },
        "maxNumberItemsSmallBundle": {
          "type": "integer",
          "format": "int32",
          "description": "Maximum number of mailing items in a bundle for this bundle to be considered 'small'.",
          "minimum": 0
        },
        "productionOrderBundles": {
          "type": "integer",
          "format": "int32",
          "default": 1,
          "description": "Specifies the production order of bundles vs. small bundles. Find the 'ProductionOrderBundles' with options (e.g. 'Small first per pallet') using the lookup resource. ",
          "minimum": 0
        },
        "productionOrderSmallBundles": {
          "type": "integer",
          "format": "int32",
          "default": 1,
          "description": "Specifies the production order of small bundles. Find the type 'ProductionOrderSmallBundles' with options (e.g. 'ZIP ascending') using the lookup resource. ",
          "minimum": 0
        }
      },
      "required": [
        "maxNumberItemsPerContainer",
        "productionDefinitionOptimizationType"
      ]
    },
    "ProductionDefinitionPalletsRep": {
      "type": "object",
      "properties": {
        "usePallets": {
          "type": "boolean",
          "description": "Specifies whether fabrication of pallets should be enabled."
        },
        "maxNumberMailingItemsPerPallet": {
          "type": "integer",
          "format": "int32",
          "description": "Contains the maximum number of mailing items per pallet. Is mandatory for bundles. For Dialogpost, this parameter does not apply to trays."
        },
        "alwaysProducePallets": {
          "type": "boolean",
          "default": false,
          "description": "Specifies whether pallets are even produced when they are not required, like for a total item weight of less than 500 kg. For product Postwurfspezial, only value true is valid."
        },
        "traysStackable": {
          "type": "boolean",
          "default": false,
          "deprecated": true,
          "description": "Specifies whether stackable pallets are produced. Deprecated attribute. Will be replaced by 'stackable'"
        },
        "stackable": {
          "type": "boolean",
          "default": false,
          "description": "Specifies whether stackable pallets are produced."
        },
        "emptyWeightInGram": {
          "type": "integer",
          "format": "int32",
          "default": 22000,
          "description": "Weight of an empty pallet in gram.",
          "minimum": 1000
        },
        "maxNumberTraysPerPallet": {
          "type": "integer",
          "format": "int32",
          "description": "Maximum number of trays that can be put on one pallet. Only relevant if FabricationType is TRAYS (1).",
          "minimum": 0
        },
        "maxNumberTraysPerLayer": {
          "type": "integer",
          "format": "int32",
          "description": "Maximum number of trays per layer on a pallet. Only relevant if FabricationType is TRAYS (1).",
          "minimum": 0
        },
        "productionDefinitionOptimizationType": {
          "type": "integer",
          "format": "int32",
          "default": 1,
          "description": "Define the optimization strategy for the pallet production. Define the minimum amount of saved money for this option in minSavingToProduceExtraPallet. See lookup resource 'ProductionDefinitionOptimizationType' for available values. For product  Postwurfspezial, only FABRICATION_EFFORT is supported."
        },
        "minSavingToProduceExtraPallet": {
          "type": "integer",
          "format": "int64",
          "default": 0,
          "description": "Relevant only if you chose ProductionDefinitionOptimizationType=3: Minimum amount of saved money in Cent for a not required pallet to be produced. For example, it might be possible to either put a bunch of containers on 1 LZ pallet, or on 2 LR pallets. Only if the 2 LR pallets cost at least as much less as the amount specified here, they will be produced. Otherwise, the 1 LZ pallet will be produced.",
          "minimum": 0
        }
      },
      "required": [
        "usePallets"
      ]
    },
    "ProductionDefinitionTraysRep": {
      "type": "object",
      "properties": {
        "trayType": {
          "type": "integer",
          "format": "int32",
          "description": "Available tray types (sizes). Standard Post trays exist in 2 sizes. See lookup resource 'TrayType' for available values."
        },
        "maxNumberItemsPerContainer": {
          "type": "integer",
          "format": "int32",
          "description": "Contains the maximum number of mailing items in a container."
        },
        "numberItemsForTrayHalfFull": {
          "type": "integer",
          "format": "int32",
          "description": "Number of items of this variant that will make a tray be half-full. A tray must be at least half-full for production rebates."
        },
        "productionDefinitionOptimizationType": {
          "type": "integer",
          "format": "int32",
          "description": "Define the optimization strategy for this production definition. See lookup resource 'ProductionDefinitionOptimizationType' for available values. For product Postwurfspezial, only FABRICATION_EFFORT is supported."
        },
        "productionDefinitionNumberItemsDependentOptimizationType": {
          "type": "integer",
          "format": "int32",
          "description": "Relevant only if you chose ProductionDefinitionOptimizationType=3: Define the concrete number of items for this option in minNumberItemsForContainerLr or minNumberItemsForContainerPlz. See lookup resource 'ProductionDefinitionNumberItemsDependentOptimizationType' for available values. Not relevant for Postwurfspezial."
        },
        "minNumberItemsForContainerLr": {
          "type": "integer",
          "format": "int32",
          "description": "Relevant only if you chose ProductionDefinitionNumberItemsDependentOptimizationType=1:Specifies the minimum number of mailing items inside an LR mailing item container for the container to be produced. This setting is meant to provide a means of controlling gain of rebates vs. increased production complexity. Not relevant for Postwurfspezial.",
          "minimum": 0
        },
        "minNumberItemsForContainerPlz": {
          "type": "integer",
          "format": "int32",
          "description": "Relevant only if you chose ProductionDefinitionNumberItemsDependentOptimizationType=3:Specifies the minimum number of mailing items inside a PLZ mailing item container for the container to be produced. This setting is meant to provide a means of controlling gain of rebates vs. increased production complexity. Not relevant for Postwurfspezial.",
          "minimum": 0
        }
      },
      "required": [
        "maxNumberItemsPerContainer",
        "productionDefinitionOptimizationType",
        "trayType"
      ]
    }
  }
}