{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/usps/json-schema/usps-post-office-location-schema.json",
  "title": "Post Office Location",
  "description": "USPS&#174; Destination Entry Drop Shipment Location",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/usps-locations-openapi.yml#/components/schemas/PostOfficeLocation",
  "type": "object",
  "properties": {
    "facilityName": {
      "type": "string",
      "description": "The name of the facility"
    },
    "facilityAddress": {
      "allOf": [
        {
          "$ref": "#/$defs/DomesticAddress"
        }
      ]
    },
    "facilityID": {
      "type": "string",
      "description": "The USPS&#174; facility ID. When requesting Parcel Locker Delivery while generating a label, this ID should be provided in the request."
    },
    "geoCoordinates": {
      "type": "object",
      "description": "The latitude and longitude values.",
      "properties": {
        "latitude": {
          "type": "number",
          "description": "The latitude geo coordinate."
        },
        "longitude": {
          "type": "number",
          "description": "The longitude geo coordinate."
        }
      }
    },
    "postOfficeType": {
      "type": "string",
      "description": "The type of location.",
      "default": "POST_OFFICE",
      "enum": [
        "CONTRACT_POSTAL_UNIT",
        "POST_OFFICE",
        "SELF_SERVICE_KIOSK",
        "VILLAGE_POST_OFFICE"
      ]
    },
    "distance": {
      "type": "number",
      "description": "The distance from the provided address to the Post Office (in miles)."
    },
    "phoneNumbers": {
      "type": "object",
      "properties": {
        "phone": {
          "$ref": "#/$defs/Phone"
        },
        "fax": {
          "$ref": "#/$defs/Phone"
        }
      },
      "description": "Post office contact information."
    },
    "services": {
      "type": "array",
      "description": "A list of services offered at the location.",
      "items": {
        "type": "object",
        "properties": {
          "service": {
            "type": "string",
            "description": "The services supported at the facility."
          },
          "hours": {
            "type": "array",
            "description": "the days & hours that the associated service is available at the post office.",
            "items": {
              "$ref": "#/$defs/HoursOfOperation"
            }
          },
          "additionalInformation": {
            "type": "object",
            "properties": {
              "mailClasses": {
                "type": "array",
                "description": "The list of mail classes that are supported for the Hold for Pickup service at a given facility.",
                "items": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "temporaryClosure": {
      "type": "boolean",
      "description": "Indicator if the location has a current or upcoming temporary closure."
    },
    "temporaryClosureDate": {
      "type": "string",
      "description": "The start date of the temporary closure.",
      "format": "date"
    },
    "specialHours": {
      "$ref": "#/$defs/SpecialHoursOfOperation"
    },
    "parking": {
      "type": "string",
      "description": "The type of parking available at the location.",
      "enum": [
        "LOT",
        "STREET"
      ]
    },
    "passports": {
      "type": "object",
      "description": "Facility information for passport services.",
      "properties": {
        "phone": {
          "$ref": "#/$defs/Phone"
        },
        "photoCost": {
          "type": "number",
          "description": "The cost of passport photos at the location in dollars."
        },
        "appointmentRequired": {
          "type": "boolean",
          "description": "Whether appointments are required to take passport photos at the location."
        }
      }
    },
    "timeZone": {
      "type": "string",
      "description": "The time zone returned for a given facility."
    },
    "DSTObserved": {
      "type": "boolean",
      "description": "Indicator for whether Daylight Savings Time is observed for a given facility."
    }
  },
  "additionalProperties": false,
  "$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."
    },
    "DomesticAddress": {
      "title": "Domestic Address",
      "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": {
              "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 two-character state code of the address."
            },
            "ZIPCode": {
              "pattern": "\\d{5}",
              "type": "string",
              "description": "This is the 5-digit ZIP code."
            },
            "ZIPPlus4": {
              "pattern": "\\d{4}",
              "type": "string",
              "description": "This is the ZIP+4 extension."
            },
            "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
        }
      ]
    },
    "HoursOfOperation": {
      "type": "object",
      "properties": {
        "dayOfWeek": {
          "type": "string",
          "description": "The day of the week for the set of hours.",
          "enum": [
            "MONDAY",
            "TUESDAY",
            "WEDNESDAY",
            "THURSDAY",
            "FRIDAY",
            "SATURDAY",
            "SUNDAY"
          ]
        },
        "times": {
          "type": "array",
          "description": "Hours",
          "items": {
            "type": "object",
            "properties": {
              "openTime": {
                "type": "string",
                "description": "The time that the facility opens."
              },
              "closeTime": {
                "type": "string",
                "description": "The time that the facility closes."
              }
            }
          }
        }
      },
      "additionalProperties": false,
      "description": "Facility hours of operation intervals of a day."
    },
    "Phone": {
      "pattern": "^\\+?[1-9][0-9]{7,14}$",
      "type": "string",
      "description": "The phone number, including the country extension and area code, with no punctuation."
    },
    "SpecialHoursOfOperation": {
      "type": "array",
      "description": "Facility hours of operation intervals of a day.",
      "items": {
        "type": "object",
        "properties": {
          "date": {
            "type": "string",
            "description": "The day of the week for the set of hours.",
            "format": "date"
          },
          "open": {
            "type": "boolean",
            "description": "Indicates if the facility is open."
          },
          "times": {
            "type": "array",
            "description": "Holiday Hours",
            "items": {
              "type": "object",
              "properties": {
                "openTime": {
                  "type": "string",
                  "description": "The time that the facility opens."
                },
                "closeTime": {
                  "type": "string",
                  "description": "The time that the facility closes."
                }
              }
            }
          }
        }
      }
    }
  }
}