{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/usps/json-schema/usps-label-metadata-schema.json",
  "title": "Label Metadata",
  "description": "Label Metadata returned from label creation and label edit.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/usps-domestic-labels-openapi.yml#/components/schemas/LabelMetadata",
  "type": "object",
  "properties": {
    "labelAddress": {
      "$ref": "#/$defs/DomesticLabelAddress"
    },
    "routingInformation": {
      "type": "string",
      "description": "The \"420\" 3-digit GS1 Application Identifier and the 5 or 9 digit Destination ZIP Code&#8482;."
    },
    "trackingNumber": {
      "type": "string",
      "description": "The human-readable version of the package tracking number."
    },
    "constructCode": {
      "type": "string",
      "description": "The barcode construct code associated with the tracking number."
    },
    "SKU": {
      "type": "string",
      "description": "Pricing SKU."
    },
    "postage": {
      "type": "number",
      "description": "Amount of Postage Required, does not include insurance or other extra service fees."
    },
    "extraServices": {
      "$ref": "#/$defs/ExtraServiceResponse"
    },
    "serviceTypeCode": {
      "type": "string",
      "description": "The Service Type Code associated with the package. A list of Service Type Codes can be found at: [https://postalpro.usps.com/IMPB_Service_Type_Codes](https://postalpro.usps.com/IMPB_Service_Type_Codes).\n"
    },
    "zone": {
      "type": "string",
      "description": "Indicates the calculated zone used for pricing between the provided `originZIPCode` and `destinationZIPCode` for a given `mailClass`, `mailingDate`, `rateIndicator`, and `weight`."
    },
    "mailingDate": {
      "type": "string",
      "description": "The date on which the package will be mailed as provided in the request. If the time was not provided, it will be defaulted to 10:00 p.m. local time.",
      "format": "date-time"
    },
    "commitment": {
      "$ref": "#/$defs/Commitment"
    },
    "weightUOM": {
      "type": "string",
      "description": "Weight Unit of Measurement\n   * lb - Pounds"
    },
    "weight": {
      "type": "number",
      "description": "The package weight, in weightUOM. Items must weigh 70 pounds (1120 ounces) or less."
    },
    "dimensionalWeight": {
      "type": "number",
      "description": "The dimensional weight of the package, if greater than specified in weight, in ounces."
    },
    "fees": {
      "type": "array",
      "description": "Fees associated with the package.",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the fee."
          },
          "SKU": {
            "type": "string",
            "description": "Pricing SKU."
          },
          "price": {
            "type": "number",
            "description": "The price for the fee.",
            "format": "float"
          }
        },
        "additionalProperties": false
      }
    },
    "permitHolderName": {
      "type": "string",
      "description": "The permit holder name."
    },
    "inductionType": {
      "type": "object",
      "additionalProperties": false,
      "description": "The permit holder induction type."
    },
    "labelBrokerID": {
      "maxLength": 10,
      "type": "string",
      "description": "Unique Label Broker ID that can be used as an alternative to the Label Broker QR Code to retrieve the label at a Post Office. Will only be provided when an imageType of LABEL_BROKER is requested."
    },
    "bannerText": {
      "type": "string",
      "description": "Banner text printed on the label."
    },
    "retailDistributionCode": {
      "type": "string",
      "description": "Retail Description Code associated with label."
    },
    "returnReceiptTrackingNumber": {
      "type": "string",
      "description": "The human-readable version of the return Receipt tracking number.\n\n* Note: This will be included in the response when `packageOptions.returnReceiptTracking` is set to true in the request.\n"
    },
    "links": {
      "$ref": "#/$defs/Links"
    },
    "warnings": {
      "$ref": "#/$defs/Warnings"
    }
  },
  "additionalProperties": true,
  "$defs": {
    "Address": {
      "title": "Address",
      "type": "object",
      "properties": {
        "streetAddress": {
          "maxLength": 50,
          "minLength": 1,
          "type": "string",
          "description": "The number of a building along with the name of the road or street on which it is located."
        },
        "streetAddressAbbreviation": {
          "maxLength": 50,
          "minLength": 0,
          "type": "string",
          "description": "This is the abbreviation of street address line for the address.",
          "readOnly": true
        },
        "secondaryAddress": {
          "maxLength": 50,
          "type": "string",
          "description": "The secondary unit designator, such as apartment(APT) or suite(STE) number, defining the exact location of the address within a building.  For more information please see [Postal Explorer](https://pe.usps.com/text/pub28/28c2_003.htm)."
        },
        "cityAbbreviation": {
          "type": "string",
          "description": "This is the abbreviation of city name for the address.",
          "readOnly": true
        }
      },
      "additionalProperties": true,
      "description": "Address fields standard to all locations."
    },
    "Addressee": {
      "title": "Addressee",
      "type": "object",
      "properties": {
        "firstName": {
          "maxLength": 50,
          "minLength": 1,
          "type": "string",
          "description": "First Name corresponding to the address."
        },
        "lastName": {
          "maxLength": 50,
          "minLength": 1,
          "type": "string",
          "description": "Last Name corresponding to the address."
        },
        "firm": {
          "maxLength": 50,
          "minLength": 0,
          "type": "string",
          "description": "Firm/business name corresponding to the address."
        }
      },
      "additionalProperties": true,
      "description": "Fields used to identity the entity receiving a mail piece or package"
    },
    "Commitment": {
      "title": "Commitment",
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "Commitment name such as 1-day, 2-day, 3-day, Military, DPO."
        },
        "scheduleDeliveryDate": {
          "type": "string",
          "description": "Date in the `YYYY-MM-DD` format. Date USPS expects that the package or mailpiece will be delivered based on the origin, destination, and drop-off time and date in the request. Actual delivery date may vary based on when the package or mailpiece is entered or other conditions.\n\nNote: This field has been deprecated in favor of `expectedDeliveryDate` and will be removed in a future release. Please transition to using `expectedDeliveryDate`.\n",
          "deprecated": true
        },
        "expectedDeliveryDate": {
          "type": "string",
          "description": "Date in the YYYY-MM-DD format."
        },
        "isPriorityMailNextDay": {
          "type": "boolean",
          "description": "Indicates if the commitment is for Priority Mail Next Day service."
        }
      },
      "additionalProperties": true,
      "description": "The commitment and scheduled delivery date of the package."
    },
    "DomesticAddress": {
      "title": "Domestic Address",
      "additionalProperties": true,
      "description": "Address fields for US locations",
      "allOf": [
        {
          "$ref": "#/$defs/Address"
        },
        {
          "type": "object",
          "properties": {
            "city": {
              "maxLength": 28,
              "minLength": 1,
              "type": "string",
              "description": "This is the city name of the address."
            },
            "state": {
              "$ref": "#/$defs/State"
            },
            "ZIPCode": {
              "pattern": "^\\d{5}$",
              "type": "string",
              "description": "This is the 5-digit ZIP code."
            },
            "ZIPPlus4": {
              "pattern": "^\\d{4}$",
              "type": [
                "string",
                "null"
              ],
              "description": "This is the 4-digit component of the ZIP+4 code. Using the correct Zip+4 reduces the number of times your mail is handled and can decrease the chance of a misdelivery or error."
            },
            "urbanization": {
              "maxLength": 96,
              "type": "string",
              "description": "An area, sector, or residential development within a geographic area (typically used for addresses in Puerto Rico)."
            }
          },
          "additionalProperties": true
        }
      ]
    },
    "DomesticLabelAddress": {
      "title": "Domestic Label Address",
      "required": [
        "ZIPCode",
        "city",
        "state",
        "streetAddress"
      ],
      "type": "object",
      "additionalProperties": true,
      "description": "The address where the package is being shipped from. The ZIP Code™ in the `fromAddress` object is used to calculate pricing. \n\nNotes:\n* The First and Last Name or Firm Name are always required.\n* If the `returnAddress` is not provided, the `fromAddress` will be used as the `returnAddress`.\n* If the `returnLabel` field is set to “true”, then the `fromAddress` ZIP Plus 4 is looked up by the API, unless the `ignoreBadAddress` field is set to true or the address cannot be found. If `ignoreBadAddress` field is true then ZIP Plus 4 is required.\n",
      "allOf": [
        {
          "$ref": "#/$defs/DomesticAddress"
        },
        {
          "$ref": "#/$defs/Addressee"
        },
        {
          "type": "object",
          "properties": {
            "phone": {
              "$ref": "#/$defs/Phone"
            },
            "email": {
              "$ref": "#/$defs/Email"
            },
            "ignoreBadAddress": {
              "type": "boolean",
              "description": "Allows Non-Validated Origin Street Address. Enter `true` to bypass street address validation failures/errors or `false` if only validated addresses should be allowed.\n\nNote: Integrators are recommended to always use `false` to ensure no delivery issues. In the event USPS cannot validate the street address, this tag will “bypass” address validation error when `true` is indicated to allow label creation which could impact delivery.\n"
            }
          },
          "additionalProperties": true
        }
      ]
    },
    "Email": {
      "maxLength": 50,
      "pattern": "^[a-zA-Z0-9_+&*-]+(?:\\.[a-zA-Z0-9_+&*-]+)*@(?:[a-zA-Z0-9-]+\\.)+[a-zA-Z]{2,}$",
      "type": "string",
      "description": "Email address used for redirect notification via email. ",
      "format": "email"
    },
    "ExtraServiceResponse": {
      "title": "Extra Service Response",
      "type": "array",
      "minItems": 0,
      "description": "Extra services requested on the mailpiece.",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "description": "Name of the extra service."
          },
          "SKU": {
            "type": "string",
            "description": "SKU of the extra service."
          },
          "price": {
            "type": "number",
            "description": "The price for the extra service.",
            "format": "float"
          },
          "warnings": {
            "type": "array",
            "description": "Warnings and additional details around the Extra Services.",
            "minItems": 0,
            "items": {
              "type": "object",
              "properties": {
                "warningCode": {
                  "type": "string",
                  "description": "Code corresponding to the warning"
                },
                "warningDescription": {
                  "type": "string",
                  "description": "Warning or additional information regarding the Extra Service."
                }
              },
              "additionalProperties": false
            }
          }
        },
        "additionalProperties": false
      }
    },
    "Links": {
      "title": "Hypermedia Links",
      "type": "array",
      "description": "Hypermedia links to related resources.",
      "items": {
        "required": [
          "href",
          "rel"
        ],
        "type": "object",
        "properties": {
          "rel": {
            "type": "array",
            "description": "The short name(s) of the relationship corresponding to the link.",
            "items": {
              "type": "string"
            }
          },
          "title": {
            "type": "string",
            "description": "A human-readable description of the link relationship."
          },
          "href": {
            "type": "string",
            "description": "The URL to a related resource.",
            "format": "uri"
          },
          "method": {
            "type": "string",
            "description": "The HTTP method to use to access this link.",
            "enum": [
              "GET",
              "POST",
              "PUT",
              "DELETE"
            ]
          },
          "submissionMediaType": {
            "type": "string",
            "description": "The media type of the resource request."
          },
          "targetMediaType": {
            "type": "string",
            "description": "The media type of the resource response."
          }
        },
        "additionalProperties": false
      }
    },
    "Phone": {
      "pattern": "^\\+?[1-9][0-9]{7,14}$|^[0-9]{6,15}$",
      "type": "string",
      "description": "The phone number, including the country extension and area code or the local national format, with no punctuation."
    },
    "State": {
      "maxLength": 2,
      "minLength": 2,
      "pattern": "^(AA|AE|AL|AK|AP|AS|AZ|AR|CA|CO|CT|DE|DC|FM|FL|GA|GU|HI|ID|IL|IN|IA|KS|KY|LA|ME|MH|MD|MA|MI|MN|MS|MO|MP|MT|NE|NV|NH|NJ|NM|NY|NC|ND|OH|OK|OR|PW|PA|PR|RI|SC|SD|TN|TX|UT|VT|VI|VA|WA|WV|WI|WY)$",
      "type": "string",
      "description": "This is the two-character state code of the address."
    },
    "Warnings": {
      "title": "Warnings",
      "type": "array",
      "description": "Warnings and additional details around the Label.",
      "minItems": 0,
      "items": {
        "type": "object",
        "properties": {
          "warningCode": {
            "type": "string",
            "description": "Code corresponding to the warning"
          },
          "warningDescription": {
            "type": "string",
            "description": "Warning or additional information regarding the Label."
          }
        },
        "additionalProperties": false
      }
    }
  }
}