From 254a6716922d3d34ae73a89faa3ccd59b14ee40b Mon Sep 17 00:00:00 2001 From: Nick de Vries Date: Mon, 9 Feb 2026 11:22:57 +0100 Subject: [PATCH 1/8] :construction: Adding answer_type on return questions. --- ...s-v1-shops-shop_id-reasons-return_reason_id.json | 13 +++++++++++-- .../CreateReturnQuestionRequest.json | 9 +++++++++ .../schemas/return-questions/ReturnQuestion.json | 9 +++++++++ .../schemas/return-reasons/ShopReturnReason.json | 7 +++++++ 4 files changed, 36 insertions(+), 2 deletions(-) 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..d4c80c60 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,8 +73,9 @@ "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": { @@ -92,6 +93,14 @@ "is_required": { "type": "boolean", "description": "Indication whether a consumer is required to answer this question related to the selected return reason" + }, + "no_note": { + "type": "string", + "description": "A note to show the user when they answer this `boolean` type question with `false`. Will be shown in the return portal." + }, + "yes_note": { + "type": "string", + "description": "A note to show the user when they answer this `boolean` type question with `true`. Will be shown in the return portal." } } } diff --git a/specification/schemas/return-questions/CreateReturnQuestionRequest.json b/specification/schemas/return-questions/CreateReturnQuestionRequest.json index 0e0be53b..53c84351 100644 --- a/specification/schemas/return-questions/CreateReturnQuestionRequest.json +++ b/specification/schemas/return-questions/CreateReturnQuestionRequest.json @@ -25,6 +25,15 @@ } } ] + }, + "answer_type": { + "type": "string", + "enum": [ + "string", + "boolean" + ], + "example": "string", + "description": "The type of answer expected for this question." } } } diff --git a/specification/schemas/return-questions/ReturnQuestion.json b/specification/schemas/return-questions/ReturnQuestion.json index d576eae7..dde8c813 100644 --- a/specification/schemas/return-questions/ReturnQuestion.json +++ b/specification/schemas/return-questions/ReturnQuestion.json @@ -36,6 +36,15 @@ } ], "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": { + "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..f4a3d163 100644 --- a/specification/schemas/return-reasons/ShopReturnReason.json +++ b/specification/schemas/return-reasons/ShopReturnReason.json @@ -56,6 +56,13 @@ "description": { "type": "string" }, + "answer_type": { + "type": "string", + "enum": [ + "string", + "boolean" + ] + }, "is_required": { "type": "boolean" } From 976d415fee2901356bb0590d8016c73447484840 Mon Sep 17 00:00:00 2001 From: Daniel Verner Date: Tue, 10 Feb 2026 10:45:22 +0100 Subject: [PATCH 2/8] Added answer_type to patch endpoint request --- .../return-questions/PatchReturnQuestionRequest.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/specification/schemas/return-questions/PatchReturnQuestionRequest.json b/specification/schemas/return-questions/PatchReturnQuestionRequest.json index 61d81874..0a58489e 100644 --- a/specification/schemas/return-questions/PatchReturnQuestionRequest.json +++ b/specification/schemas/return-questions/PatchReturnQuestionRequest.json @@ -20,6 +20,15 @@ } } ] + }, + "answer_type": { + "type": "string", + "enum": [ + "string", + "boolean" + ], + "example": "string", + "description": "The type of answer expected for this question." } } } From f2cdb7ff1e70e45baa1ee212c47c7db901bbbb79 Mon Sep 17 00:00:00 2001 From: Daniel Verner Date: Tue, 10 Feb 2026 11:11:11 +0100 Subject: [PATCH 3/8] Move questions attached to a return reason to its own schema --- ...hops-shop_id-reasons-return_reason_id.json | 25 +--------------- specification/schemas.json | 3 ++ .../ReturnReasonQuestionAttachment.json | 30 +++++++++++++++++++ 3 files changed, 34 insertions(+), 24 deletions(-) create mode 100644 specification/schemas/return-reasons/ReturnReasonQuestionAttachment.json 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 d4c80c60..272081d2 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 @@ -79,30 +79,7 @@ } ], "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" - }, - "no_note": { - "type": "string", - "description": "A note to show the user when they answer this `boolean` type question with `false`. Will be shown in the return portal." - }, - "yes_note": { - "type": "string", - "description": "A note to show the user when they answer this `boolean` type question with `true`. Will be shown in the return portal." - } - } + "$ref": "#/components/schemas/ReturnReasonQuestionAttachment" } } } diff --git a/specification/schemas.json b/specification/schemas.json index d8d83349..72ede0e6 100644 --- a/specification/schemas.json +++ b/specification/schemas.json @@ -563,6 +563,9 @@ "ReturnReasonRelationship": { "$ref": "./schemas/return-reasons/ReturnReasonRelationship.json" }, + "ReturnReasonQuestionAttachment": { + "$ref": "./schemas/return-reasons/ReturnReasonQuestionAttachment.json" + }, "ShopReturnReason": { "$ref": "./schemas/return-reasons/ShopReturnReason.json" }, diff --git a/specification/schemas/return-reasons/ReturnReasonQuestionAttachment.json b/specification/schemas/return-reasons/ReturnReasonQuestionAttachment.json new file mode 100644 index 00000000..8043ef67 --- /dev/null +++ b/specification/schemas/return-reasons/ReturnReasonQuestionAttachment.json @@ -0,0 +1,30 @@ +{ + "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 + }, + "no_note": { + "type": "string", + "description": "A note to show the user when they answer this `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." + }, + "yes_note": { + "type": "string", + "description": "A note to show the user when they answer this `boolean` type question with `true`. Will be shown in the return portal.", + "example": "Thank you for confirming." + } + } +} From 17bb7e5d0e4586453497d6284461ae16fb3ee263 Mon Sep 17 00:00:00 2001 From: Daniel Verner Date: Wed, 11 Feb 2026 15:41:21 +0100 Subject: [PATCH 4/8] Introduce ReturnQuestionAnswerType schema for reusability --- specification/schemas.json | 3 +++ .../return-questions/CreateReturnQuestionRequest.json | 8 +------- .../return-questions/PatchReturnQuestionRequest.json | 8 +------- .../schemas/return-questions/ReturnQuestion.json | 10 ++-------- .../return-questions/ReturnQuestionAnswerType.json | 9 +++++++++ .../schemas/return-reasons/ShopReturnReason.json | 6 +----- 6 files changed, 17 insertions(+), 27 deletions(-) create mode 100644 specification/schemas/return-questions/ReturnQuestionAnswerType.json diff --git a/specification/schemas.json b/specification/schemas.json index 72ede0e6..14186bd5 100644 --- a/specification/schemas.json +++ b/specification/schemas.json @@ -578,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 53c84351..5c1629bc 100644 --- a/specification/schemas/return-questions/CreateReturnQuestionRequest.json +++ b/specification/schemas/return-questions/CreateReturnQuestionRequest.json @@ -27,13 +27,7 @@ ] }, "answer_type": { - "type": "string", - "enum": [ - "string", - "boolean" - ], - "example": "string", - "description": "The type of answer expected for this question." + "$ref": "#/components/schemas/ReturnQuestionAnswerType" } } } diff --git a/specification/schemas/return-questions/PatchReturnQuestionRequest.json b/specification/schemas/return-questions/PatchReturnQuestionRequest.json index 0a58489e..2ed7025b 100644 --- a/specification/schemas/return-questions/PatchReturnQuestionRequest.json +++ b/specification/schemas/return-questions/PatchReturnQuestionRequest.json @@ -22,13 +22,7 @@ ] }, "answer_type": { - "type": "string", - "enum": [ - "string", - "boolean" - ], - "example": "string", - "description": "The type of answer expected for this question." + "$ref": "#/components/schemas/ReturnQuestionAnswerType" } } } diff --git a/specification/schemas/return-questions/ReturnQuestion.json b/specification/schemas/return-questions/ReturnQuestion.json index dde8c813..f6f93c8a 100644 --- a/specification/schemas/return-questions/ReturnQuestion.json +++ b/specification/schemas/return-questions/ReturnQuestion.json @@ -37,14 +37,8 @@ ], "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": { - "type": "string", - "enum": [ - "string", - "boolean" - ], - "example": "string", - "description": "The type of answer expected for this question." + "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 f4a3d163..e3bb7d8b 100644 --- a/specification/schemas/return-reasons/ShopReturnReason.json +++ b/specification/schemas/return-reasons/ShopReturnReason.json @@ -57,11 +57,7 @@ "type": "string" }, "answer_type": { - "type": "string", - "enum": [ - "string", - "boolean" - ] + "$ref": "#/components/schemas/ReturnQuestionAnswerType" }, "is_required": { "type": "boolean" From 5639f31859de6308a5c0a78c6c0d7d3ae30c641c Mon Sep 17 00:00:00 2001 From: Daniel Verner Date: Wed, 11 Feb 2026 15:44:44 +0100 Subject: [PATCH 5/8] Rename ReturnReasonQuestionAttachment to ShopReturnReasonQuestion --- .../Returns-v1-shops-shop_id-reasons-return_reason_id.json | 2 +- specification/schemas.json | 6 +++--- ...uestionAttachment.json => ShopReturnReasonQuestion.json} | 0 3 files changed, 4 insertions(+), 4 deletions(-) rename specification/schemas/return-reasons/{ReturnReasonQuestionAttachment.json => ShopReturnReasonQuestion.json} (100%) 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 272081d2..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 @@ -79,7 +79,7 @@ } ], "items": { - "$ref": "#/components/schemas/ReturnReasonQuestionAttachment" + "$ref": "#/components/schemas/ShopReturnReasonQuestion" } } } diff --git a/specification/schemas.json b/specification/schemas.json index 14186bd5..80c981d5 100644 --- a/specification/schemas.json +++ b/specification/schemas.json @@ -563,12 +563,12 @@ "ReturnReasonRelationship": { "$ref": "./schemas/return-reasons/ReturnReasonRelationship.json" }, - "ReturnReasonQuestionAttachment": { - "$ref": "./schemas/return-reasons/ReturnReasonQuestionAttachment.json" - }, "ShopReturnReason": { "$ref": "./schemas/return-reasons/ShopReturnReason.json" }, + "ShopReturnReasonQuestion": { + "$ref": "./schemas/return-reasons/ShopReturnReasonQuestion.json" + }, "ShopReturnReasonResponse": { "$ref": "./schemas/return-reasons/ShopReturnReasonResponse.json" }, diff --git a/specification/schemas/return-reasons/ReturnReasonQuestionAttachment.json b/specification/schemas/return-reasons/ShopReturnReasonQuestion.json similarity index 100% rename from specification/schemas/return-reasons/ReturnReasonQuestionAttachment.json rename to specification/schemas/return-reasons/ShopReturnReasonQuestion.json From aa8b9b64e3828535cee6a4ff5f07149f62d8cdb9 Mon Sep 17 00:00:00 2001 From: Daniel Verner Date: Wed, 11 Feb 2026 15:46:27 +0100 Subject: [PATCH 6/8] add maxLength 255 to notes --- .../schemas/return-reasons/ShopReturnReasonQuestion.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/specification/schemas/return-reasons/ShopReturnReasonQuestion.json b/specification/schemas/return-reasons/ShopReturnReasonQuestion.json index 8043ef67..d1fe6cea 100644 --- a/specification/schemas/return-reasons/ShopReturnReasonQuestion.json +++ b/specification/schemas/return-reasons/ShopReturnReasonQuestion.json @@ -18,11 +18,13 @@ }, "no_note": { "type": "string", + "maxLength": 255, "description": "A note to show the user when they answer this `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." }, "yes_note": { "type": "string", + "maxLength": 255, "description": "A note to show the user when they answer this `boolean` type question with `true`. Will be shown in the return portal.", "example": "Thank you for confirming." } From b82adcbacee4e2a76e6e256c193ada29d3cc1bda Mon Sep 17 00:00:00 2001 From: Daniel Verner Date: Wed, 11 Feb 2026 15:50:22 +0100 Subject: [PATCH 7/8] add answer_type to ShopReturnReasonQuestion --- .../schemas/return-reasons/ShopReturnReasonQuestion.json | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/specification/schemas/return-reasons/ShopReturnReasonQuestion.json b/specification/schemas/return-reasons/ShopReturnReasonQuestion.json index d1fe6cea..5eeddc30 100644 --- a/specification/schemas/return-reasons/ShopReturnReasonQuestion.json +++ b/specification/schemas/return-reasons/ShopReturnReasonQuestion.json @@ -16,17 +16,20 @@ "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" + }, "no_note": { "type": "string", "maxLength": 255, - "description": "A note to show the user when they answer this `boolean` type question with `false`. Will be shown in the return portal.", + "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." }, "yes_note": { "type": "string", "maxLength": 255, - "description": "A note to show the user when they answer this `boolean` type question with `true`. Will be shown in the return portal.", - "example": "Thank you for confirming." + "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." } } } From b3a05f1628e48a5dd62bb03741430c9a4a2dcf87 Mon Sep 17 00:00:00 2001 From: Daniel Verner Date: Thu, 12 Feb 2026 09:18:30 +0100 Subject: [PATCH 8/8] reorder attrs --- .../return-reasons/ShopReturnReasonQuestion.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/specification/schemas/return-reasons/ShopReturnReasonQuestion.json b/specification/schemas/return-reasons/ShopReturnReasonQuestion.json index 5eeddc30..2d42292e 100644 --- a/specification/schemas/return-reasons/ShopReturnReasonQuestion.json +++ b/specification/schemas/return-reasons/ShopReturnReasonQuestion.json @@ -19,17 +19,17 @@ "answer_type": { "$ref": "#/components/schemas/ShopReturnReasonQuestionAnswerType" }, - "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." - }, "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." } } }