{
    "type": "object",
    "properties": {
        "id": {
            "type": "string"
        },
        "service": {
            "type": "string"
        },
        "origin": {
            "type": "object",
            "properties": {
                "address": {
                    "type": "object",
                    "properties": {
                        "countryCode": {
                            "type": "string"
                        }
                    }
                }
            },
            "required": [
                "address"
            ]
        },
        "destination": {
            "type": "object",
            "properties": {
                "address": {
                    "type": "object",
                    "properties": {
                        "countryCode": {
                            "type": "string"
                        }
                    }
                }
            },
            "required": [
                "address"
            ]
        },
        "status": {
            "type": "object",
            "properties": {
                "timestamp": {
                    "type": "string"
                },
                "location": {
                    "type": "object",
                    "properties": {
                        "address": {
                            "type": "object",
                            "properties": {
                                "addressLocality": {
                                    "type": "string"
                                }
                            },
                            "required": [
                                "addressLocality"
                            ]
                        }
                    },
                    "required": [
                        "address"
                    ]
                },
                "statusCode": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "remark": {
                    "type": "string"
                },
                "statusDetailed": {
                    "type": "string"
                }
            },
            "required": [
                "timestamp",
                "statusCode",
                "status",
                "description"
            ]
        },
        "returnFlag": {
            "type": "boolean"
        },
        "details": {
            "type": "object",
            "properties": {
                "product": {
                    "type": "object",
                    "properties": {
                        "productName": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "productName"
                    ]
                },
                "proofOfDeliverySignedAvailable": {
                    "type": "boolean"
                },
                "totalNumberOfPieces": {
                    "type": "integer"
                },
                "pieceIds": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "weight": {
                    "type": "object",
                    "properties": {
                        "unitText": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "value"
                    ]
                }
            },
            "required": [
                "product",
                "proofOfDeliverySignedAvailable"
            ]
        },
        "events": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "timestamp": {
                        "type": "string"
                    },
                    "location": {
                        "type": "object",
                        "properties": {
                            "address": {
                                "type": "object",
                                "properties": {
                                    "addressLocality": {
                                        "type": "string"
                                    }
                                },
                                "required": [
                                    "addressLocality"
                                ]
                            }
                        },
                        "required": [
                            "address"
                        ]
                    },
                    "statusCode": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string"
                    },
                    "description": {
                        "type": "string"
                    },
                    "statusDetailed": {
                        "type": "string"
                    },
                    "remark": {
                        "type": "string"
                    }
                },
                "required": [
                    "timestamp",
                    "statusCode",
                    "status",
                    "description"
                ]
            }
        },
        "serviceUrl": {
            "type": "string"
        }
    },
    "required": [
        "id",
        "service",
        "origin",
        "destination",
        "status",
        "details"
    ],
    "version": 1
}
