{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/usps/json-schema/usps-international-letter-rates-query-schema.json",
  "title": "International Letter Rates Query",
  "description": "Letter rate ingredients for calculating base prices.",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/usps-international-prices-openapi.yml#/components/schemas/InternationalLetterRatesQuery",
  "required": [
    "height",
    "length",
    "processingCategory",
    "thickness",
    "weight",
    "destinationCountryCode"
  ],
  "type": "object",
  "properties": {
    "weight": {
      "$ref": "#/$defs/WeightOunces"
    },
    "length": {
      "minimum": 0,
      "exclusiveMinimum": true,
      "type": "number",
      "description": "The letter/flat length measured in inches.  For  _`LETTERS`_ the length is the dimension parallel to the delivery address as read. For  _`FLATS`_ the length is the longest dimension.",
      "format": "double"
    },
    "height": {
      "minimum": 0,
      "exclusiveMinimum": true,
      "type": "number",
      "description": "The letter/flat height measured in inches.  The height is the dimension perpendicular to the length.",
      "format": "double"
    },
    "thickness": {
      "minimum": 0,
      "exclusiveMinimum": true,
      "type": "number",
      "description": "The letter/flat thickness measured in inches. The minimum dimension is always the thickness.",
      "format": "double"
    },
    "processingCategory": {
      "type": "string",
      "description": "To be eligible for mailing at the price for letters, a piece must be:\n   * Rectangular\n   * At least 3-1/2 inches high x 5 inches long x 0.007 inch thick.\n   * No more than 6-1/8 inches high x 11-1/2 inches long x 1/4 inch thick.\n  \nFor additional information on letters, please refer to the [Postal Explorer](https://pe.usps.com/businessmail101?ViewName=Letters).\n\nThe Postal Service uses the word \"flats\" to refer to large envelopes, newsletters, and magazines. The words large envelopes and flats are used interchangeably. Whatever you call them, flats must:\n\n   * Have one dimension that is greater than 6-1/8 inches high OR 11-½ inches long OR ¼ inch thick.\n   * Be no more than 12 inches high x 15 inches long x ¾ inch thick.\n  \n For additional information on flats, please refer to the [Postal Explorer](https://pe.usps.com/businessmail101?ViewName=Flats). \n\n * LETTERS\n * FLATS         ",
      "enum": [
        "LETTERS",
        "FLATS",
        "CARDS"
      ]
    },
    "mailingDate": {
      "$ref": "#/$defs/MailingDate"
    },
    "nonMachinableIndicators": {
      "type": "object",
      "properties": {
        "isPolybagged": {
          "type": "boolean",
          "description": "Is the letter/flat polybagged, polywrapped, enclosed in any plastic material, or has an exterior surface made of a material that is not paper. Windows in envelopes made of paper do not make mailpieces nonmachinable. Attachments allowable under applicable eligibility standards do not make mailpieces nonmachinable.",
          "default": false
        },
        "hasClosureDevices": {
          "type": "boolean",
          "description": "Does the letter/flat have clasps, strings, buttons, or similar closure devices.",
          "default": false
        },
        "hasLooseItems": {
          "type": "boolean",
          "description": "Does the letter/flat contain items such as pens, pencils, keys, or coins that cause the thickness of the mailpiece to be uneven; or loose keys or coins or similar objects not affixed to the contents within the mailpiece. Loose items may cause a letter to be nonmailable when mailed in paper envelopes; (see [DMM 601.3.3](https://pe.usps.com/text/dmm300/601.htm#ep1196660)).",
          "default": false
        },
        "isRigid": {
          "type": "boolean",
          "description": "Is the letter/flat too rigid (does not bend easily when subjected to a transport belt tension of 40 pounds around an 11-inch diameter turn).",
          "default": false
        },
        "isSelfMailer": {
          "type": "boolean",
          "description": "Is the letter/flat a self-mailer that is not prepared according to [DMM 201.3.14](https://pe.usps.com/text/dmm300/201.htm#ep1079302).",
          "default": false
        },
        "isBooklet": {
          "type": "boolean",
          "description": "Is the letter/flat a booklet that is not prepared according to [DMM 201.3.16](https://pe.usps.com/text/dmm300/201.htm#ep1092751).",
          "default": false
        }
      },
      "additionalProperties": false,
      "description": "Set of boolean indicators used to determine whether a letter qualifies as nonmachinable."
    },
    "extraServices": {
      "type": "array",
      "description": "Extra Service Code requested.\n* 940 - Registered Mail\n* 955 - Return Receipt\n",
      "items": {
        "type": "integer",
        "enum": [
          940,
          955
        ]
      }
    },
    "destinationCountryCode": {
      "$ref": "#/$defs/DestinationCountryCode"
    },
    "itemValue": {
      "type": "number",
      "description": "Declared value of the item for Registered Mail.\n\nMerchandise cannot be mailed with First-Class Mail International.  For product eligibility, please review [section 242 of the International Mail Manual](https://pe.usps.com/text/imm/immc2_018.htm).\n\nFor details on Registered Mail indemnity and availability, please review [section 333 of the International Mail Manual](https://pe.usps.com/text/imm/immc3_009.htm).\n",
      "format": "double",
      "minimum": 0
    }
  },
  "additionalProperties": false,
  "$defs": {
    "DestinationCountryCode": {
      "title": "Destination Country Code",
      "pattern": "^[A-Z]{2}$",
      "type": "string",
      "description": "The ISO 3166-1 alpha-2 code representing the shipping destination."
    },
    "MailingDate": {
      "type": "string",
      "description": "The date the package or letter/flat will be mailed. The mailing date may be today plus 0 to 7 days in advance.        ",
      "format": "date"
    },
    "WeightOunces": {
      "type": "number",
      "description": "The calculated weight for the package based on user input.  The greater of dimWeight and weight will be used to calculated the rate. Weight unit of measurement is in ounces.",
      "format": "double"
    }
  }
}