diff --git a/specification/paths.json b/specification/paths.json index 2480eff5..5405c22a 100644 --- a/specification/paths.json +++ b/specification/paths.json @@ -131,6 +131,9 @@ "/onboarding/v1/invitations/{invitation_id}/onboard": { "$ref": "./paths/Onboarding-v1-invitations-invitation_id-onboard.json" }, + "/orders/v1/orders/{reference}": { + "$ref": "./paths/Orders-v1-orders-reference.json" + }, "/organizations": { "$ref": "./paths/Organizations.json" }, diff --git a/specification/paths/Orders-v1-orders-reference.json b/specification/paths/Orders-v1-orders-reference.json new file mode 100644 index 00000000..147fb017 --- /dev/null +++ b/specification/paths/Orders-v1-orders-reference.json @@ -0,0 +1,80 @@ +{ + "parameters": [ + { + "name": "reference", + "in": "path", + "description": "Order reference to retrieve the order by.", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "shop_id", + "in": "query", + "required": true, + "description": "Id of the shop to retrieve the order for.", + "schema": { + "$ref": "#/components/schemas/Uuid" + } + }, + { + "name": "email", + "in": "query", + "description": "Email address of the receiver of the order. This query parameter is mutually exclusive with postal code query parameter. Either one is required.", + "schema": { + "$ref": "#/components/schemas/Email" + } + }, + { + "name": "postal_code", + "in": "query", + "description": "Postal code of the receiver of the order. This query parameter is mutually exclusive with email query parameter. Either one is required.", + "schema": { + "type": "string", + "example": "1111AA" + } + } + ], + "get": { + "tags": [ + "Orders" + ], + "security": [ + { + "OAuth2": [ + "returns.manage" + ] + } + ], + "summary": "Get an order resource by reference and email or postal code.", + "description": "This endpoint retrieves an order resource by the specified reference and either email address or postal code.", + "responses": { + "200": { + "description": "Retrieved the order.", + "content": { + "application/vnd.api+json": { + "schema": { + "type": "object", + "required": [ + "data" + ], + "additionalProperties": false, + "properties": { + "data": { + "$ref": "#/components/schemas/OrderResponse" + } + } + } + } + } + }, + "404": { + "description": "No order was found with the provided input." + }, + "409": { + "description": "One or more of the orders resource is handled by a 3rd party." + } + } + } +} diff --git a/specification/paths/Returns-v1-return-methods-resolve.json b/specification/paths/Returns-v1-return-methods-resolve.json index 4d3ad275..531f0e95 100644 --- a/specification/paths/Returns-v1-return-methods-resolve.json +++ b/specification/paths/Returns-v1-return-methods-resolve.json @@ -43,19 +43,39 @@ "example": "35eddf50-1d84-47a3-8479-6bfda729cd99" }, "consumer_address": { - "required": [ - "country_code", - "email" - ], - "properties": { - "country_code": { - "$ref": "#/components/schemas/CountryCode" + "oneOf": [ + { + "title": "Resolve order by email", + "required": [ + "country_code", + "email" + ], + "properties": { + "country_code": { + "$ref": "#/components/schemas/CountryCode" + }, + "email": { + "$ref": "#/components/schemas/Email" + } + } }, - "email": { - "$ref": "#/components/schemas/Email", - "example": "s.holmes@holmesinvestigations.com" + { + "title": "Resolve order by postal code", + "required": [ + "country_code", + "postal_code" + ], + "properties": { + "country_code": { + "$ref": "#/components/schemas/CountryCode" + }, + "postal_code": { + "type": "string", + "example": "1111AA" + } + } } - } + ] }, "weight": { "type": "integer", diff --git a/specification/paths/Returns-v1-shops-shop_id-orders-reference-email.json b/specification/paths/Returns-v1-shops-shop_id-orders-reference-email.json index dbd50655..3371ab99 100644 --- a/specification/paths/Returns-v1-shops-shop_id-orders-reference-email.json +++ b/specification/paths/Returns-v1-shops-shop_id-orders-reference-email.json @@ -33,6 +33,7 @@ ] } ], + "deprecated": true, "summary": "Get an order resource.", "description": "This endpoint retrieves an order resource by the specified reference and email address.", "responses": { diff --git a/specification/tags.json b/specification/tags.json index 12ded8c1..f9c26fd6 100644 --- a/specification/tags.json +++ b/specification/tags.json @@ -98,6 +98,9 @@ { "name": "Onboarding" }, + { + "name": "Orders" + }, { "name": "Organizations", "externalDocs": {