{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "carrier": {
      "type": "string",
      "enum": ["angel_de", "cargo_international", "dhl", "dhl_express", "dpag", "dpd", "gls", "go", "hermes", "iloxx", "parcel_one", "ups"],
      "description": "acronym of the carrier you want to use"
    },
    "service": {
      "type": "string",
      "enum": ["standard", "one_day", "one_day_early", "returns", "cargo_international_express", "dhl_europaket", "dhl_prio", "dhl_warenpost", "dpag_warenpost", "dpag_warenpost_signature", "dpag_warenpost_untracked", "gls_express_0800", "gls_express_0900", "gls_express_1000", "gls_express_1200", "ups_express_1200"],
      "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