{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "carrier": {
      "type": "string",
      "enum": ["dhl", "dhl_express", "dpag", "ups", "dpd", "hermes", "gls", "iloxx", "tnt", "fedex", "go", "parcel_one", "cargo_international"],
      "description": "acronym of the carrier you want to use"
    },
    "service": {
      "type": "string",
      "enum": ["standard", "one_day" , "one_day_early", "cargo_international_express", "ups_express_1200", "dhl_europaket", "returns"],
      "default": "standard",
      "description": "The service that should be used for the shipment."
    },
    "to": {
      "$ref": "#/definitions/address",
      "description": "the receivers address"
    },
    "from": {
      "$ref": "#/definitions/address",
      "description": "the senders address"
    },
    "package": {
      "$ref": "#/definitions/package"
    }
  },
  "required": ["carrier", "service", "to", "package"],
  "additionalProperties": false,
  "definitions": {
    "address": {
      "type": "object",
      "properties": {
        "street": { "type": "string" },
        "street_no": { "type": "string" },
        "city": { "type": "string" },
        "zip_code": { "type": "string" },
        "country": {
          "type": "string",
          "description": "uppercase two-letter country code (ISO 3166-1 alpha-2), e.g. DE for Germany"
        }
      },
      "required": ["street", "street_no", "city", "zip_code", "country"],
      "additionalProperties": false
    },
    "package": {
      "type": "object",
      "properties": {
        "width":  { "type": "number" },
        "height": { "type": "number" },
        "length": { "type": "number" },
        "weight": { "type": "number" },
        "type": {
          "type": "string",
          "enum": ["books", "bulk", "letter", "parcel", "parcel_letter"],
          "description": "defines packages of being of a certain type - if no value is given, parcel will be used"
        }
      },
      "required": ["width", "height", "length", "weight"],
      "additionalProperties": false,
      "description": "defines package dimensions"
    }
  }
}

download