diff --git a/specification/paths/Returns-v1-shops-shop_id-reasons-return_reason_id.json b/specification/paths/Returns-v1-shops-shop_id-reasons-return_reason_id.json index a1480af1..a62e69c7 100644 --- a/specification/paths/Returns-v1-shops-shop_id-reasons-return_reason_id.json +++ b/specification/paths/Returns-v1-shops-shop_id-reasons-return_reason_id.json @@ -73,27 +73,13 @@ "is_required": true }, { - "code": "unexpected-quality", - "is_required": false + "code": "still-sealed", + "is_required": false, + "no_note": "This product cannot be returned after it was unsealed. Proceeding will lead to a rejected return request." } ], "items": { - "type": "object", - "additionalProperties": false, - "required": [ - "code", - "is_required" - ], - "properties": { - "code": { - "type": "string", - "description": "The code of the shop return reason" - }, - "is_required": { - "type": "boolean", - "description": "Indication whether a consumer is required to answer this question related to the selected return reason" - } - } + "$ref": "#/components/schemas/ShopReturnReasonQuestion" } } } diff --git a/specification/schemas.json b/specification/schemas.json index d8d83349..80c981d5 100644 --- a/specification/schemas.json +++ b/specification/schemas.json @@ -566,6 +566,9 @@ "ShopReturnReason": { "$ref": "./schemas/return-reasons/ShopReturnReason.json" }, + "ShopReturnReasonQuestion": { + "$ref": "./schemas/return-reasons/ShopReturnReasonQuestion.json" + }, "ShopReturnReasonResponse": { "$ref": "./schemas/return-reasons/ShopReturnReasonResponse.json" }, @@ -575,6 +578,9 @@ "ReturnQuestion": { "$ref": "./schemas/return-questions/ReturnQuestion.json" }, + "ReturnQuestionAnswerType": { + "$ref": "./schemas/return-questions/ReturnQuestionAnswerType.json" + }, "ReturnQuestionResource": { "$ref": "./schemas/return-questions/ReturnQuestionResource.json" }, diff --git a/specification/schemas/return-questions/CreateReturnQuestionRequest.json b/specification/schemas/return-questions/CreateReturnQuestionRequest.json index 0e0be53b..5c1629bc 100644 --- a/specification/schemas/return-questions/CreateReturnQuestionRequest.json +++ b/specification/schemas/return-questions/CreateReturnQuestionRequest.json @@ -25,6 +25,9 @@ } } ] + }, + "answer_type": { + "$ref": "#/components/schemas/ReturnQuestionAnswerType" } } } diff --git a/specification/schemas/return-questions/PatchReturnQuestionRequest.json b/specification/schemas/return-questions/PatchReturnQuestionRequest.json index 61d81874..2ed7025b 100644 --- a/specification/schemas/return-questions/PatchReturnQuestionRequest.json +++ b/specification/schemas/return-questions/PatchReturnQuestionRequest.json @@ -20,6 +20,9 @@ } } ] + }, + "answer_type": { + "$ref": "#/components/schemas/ReturnQuestionAnswerType" } } } diff --git a/specification/schemas/return-questions/ReturnQuestion.json b/specification/schemas/return-questions/ReturnQuestion.json index d576eae7..f6f93c8a 100644 --- a/specification/schemas/return-questions/ReturnQuestion.json +++ b/specification/schemas/return-questions/ReturnQuestion.json @@ -36,6 +36,9 @@ } ], "description": "The value of the ``Accept-Language`` header determines the language in which the description is returned. If the ``Accept-Language`` header is missing, we default to ``en-GB``. If the User has the ``return_questions.manage`` scope and the ``Accept-Language`` header is set to ``*``, all descriptions will be returned in a key/value object." + }, + "answer_type": { + "$ref": "#/components/schemas/ReturnQuestionAnswerType" } } } diff --git a/specification/schemas/return-questions/ReturnQuestionAnswerType.json b/specification/schemas/return-questions/ReturnQuestionAnswerType.json new file mode 100644 index 00000000..0f5b044e --- /dev/null +++ b/specification/schemas/return-questions/ReturnQuestionAnswerType.json @@ -0,0 +1,9 @@ +{ + "type": "string", + "enum": [ + "string", + "boolean" + ], + "example": "string", + "description": "The type of answer expected for this question." +} diff --git a/specification/schemas/return-reasons/ShopReturnReason.json b/specification/schemas/return-reasons/ShopReturnReason.json index 6cae4170..e3bb7d8b 100644 --- a/specification/schemas/return-reasons/ShopReturnReason.json +++ b/specification/schemas/return-reasons/ShopReturnReason.json @@ -56,6 +56,9 @@ "description": { "type": "string" }, + "answer_type": { + "$ref": "#/components/schemas/ReturnQuestionAnswerType" + }, "is_required": { "type": "boolean" } diff --git a/specification/schemas/return-reasons/ShopReturnReasonQuestion.json b/specification/schemas/return-reasons/ShopReturnReasonQuestion.json new file mode 100644 index 00000000..2d42292e --- /dev/null +++ b/specification/schemas/return-reasons/ShopReturnReasonQuestion.json @@ -0,0 +1,35 @@ +{ + "type": "object", + "additionalProperties": false, + "required": [ + "code", + "is_required" + ], + "properties": { + "code": { + "type": "string", + "description": "The code of the shop return question", + "example": "what-size" + }, + "is_required": { + "type": "boolean", + "description": "Indication whether a consumer is required to answer this question related to the selected return reason", + "example": true + }, + "answer_type": { + "$ref": "#/components/schemas/ShopReturnReasonQuestionAnswerType" + }, + "yes_note": { + "type": "string", + "maxLength": 255, + "description": "A note to show the user when they answer a `boolean` type question with `true`. Will be shown in the return portal.", + "example": "This product can't be returned after its been used. Proceeding will lead to a rejected return request." + }, + "no_note": { + "type": "string", + "maxLength": 255, + "description": "A note to show the user when they answer a `boolean` type question with `false`. Will be shown in the return portal.", + "example": "This product cannot be returned after it was unsealed. Proceeding will lead to a rejected return request." + } + } +}