{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dhl/json-schema/dhl-create-or-update-dp-contract-rep-schema.json",
  "title": "CreateOrUpdateDpContractRep",
  "description": "Representation of a contract 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/CreateOrUpdateDpContractRep",
  "type": "object",
  "properties": {
    "contractType": {
      "type": "integer",
      "format": "int32",
      "default": 1,
      "description": "The type of the contract."
    },
    "ownerEkp": {
      "type": "string",
      "description": "Identifies the contract owner. The first 10 digits of the contract number.This ekp has to be added to your addresses prior to contract creation.",
      "minLength": 1
    },
    "procedureNumber": {
      "type": "string",
      "description": "This two-digit number ('Verfahren') is a part of your contract with Deutsche Post. Currently ONLY procedures 10 and 25 are supported.",
      "maxLength": 2,
      "minLength": 2,
      "pattern": "10|25"
    },
    "subscriptionNumber": {
      "type": "string",
      "description": "This two-digit number ('Teilnahme') is a part of your contract with Deutsche Post.",
      "maxLength": 2,
      "minLength": 2,
      "pattern": "0[1-9]|[1-9][0-9]|[A-F][A-Z]"
    },
    "name": {
      "type": "string",
      "description": "A human readable name for this contract.",
      "maxLength": 255,
      "minLength": 0
    },
    "originatorEkp": {
      "type": "string",
      "description": "Identifies the originator. This is the one who is the sender. This ekp has to be added to your addresses prior to contract creation. You may change this value in a concrete processing.",
      "minLength": 1
    },
    "submitterEkp": {
      "type": "string",
      "description": "Identifies the submitter. This is the one who conducts the induction. This ekp has to be added to your addresses prior to contract creation. You may change this value in a concrete processing.",
      "minLength": 1
    },
    "entitledToDeductPreTax": {
      "type": "boolean",
      "description": "Specifies whether the originator of this mailing is entitled to deduct pre-tax. If he is, net costs will be minimized."
    },
    "payment": {
      "$ref": "#/$defs/DpContractPaymentParametersRep",
      "description": "Specifies payment parameters for a procedure 25 contract. Not needed for other procedures (set to null in this case). not needed for contract type LETTER."
    },
    "inductionType": {
      "type": "integer",
      "format": "int32",
      "description": "Specifies whether mailings should be picked-up from an address or are transported to a Deutsche Post depot. See lookup resource 'InductionType' for available values. Only depot induction is valid for contract type LETTER."
    },
    "induction": {
      "$ref": "#/$defs/InductionBaseRep",
      "description": "Specifies induction parameters."
    },
    "customerId": {
      "type": "integer",
      "format": "int64",
      "description": "The customer id for which to act."
    }
  },
  "required": [
    "customerId",
    "entitledToDeductPreTax",
    "induction",
    "inductionType",
    "name",
    "originatorEkp",
    "ownerEkp",
    "procedureNumber",
    "submitterEkp",
    "subscriptionNumber"
  ],
  "$defs": {
    "DpContractPaymentParametersRep": {
      "type": "object",
      "properties": {
        "cardEkp": {
          "type": "string",
          "description": "Post customer number (EKP, 10 characters) of postcard's owner. Should always be specified."
        },
        "cardNo": {
          "type": "string",
          "description": "Post card number (4 to 7 characters) that is a supplement to the EKP.",
          "minLength": 1,
          "pattern": "\\d{2}[\\dA-Za-z]{2}(?:\\d{3})?"
        }
      },
      "required": [
        "cardNo"
      ]
    },
    "InductionBaseRep": {
      "type": "object",
      "properties": {
        "depotName": {
          "type": "string",
          "description": "Name of the Deutsche Post depot. Use a location of type 'ELN-Depot' for your pick-up induction or a location of type 'LARGE_RECEIVING_POINT' for post-to-depot induction. See 'depotlookups' resource for available values.",
          "maxLength": 50,
          "minLength": 0
        },
        "pickUpLocationStreet": {
          "type": "string",
          "description": "Relevant only if you chose InductionType=1, pick-up location: Street without house number.",
          "maxLength": 50,
          "minLength": 0
        },
        "pickUpLocationHouseNumber": {
          "type": "string",
          "description": "Relevant only if you chose InductionType=1, pick-up location: House number.",
          "maxLength": 20,
          "minLength": 0
        },
        "pickUpLocationZip": {
          "type": "string",
          "description": "Relevant only if you chose InductionType=1, pick-up location: Zip code.",
          "maxLength": 10,
          "minLength": 0
        },
        "pickUpLocationCity": {
          "type": "string",
          "description": "Relevant only if you chose InductionType=1, pick-up location: City.",
          "maxLength": 50,
          "minLength": 0
        },
        "pickUpLocationCountry": {
          "type": "string",
          "description": "Relevant only if you chose InductionType=1, pick-up location: Country (ISO 3166-1 alpha-2: 2 letters).",
          "maxLength": 2,
          "minLength": 2
        }
      }
    }
  }
}