{
  "$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"
    },
    "carrier_tracking_no": {
      "type": "string",
      "description": "the original tracking number that can be used on the carriers website"
    },
    "created_at": {
      "type": "date-time",
      "description": "timestamp the shipment was created"
    },
    "from": {
      "$ref": "#/definitions/address",
      "description": "If missing, the default sender address (if defined in your shipcloud account) will be used"
    },
    "id": {
      "type": "string",
      "description": "the shipment id that can be used for requesting info about a shipment or tracking it"
    },
    "label_url": {
      "type": "string",
      "description": "URL where you can download the label in pdf format"
    },
    "notification_email": {
      "type": "string",
      "description": "email address of the receiver who should be notified of a change of shipment status by shipcloud"
    },
    "packages": {
      "type": "array",
      "items": {
        "allOf": [
          {
            "$ref": "#/definitions/package"
          }
        ],
        "properties": {
          "id": {
            "type": "string",
            "description": "identifier for a single package"
          },
          "tracking_events": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "timestamp": {
                  "type": "date-time",
                  "description": "timestamp of when this event occured"
                },
                "location": {
                  "type": "string",
                  "description": "location of the package at this moment"
                },
                "status": {
                  "type": "string",
                  "enum": ["label_created", "picked_up", "delivered", "not_delivered", "transit", "exception", "out_for_delivery", "destroyed", "unknown", "canceled"],
                  "description": "key describing the status"
                },
                "details": {
                  "type": "string",
                  "description": "message the carrier sends to describe the package status"
                }
              },
              "required": ["timestamp", "location", "status", "details"],
              "additionalProperties": false
            }
          }
        },
        "required": ["id"],
        "additionalProperties": false
      }
    },
    "price": {
      "type": "number",
      "description": "price that we're going to charge you (exl. VAT)"
    },
    "reference_number": {
      "type": "string",
      "description": "a reference number (max. 30 characters) that you want this shipment to be identified with. You can use this afterwards to easier find the shipment in the shipcloud.io backoffice"
    },
    "service": {
      "type": "string",
      "description": "the service that was used for creating this shipment"
    },
    "shipper_notification_email": {
      "type": "string",
      "description": "email address of the shipper who should be notified of a change of shipment status by shipcloud"
    },
    "to": {
      "$ref": "#/definitions/address",
      "description": "the receivers address"
    },
    "tracking_url": {
      "type": "string",
      "description": "URL you can send your customers so they can track this shipment"
    }
  },
  "required": ["id", "carrier_tracking_no", "carrier", "created_at", "tracking_url", "label_url", "from", "to", "packages", "price", "reference_number", "service"],
  "additionalProperties": false,
  "definitions": {
    "address": {
      "type": "object",
      "properties": {
        "care_of": { "type": "string" },
        "city": { "type": "string" },
        "company": { "type": "string" },
        "country": { "type": "string", "description": "Country as uppercase ISO 3166-1 alpha-2 code" },
        "first_name": { "type": "string" },
        "last_name": { "type": "string" },
        "state": { "type": "string" },
        "street": { "type": "string" },
        "street_no": { "type": "string" },
        "zip_code": { "type": "string" },
        "phone": {
          "type": "string",
          "description": "telephone number (mandatory when using UPS and the following terms apply: service is one_day or one_day_early or ship to country is different than ship from country)"
        }
      },
      "required": ["last_name", "street", "street_no", "city", "zip_code", "country"],
      "additionalProperties": false
    },
    "package": {
      "type": "object",
      "properties": {
        "height": { "type": "number" },
        "length": { "type": "number" },
        "weight": { "type": "number" },
        "width":  { "type": "number" }
      },
      "required": ["width", "height", "length", "weight"],
      "additionalProperties": false,
      "description": "defines package dimensions"
    }
  }
}

download