{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dhl/json-schema/dhl-app-shopping-cart-pngrequest-schema.json",
  "title": "AppShoppingCartPNGRequest",
  "description": "The request object for external partners to buy an internet stamp in PNG 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/AppShoppingCartPNGRequest",
  "required": [
    "positions",
    "type"
  ],
  "type": "object",
  "allOf": [
    {
      "$ref": "#/$defs/AppCheckoutPNGRequest"
    },
    {
      "type": "object",
      "properties": {
        "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 directCheckout 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"
          ]
        },
        "optimizePNG": {
          "type": "boolean",
          "description": "The flag to optimize the PNG (avoid redundant area height)."
        },
        "positions": {
          "type": "array",
          "description": "List of PNG order items. At least one item has to be specified.",
          "items": {
            "$ref": "#/$defs/AppShoppingCartPosition"
          }
        },
        "type": {
          "type": "string"
        }
      },
      "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."
    },
    "AppCheckoutPNGRequest": {
      "description": "The base request object for external partners to get an internet stamp in PNG format.",
      "required": [
        "type"
      ],
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "AppShoppingCartPNGRequest",
            "AppShoppingCartPreviewPNGRequest"
          ],
          "default": "AppShoppingCartPNGRequest",
          "description": "set AppShoppingCartPNGRequest if validate=false, AppShoppingCartPreviewPNGRequest if validate=true"
        }
      }
    },
    "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."
    }
  }
}