{
  "type": "object",
  "properties": {
    "origin": {
      "type": "object",
      "properties": {
        "countryCode": {
          "type": "string",
          "pattern": "^[A-Z]{2}$",
          "enum": [
            "NO",
            "SE",
            "DK",
            "SJ"
          ],
          "description": "ISO 3166-1 alpha-2 country code"
        },
        "postalCode": {
          "type": "string"
        },
        "address1": {
          "type": "string"
        },
        "address2": {
          "type": "string"
        }
      },
      "required": [
        "countryCode",
        "postalCode"
      ],
      "additionalProperties": false
    },
    "destination": {
      "type": "object",
      "properties": {
        "countryCode": {
          "type": "string",
          "pattern": "^[A-Z]{2}$",
          "enum": [
            "NO",
            "SE",
            "DK",
            "SJ",
            "FI"
          ],
          "description": "ISO 3166-1 alpha-2 country code"
        },
        "postalCode": {
          "type": "string"
        },
        "address1": {
          "type": "string"
        },
        "address2": {
          "type": "string"
        }
      },
      "required": [
        "countryCode",
        "postalCode"
      ],
      "additionalProperties": false
    },
    "cart": {
      "type": "object",
      "description": "The shopping cart the shipment is for",
      "properties": {
        "currency": {
          "type": "string",
          "pattern": "^[A-Za-z]{3}$",
          "description": "ISO 4217 currency code used for cart values and returned prices. The tool does not convert currencies."
        },
        "totalCost": {
          "type": "number",
          "minimum": 0,
          "description": "Total cart value in cart.currency - required, used for discounted/tiered rates"
        },
        "items": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "properties": {
              "quantity": {
                "type": "integer",
                "minimum": 1
              },
              "weightInGrams": {
                "type": "integer",
                "minimum": 1,
                "description": "Required - affects which services/rate types are available and their weight limits"
              },
              "inStock": {
                "type": "boolean"
              },
              "tooBigForLocker": {
                "type": "boolean"
              },
              "requiresGroupageOrPallet": {
                "type": "boolean"
              }
            },
            "required": [
              "quantity",
              "weightInGrams"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "currency",
        "totalCost",
        "items"
      ],
      "additionalProperties": false
    },
    "selection": {
      "type": "object",
      "description": "Optional intent-driven recommendation on top of the real, unfiltered rates in the response",
      "properties": {
        "intent": {
          "type": "string",
          "enum": [
            "CHEAPEST",
            "FASTEST",
            "LOWEST_EMISSIONS",
            "MOST_PREDICTABLE"
          ],
          "description": "CHEAPEST, FASTEST, LOWEST_EMISSIONS (documented environmental labeling, not measured emissions), or MOST_PREDICTABLE delivery"
        },
        "constraints": {
          "type": "object",
          "description": "Hard requirements that always win over intent - a cheaper option that violates a constraint is never recommended",
          "properties": {
            "maxPrice": {
              "type": "number",
              "exclusiveMinimum": 0
            },
            "latestDeliveryDate": {
              "type": "string",
              "format": "date",
              "description": "ISO-8601 date (YYYY-MM-DD)"
            },
            "allowedDeliveryTypes": {
              "type": "array",
              "minItems": 1,
              "items": {
                "type": "string",
                "enum": [
                  "PICKUP_POINT",
                  "PARCEL_LOCKER",
                  "DOOR",
                  "MAILBOX",
                  "MAILBOX_ABROAD",
                  "PARCEL_TO_BUSINESS",
                  "GROUPAGE",
                  "PALLET"
                ]
              }
            },
            "requireFossilFree": {
              "type": "boolean"
            }
          },
          "additionalProperties": false
        }
      },
      "required": [
        "intent"
      ],
      "additionalProperties": false
    },
    "locale": {
      "type": "string",
      "enum": [
        "en",
        "nb-NO",
        "sv-SE",
        "da-DK"
      ],
      "description": "Language used for service descriptions and pickup point opening hours. Supported values are en, nb-NO, sv-SE, and da-DK. Defaults to en. Recommendation explanations are always in English, while codes remain stable regardless of language."
    }
  },
  "required": [
    "origin",
    "destination",
    "cart"
  ],
  "additionalProperties": false
}
