diff --git a/specification/paths.json b/specification/paths.json index 5899df5..42e5996 100644 --- a/specification/paths.json +++ b/specification/paths.json @@ -32,6 +32,9 @@ "/shipments/{shipment_id}": { "$ref": "./paths/Shipments-shipment_id.json" }, + "/shipments/{shipment_id}/options": { + "$ref": "./paths/Shipments-shipment_id-options.json" + }, "/shipments/{shipment_id}/statuses/{tracking_code}": { "$ref": "./paths/Shipments-shipment_id-Statuses-tracking_code.json" }, diff --git a/specification/paths/Shipments-shipment_id-options.json b/specification/paths/Shipments-shipment_id-options.json new file mode 100644 index 0000000..db63b8d --- /dev/null +++ b/specification/paths/Shipments-shipment_id-options.json @@ -0,0 +1,39 @@ +{ + "get": { + "tags": [ + "Shipments" + ], + "summary": "Get all the service options for a shipment.", + "description": "This endpoint retrieves service options for the supplied shipment.", + "parameters": [ + { + "$ref": "#/components/parameters/path-shipment_id" + } + ], + "responses": { + "200": { + "description": "Retrieved the statuses.", + "content": { + "application/vnd.api+json": { + "schema": { + "type": "object", + "required": [ + "data" + ], + "additionalProperties": false, + "properties": { + "data": { + "description": "List of service options", + "type": "array", + "items": { + "$ref": "#/components/schemas/ServiceOption" + } + } + } + } + } + } + } + } + } +} diff --git a/specification/schemas.json b/specification/schemas.json index b2a6df4..95298aa 100644 --- a/specification/schemas.json +++ b/specification/schemas.json @@ -86,6 +86,9 @@ "PriceAmount": { "$ref": "./schemas/PriceAmount.json" }, + "ServiceOption": { + "$ref": "./schemas/ServiceOption.json" + }, "ServiceRate": { "$ref": "./schemas/ServiceRate.json" }, diff --git a/specification/schemas/ServiceOption.json b/specification/schemas/ServiceOption.json new file mode 100644 index 0000000..3310549 --- /dev/null +++ b/specification/schemas/ServiceOption.json @@ -0,0 +1,22 @@ +{ + "type": "object", + "required": [ + "code" + ], + "properties": { + "code": { + "type": "string", + "example": "delivery-window:sunday" + }, + "name": { + "type": "string", + "example": "Sunday Delivery" + }, + "values": { + "type": "object", + "example": { + "pin": "1234" + } + } + } +} diff --git a/specification/schemas/Shipment.json b/specification/schemas/Shipment.json index 1a09971..155bb39 100644 --- a/specification/schemas/Shipment.json +++ b/specification/schemas/Shipment.json @@ -115,23 +115,7 @@ "options": { "type": "array", "items": { - "type": "object", - "properties": { - "code": { - "type": "string", - "example": "delivery-window:sunday" - }, - "name": { - "type": "string", - "example": "Sunday Delivery" - }, - "values": { - "type": "object", - "example": { - "pin": "1234" - } - } - } + "$ref": "#/components/schemas/ServiceOption" } }, "total_value": {