{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "properties": {
        "carrier": {
            "type": "string",
            "enum": [
                "dhl",
                "ups",
                "dpd",
                "hermes",
                "gls"
            ],
            "description": "acronym of the carrier you want to use"
        },
        "to": {
            "$ref": "#/definitions/address",
            "description": "the receivers address"
        },
        "from": {
            "$ref": "#/definitions/address",
            "description": "If missing, the default sender address (if defined in your shipcloud account) will be used"
        },
        "package": {
            "$ref": "#/definitions/package"
        },
        "service": {
            "type": "string",
            "enum": [
                "standard",
                "returns",
                "one_day",
                "one_day_early"
            ],
            "default": "standard",
            "description": "additional service. With 'one_day' you get express delivery, 'one_day_early' is express delivery until 10am."
        },
        "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"
        },
        "create_shipping_label": {
            "type": "boolean",
            "description": "determines if a shipping label should be created at the carrier (this means you will be charged)"
        }
    },
    "required": [
        "carrier",
        "to",
        "package"
    ],
    "additionalProperties": false,
    "definitions": {
        "address": {
            "type": "object",
            "properties": {
                "company": {
                    "type": "string"
                },
                "first_name": {
                    "type": "string"
                },
                "last_name": {
                    "type": "string"
                },
                "street": {
                    "type": "string"
                },
                "street_no": {
                    "type": "string"
                },
                "city": {
                    "type": "string"
                },
                "zip_code": {
                    "type": "string"
                },
                "country": {
                    "type": "string"
                }
            },
            "required": [
                "first_name",
                "last_name",
                "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"
                }
            },
            "required": [
                "width",
                "height",
                "length",
                "weight"
            ],
            "additionalProperties": false,
            "description": "defines package dimensions"
        }
    }
}