diff --git a/specification/paths/RegisteredShipments.json b/specification/paths/RegisteredShipments.json index 4bd14198..31a231cd 100644 --- a/specification/paths/RegisteredShipments.json +++ b/specification/paths/RegisteredShipments.json @@ -80,6 +80,12 @@ "address" ] }, + "drop_off_location": { + "required": [ + "code", + "address" + ] + }, "tracking_code": { "readOnly": true }, diff --git a/specification/paths/Shipments.json b/specification/paths/Shipments.json index 2bc7a877..ea2adba5 100644 --- a/specification/paths/Shipments.json +++ b/specification/paths/Shipments.json @@ -237,6 +237,12 @@ "address" ] }, + "drop_off_location": { + "required": [ + "code", + "address" + ] + }, "tracking_code": { "readOnly": true }, diff --git a/specification/schemas.json b/specification/schemas.json index 80c981d5..7c45ff17 100644 --- a/specification/schemas.json +++ b/specification/schemas.json @@ -170,6 +170,12 @@ "DocumentType": { "$ref": "./schemas/files/DocumentType.json" }, + "PickupLocation": { + "$ref": "./schemas/shipments/PickupLocation.json" + }, + "DropOffLocation": { + "$ref": "./schemas/shipments/DropOffLocation.json" + }, "DemoOrder": { "$ref": "./schemas/return-orders/DemoOrder.json" }, diff --git a/specification/schemas/shipments/DropOffLocation.json b/specification/schemas/shipments/DropOffLocation.json new file mode 100644 index 00000000..3505f383 --- /dev/null +++ b/specification/schemas/shipments/DropOffLocation.json @@ -0,0 +1,15 @@ +{ + "type": "object", + "additionalProperties": false, + "properties": { + "code": { + "type": "string", + "example": "205604", + "description": "Code of the drop-off location, retrieved from the `pickup-dropoff-locations` endpoint." + }, + "address": { + "$ref": "#/components/schemas/BaseAddress" + } + }, + "description": "Required if the service handover method is `drop-off`." +} diff --git a/specification/schemas/shipments/PickupLocation.json b/specification/schemas/shipments/PickupLocation.json new file mode 100644 index 00000000..743c2e6e --- /dev/null +++ b/specification/schemas/shipments/PickupLocation.json @@ -0,0 +1,14 @@ +{ + "type": "object", + "additionalProperties": false, + "properties": { + "code": { + "type": "string", + "example": "205604" + }, + "address": { + "$ref": "#/components/schemas/BaseAddress" + } + }, + "description": "Required if the service delivery method is `pick-up`." +} diff --git a/specification/schemas/shipments/Shipment.json b/specification/schemas/shipments/Shipment.json index 7f28b894..65404c05 100644 --- a/specification/schemas/shipments/Shipment.json +++ b/specification/schemas/shipments/Shipment.json @@ -52,18 +52,17 @@ "pickup_location": { "oneOf": [ { - "type": "object", - "additionalProperties": false, - "properties": { - "code": { - "type": "string", - "example": "205604" - }, - "address": { - "$ref": "#/components/schemas/BaseAddress" - } - }, - "description": "Required if the service delivery method is `pick-up`." + "$ref": "#/components/schemas/PickupLocation" + }, + { + "type": "null" + } + ] + }, + "drop_off_location": { + "oneOf": [ + { + "$ref": "#/components/schemas/DropOffLocation" }, { "type": "null" diff --git a/specification/schemas/shipments/ShipmentResponse.json b/specification/schemas/shipments/ShipmentResponse.json index a0c5e4b9..7db2de99 100644 --- a/specification/schemas/shipments/ShipmentResponse.json +++ b/specification/schemas/shipments/ShipmentResponse.json @@ -51,6 +51,12 @@ "address" ] }, + "drop_off_location": { + "required": [ + "code", + "address" + ] + }, "physical_properties": { "required": [ "weight"