{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/australia-post/main/json-schema/australia-post-landed-cost-v3-request-schema.json",
  "title": "LandedCostV3Request",
  "description": "Landed cost calculation request for the V3 API",
  "x-generated": "2026-10-21",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/australia-post-international-export-tools-v3-openapi.yml#/components/schemas/LandedCostV3Request",
  "required": [
    "destination",
    "items",
    "shipping"
  ],
  "properties": {
    "destination": {
      "$ref": "#/$defs/LandedCostV3Destination"
    },
    "items": {
      "minItems": 1,
      "description": "Items included in the shipment",
      "items": {
        "$ref": "#/$defs/LandedCostV3Item"
      }
    },
    "shipping": {
      "$ref": "#/$defs/LandedCostV3Shipping"
    }
  },
  "$defs": {
    "IsoCountryCode": {
      "maxLength": 2,
      "minLength": 2,
      "pattern": "^[A-Za-z]{2}$",
      "description": "Two-character ISO 3166-1 alpha-2 country code"
    },
    "LandedCostV3Destination": {
      "required": [
        "country_code"
      ],
      "properties": {
        "country_code": {
          "$ref": "#/$defs/IsoCountryCode"
        },
        "postal_code": {
          "description": "Destination postal code. Optional for all countries, including CA."
        },
        "administrative_area_code": {
          "description": "Destination administrative area code. May be null if the country does not have an administrative area. For CA, administrative_area_code is required."
        }
      },
      "description": "Destination of the shipment"
    },
    "LandedCostV3Item": {
      "required": [
        "amount",
        "country_of_origin",
        "hs_code",
        "product_id",
        "quantity"
      ],
      "properties": {
        "product_id": {
          "description": "Unique identifier for the item within the request. Must be unique across all items in the request. Duplicate product_id values will result in HTTP 400."
        },
        "hs_code": {
          "maxLength": 14,
          "minLength": 6,
          "pattern": "^[A-Za-z0-9]{6,14}$",
          "description": "HS Tariff code of the item. Must be between 6 and 14 alphanumeric characters."
        },
        "quantity": {
          "pattern": "^[0-9]+$",
          "description": "Quantity of the item. Must be a positive integer."
        },
        "amount": {
          "pattern": "^[0-9]+(\\.[0-9]+)?$",
          "description": "Value of one item in AUD."
        },
        "country_of_origin": {
          "$ref": "#/$defs/IsoCountryCode"
        }
      },
      "description": "Details of a single item in the shipment"
    },
    "LandedCostV3Shipping": {
      "required": [
        "product_classification"
      ],
      "properties": {
        "service_level_code": {
          "description": "Service level code. Optional — defaults to australia_post.international_standard when not provided.",
          "enum": [
            "australia_post.international_standard",
            "australia_post.international_express",
            "australia_post.international_prepaid"
          ]
        },
        "amount": {
          "pattern": "^[0-9]+(\\.[0-9]+)?$",
          "description": "Shipping amount in AUD. Mandatory unless service_level_code is australia_post.international_prepaid."
        },
        "product_classification": {
          "description": "Classification of the items in the shipment.",
          "enum": [
            "DOCUMENT",
            "GIFT",
            "RETURN",
            "SALE_OF_GOODS",
            "SAMPLE",
            "OTHER"
          ]
        }
      },
      "description": "Shipping information for the landed cost request"
    }
  }
}