{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/dhl/json-schema/dhl-domestic-response-schema.json",
  "title": "DomesticResponse",
  "x-generated": "2026-11-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/dhl-label-dhl-ecommerce-americas-openapi.yml#/components/schemas/DomesticResponse",
  "type": "object",
  "properties": {
    "timestamp": {
      "type": "string",
      "description": "Date and time of the label request; ISO-8601 date/time format.(M)",
      "format": "date-time",
      "minLength": 1,
      "maxLength": 50
    },
    "pickup": {
      "type": "string",
      "maxLength": 10,
      "minLength": 1,
      "description": "DHLeCS pickup account number. You will receive this number from DHL sales after onboarding. (M)"
    },
    "distributionCenter": {
      "type": "string",
      "maxLength": 6,
      "minLength": 1,
      "description": "DHL eCommerce Distribution center where the package will be lodged after pickup. Depends on the pickup location and this may not be the same as what was submitted in the request. (M)"
    },
    "labels": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "createdOn": {
            "type": "string",
            "format": "date-time",
            "minLength": 1,
            "maxLength": 50,
            "description": "Date and time the label was created in UTC format. (M)"
          },
          "packageId": {
            "type": "string",
            "maxLength": 30,
            "minLength": 1,
            "description": "Customer-provided package ID, also known as the CCN (customer confirmation number) or the GM number. (M)"
          },
          "dhlPackageId": {
            "type": "string",
            "maxLength": 16,
            "minLength": 1,
            "description": "DHL-generated package ID. (M)"
          },
          "trackingId": {
            "type": "string",
            "maxLength": 30,
            "minLength": 1,
            "description": "Last-mile carrier package ID. For international shipments, this ID is only available after the package has been shipped. For domestic shipments, this ID contains the full USPS IMpb number and is always available. If the package is overlabeled for any reason, this field contains the latest carrier package ID. (C)"
          },
          "labelData": {
            "type": "string",
            "description": "This will be an encoded string containing the shipping label image or a plain text zpl string depending on the format requested. (M)",
            "minLength": 0,
            "maxLength": 100000
          },
          "encodeType": {
            "type": "string",
            "description": "Either base64 or plain text depending on the label format requested.",
            "enum": [
              "BASE64",
              "PLAIN"
            ]
          },
          "format": {
            "type": "string",
            "description": "Formats supported are ZPL, PNG, or PDF. One of these formats depending on the label format requested. (M)",
            "enum": [
              "ZPL",
              "PNG",
              "PDF"
            ]
          },
          "link": {
            "type": "string",
            "minLength": 1,
            "maxLength": 150,
            "description": "Link to the label. (M)"
          },
          "labelDetail": {
            "type": "object",
            "properties": {
              "serviceLevel": {
                "type": "string",
                "description": "If service level for the piece is Ground Service, indicates GRD. (C)",
                "minLength": 1,
                "maxLength": 30
              },
              "outboundSortCode": {
                "type": "string",
                "description": "Identifies the DHL eCommerce outbound sort code.(O)",
                "minLength": 1,
                "maxLength": 30
              },
              "sortingSetupVersion": {
                "type": "string",
                "minLength": 1,
                "maxLength": 30,
                "description": "Defines the sort code version used to generate the sort code.(O)"
              },
              "inboundSortCode": {
                "type": "string",
                "minLength": 1,
                "maxLength": 30,
                "description": "String identifying the DHL eCommerce inbound sort code.(O)"
              },
              "serviceEndorsement": {
                "type": "string",
                "minLength": 1,
                "maxLength": 30,
                "description": "Ancillary service endorsements are used to request a new address and to provide the USPS with instructions on how to handle undeliverable-as-addressed pieces. The endorsements are the same for all classes of mail, but the treatment and cost differ by class of mail. Use of an ancillary service endorsement on a mailpiece obligates the mailer to pay any applicable charges for forwarding, return, and separate address notification charges. (O)"
              },
              "intendedReceivingFacility": {
                "type": "string",
                "minLength": 1,
                "maxLength": 30,
                "description": "Identifies the final DHL eCommerce facility from which the shipment will be injected into the USPS mail stream.(O)"
              },
              "mailBanner": {
                "type": "string",
                "description": "This element contains banner text that is required on the piece by the USPS. (O)",
                "minLength": 1,
                "maxLength": 30
              },
              "customsDetailsProvided": {
                "type": "boolean",
                "description": "True if at least one customs details (commodity level) data was provided in the request. Not required for US Domestic products. (N)"
              }
            }
          }
        }
      }
    },
    "orderedProductId": {
      "type": "string",
      "maxLength": 10,
      "minLength": 1,
      "pattern": "^[A-Z]{3}$",
      "description": "DHL eCommerce three-character product code that was requested. Please refer to our documentation site for a full list of product codes. (M)"
    }
  }
}