{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dhl/json-schema/dhl-app-shopping-cart-pdfrequest-schema.json",
  "title": "AppShoppingCartPDFRequest",
  "description": "The request object for external partners to buy an internet stamp in PDF format.",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dhl-deutsche-post-internetmarke-post-parcel-germany-openapi.yml#/components/schemas/AppShoppingCartPDFRequest",
  "required": [
    "positions",
    "type"
  ],
  "type": "object",
  "allOf": [
    {
      "$ref": "#/$defs/AppCheckoutPDFRequest"
    },
    {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "AppShoppingCartPDFRequest",
            "AppShoppingCartPreviewPDFRequest"
          ],
          "default": "AppShoppingCartPDFRequest",
          "description": "set AppShoppingCartPDFRequest if validate=false, AppShoppingCartPreviewPDFRequest if validate=true"
        },
        "shopOrderId": {
          "maxLength": 18,
          "minLength": 1,
          "type": "string",
          "description": "The order number in the shop. All characters are allowed except < and &. It is optional in case of query parameter finalize is true. In all other cases it is mandatory required."
        },
        "total": {
          "type": "integer",
          "description": "Total value of the shopping cart in euro cents.",
          "format": "int32"
        },
        "createManifest": {
          "type": "boolean",
          "description": "The flag indicating whether a posting receipt should be created."
        },
        "createShippingList": {
          "type": "string",
          "enum": [
            "0",
            "1",
            "2"
          ],
          "description": "Identifier of which type of shipping list is to be created: 0: No shipping list 1: Shipping list without addresses / delivery receipt only 2: Shipping list with addresses"
        },
        "dpi": {
          "type": "string",
          "enum": [
            "DPI300",
            "DPI203"
          ]
        },
        "pageFormatId": {
          "minimum": 1,
          "type": "integer",
          "description": "The ID of the print format. All available formats can be identified by request /app/catalog?types=PAGE_FORMATS",
          "format": "int32"
        },
        "positions": {
          "type": "array",
          "description": "List of PDF order items. At least one item has to be specified.",
          "items": {
            "$ref": "#/$defs/AppShoppingCartPDFPosition"
          }
        }
      },
      "required": [
        "total"
      ]
    }
  ],
  "$defs": {
    "Address": {
      "description": "The address information used for sender and receiver.",
      "required": [
        "addressLine1",
        "city",
        "country",
        "name",
        "postalCode"
      ],
      "type": "object",
      "properties": {
        "name": {
          "maxLength": 50,
          "minLength": 1,
          "type": "string",
          "description": "The name information (firstname lastname)"
        },
        "additionalName": {
          "maxLength": 40,
          "minLength": 0,
          "type": "string",
          "description": "The additional name information (i. e. company name)"
        },
        "addressLine1": {
          "maxLength": 50,
          "minLength": 1,
          "type": "string",
          "description": "This is the first line of the address. Usually street name and house number."
        },
        "addressLine2": {
          "maxLength": 60,
          "minLength": 1,
          "type": "string",
          "description": "Line 2 of the street address. Most of the time this is not needed and not printed to most labels."
        },
        "postalCode": {
          "maxLength": 5,
          "minLength": 5,
          "type": "string",
          "description": "The zip code."
        },
        "city": {
          "maxLength": 40,
          "minLength": 1,
          "type": "string",
          "description": "The name of the city."
        },
        "country": {
          "maxLength": 3,
          "minLength": 3,
          "type": "string",
          "description": "The iso 3 code of the country."
        }
      }
    },
    "AddressBinding": {
      "required": [
        "receiver",
        "sender"
      ],
      "type": "object",
      "properties": {
        "sender": {
          "$ref": "#/$defs/Address"
        },
        "receiver": {
          "$ref": "#/$defs/Address"
        }
      },
      "description": "The combination of sender and receiver address."
    },
    "AppCheckoutPDFRequest": {
      "description": "The base request object for external partners to get an internet stamp in PDF format.",
      "required": [
        "type"
      ],
      "type": "object",
      "properties": {
        "type": {
          "type": "string"
        }
      }
    },
    "AppShoppingCartPDFPosition": {
      "required": [
        "position",
        "positionType",
        "productCode",
        "voucherLayout"
      ],
      "type": "object",
      "description": "The representation of an order item in PDF format.",
      "allOf": [
        {
          "$ref": "#/$defs/AppShoppingCartPosition"
        },
        {
          "type": "object",
          "properties": {
            "position": {
              "$ref": "#/$defs/VoucherPosition"
            },
            "positionType": {
              "type": "string"
            }
          }
        }
      ]
    },
    "AppShoppingCartPosition": {
      "required": [
        "positionType",
        "productCode",
        "voucherLayout"
      ],
      "type": "object",
      "properties": {
        "productCode": {
          "minimum": 1,
          "type": "integer",
          "description": "The product code for the selected product, e.g. standard letter, maxi letter etc. The product code can be derived from ProdWS integration or directly taken from the downloadable product price lists (PPLs). The product code must be greater than 0 and the product must be available in the third-party application.",
          "format": "int32"
        },
        "imageID": {
          "type": "integer",
          "description": "The id of the motif to be printed.",
          "format": "int32"
        },
        "address": {
          "$ref": "#/$defs/AddressBinding"
        },
        "voucherLayout": {
          "type": "string",
          "enum": [
            "ADDRESS_ZONE",
            "FRANKING_ZONE"
          ]
        },
        "positionType": {
          "type": "string",
          "default": "AppShoppingCartPosition"
        }
      },
      "description": "The representation of an order item in PNG format."
    },
    "VoucherPosition": {
      "type": "object",
      "properties": {
        "labelX": {
          "type": "integer",
          "description": "The x-position of the label.",
          "format": "int32"
        },
        "labelY": {
          "type": "integer",
          "description": "The y-position of the label.",
          "format": "int32"
        },
        "page": {
          "type": "integer",
          "description": "The target page in the printout.",
          "format": "int32"
        }
      },
      "description": "The position coordinates of the order item. It is mandatory required for the PDF format. Values >0 are mandatory."
    }
  }
}