From 99f4e6f465fa670ba32f369b287ed56fbce63fdc Mon Sep 17 00:00:00 2001 From: --list Date: Thu, 24 Jun 2021 16:32:28 +0200 Subject: [PATCH] reverted changes to doc files --- docs/api/admin-spec3.json | 1520 +++++++++--------- docs/api/admin-spec3.yaml | 3077 ++++++++++++++++--------------------- docs/api/store-spec3.json | 569 ++++--- docs/api/store-spec3.yaml | 1437 +++++++++-------- 4 files changed, 3011 insertions(+), 3592 deletions(-) diff --git a/docs/api/admin-spec3.json b/docs/api/admin-spec3.json index de03c84c1d..5da7fcc4b6 100644 --- a/docs/api/admin-spec3.json +++ b/docs/api/admin-spec3.json @@ -145,183 +145,6 @@ } } }, - "/customers": { - "post": { - "operationId": "PostCustomers", - "summary": "Create a Customer", - "description": "Creates a Customer.", - "parameters": [], - "tags": [ - "Customer" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "customer": { - "$ref": "#/components/schemas/customer" - } - } - } - } - } - } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "email", - "first_name", - "last_name" - ], - "properties": { - "email": { - "type": "string", - "description": "The Customer's email address." - }, - "first_name": { - "type": "string", - "description": "The Customer's first name." - }, - "last_name": { - "type": "string", - "description": "The Customer's last name." - }, - "phone": { - "type": "string", - "description": "The Customer's phone number." - } - } - } - } - } - } - }, - "get": { - "operationId": "GetCustomers", - "summary": "List Customers", - "description": "Retrieves a list of Customers.", - "tags": [ - "Customer" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "customer": { - "$ref": "#/components/schemas/customer" - } - } - } - } - } - } - } - } - }, - "/customers/{id}": { - "get": { - "operationId": "GetCustomersCustomer", - "summary": "Retrieve a Customer", - "description": "Retrieves a Customer.", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Customer.", - "schema": { - "type": "string" - } - } - ], - "tags": [ - "Customer" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "customer": { - "$ref": "#/components/schemas/customer" - } - } - } - } - } - } - } - }, - "post": { - "operationId": "PostCustomersCustomer", - "summary": "Update a Customer", - "description": "Updates a Customer.", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Customer.", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "first_name": { - "type": "string", - "description": "The Customer's first name." - }, - "last_name": { - "type": "string", - "description": "The Customer's last name." - }, - "phone": { - "description": "The Customer's phone number.", - "type": "object" - } - } - } - } - } - }, - "tags": [ - "Customer" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "customer": { - "$ref": "#/components/schemas/customer" - } - } - } - } - } - } - } - } - }, "/collections": { "post": { "operationId": "PostCollections", @@ -534,47 +357,14 @@ } } }, - "/gift-cards": { + "/customers": { "post": { - "operationId": "PostGiftCards", - "summary": "Create a Gift Card", - "description": "Creates a Gift Card that can redeemed by its unique code. The Gift Card is only valid within 1 region.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "value": { - "type": "integer", - "description": "The value (excluding VAT) that the Gift Card should represent." - }, - "is_disabled": { - "type": "boolean", - "description": "Whether the Gift Card is disabled on creation. You will have to enable it later to make it available to Customers." - }, - "ends_at": { - "type": "string", - "format": "date-time", - "description": "The time at which the Gift Card should no longer be available." - }, - "region_id": { - "description": "The id of the Region in which the Gift Card can be used.", - "type": "array", - "items": { - "type": "string" - } - }, - "metadata": { - "description": "An optional set of key-value pairs to hold additional information.", - "type": "object" - } - } - } - } - } - }, + "operationId": "PostCustomers", + "summary": "Create a Customer", + "description": "Creates a Customer.", + "parameters": [], "tags": [ - "Gift Card" + "Customer" ], "responses": { "200": { @@ -583,22 +373,54 @@ "application/json": { "schema": { "properties": { - "gift_card": { - "$ref": "#/components/schemas/gift_card" + "customer": { + "$ref": "#/components/schemas/customer" } } } } } } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "email", + "first_name", + "last_name" + ], + "properties": { + "email": { + "type": "string", + "description": "The Customer's email address." + }, + "first_name": { + "type": "string", + "description": "The Customer's first name." + }, + "last_name": { + "type": "string", + "description": "The Customer's last name." + }, + "phone": { + "type": "string", + "description": "The Customer's phone number." + } + } + } + } + } } }, "get": { - "operationId": "GetGiftCards", - "summary": "List Gift Cards", - "description": "Retrieves a list of Gift Cards.", + "operationId": "GetCustomers", + "summary": "List Customers", + "description": "Retrieves a list of Customers.", "tags": [ - "Gift Card" + "Customer" ], "responses": { "200": { @@ -607,11 +429,8 @@ "application/json": { "schema": { "properties": { - "gift_cards": { - "type": "array", - "items": { - "$ref": "#/components/schemas/gift_card" - } + "customer": { + "$ref": "#/components/schemas/customer" } } } @@ -621,67 +440,24 @@ } } }, - "/gift-cards/{id}": { - "delete": { - "operationId": "DeleteGiftCardsGiftCard", - "summary": "Delete a Gift Card", - "description": "Deletes a Gift Card", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Gift Card to delete.", - "schema": { - "type": "string" - } - } - ], - "tags": [ - "Gift Card" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "string", - "description": "The id of the deleted Gift Card" - }, - "object": { - "type": "string", - "description": "The type of the object that was deleted." - }, - "deleted": { - "type": "boolean" - } - } - } - } - } - } - } - }, + "/customers/{id}": { "get": { - "operationId": "GetGiftCardsGiftCard", - "summary": "Retrieve a Gift Card", - "description": "Retrieves a Gift Card.", + "operationId": "GetCustomersCustomer", + "summary": "Retrieve a Customer", + "description": "Retrieves a Customer.", "parameters": [ { "in": "path", "name": "id", "required": true, - "description": "The id of the Gift Card.", + "description": "The id of the Customer.", "schema": { "type": "string" } } ], "tags": [ - "Gift Card" + "Customer" ], "responses": { "200": { @@ -690,8 +466,8 @@ "application/json": { "schema": { "properties": { - "gift_card": { - "$ref": "#/components/schemas/gift_card" + "customer": { + "$ref": "#/components/schemas/customer" } } } @@ -701,15 +477,15 @@ } }, "post": { - "operationId": "PostGiftCardsGiftCard", - "summary": "Create a Gift Card", - "description": "Creates a Gift Card that can redeemed by its unique code. The Gift Card is only valid within 1 region.", + "operationId": "PostCustomersCustomer", + "summary": "Update a Customer", + "description": "Updates a Customer.", "parameters": [ { "in": "path", "name": "id", "required": true, - "description": "The id of the Gift Card.", + "description": "The id of the Customer.", "schema": { "type": "string" } @@ -720,28 +496,16 @@ "application/json": { "schema": { "properties": { - "balance": { - "type": "integer", - "description": "The value (excluding VAT) that the Gift Card should represent." - }, - "is_disabled": { - "type": "boolean", - "description": "Whether the Gift Card is disabled on creation. You will have to enable it later to make it available to Customers." - }, - "ends_at": { + "first_name": { "type": "string", - "format": "date-time", - "description": "The time at which the Gift Card should no longer be available." + "description": "The Customer's first name." }, - "region_id": { - "description": "The id of the Region in which the Gift Card can be used.", - "type": "array", - "items": { - "type": "string" - } + "last_name": { + "type": "string", + "description": "The Customer's last name." }, - "metadata": { - "description": "An optional set of key-value pairs to hold additional information.", + "phone": { + "description": "The Customer's phone number.", "type": "object" } } @@ -750,7 +514,7 @@ } }, "tags": [ - "Gift Card" + "Customer" ], "responses": { "200": { @@ -759,8 +523,8 @@ "application/json": { "schema": { "properties": { - "gift_card": { - "$ref": "#/components/schemas/gift_card" + "customer": { + "$ref": "#/components/schemas/customer" } } } @@ -953,10 +717,6 @@ "type": "string" } }, - "usage_limit": { - "type": "number", - "description": "Maximum times the discount can be used" - }, "metadata": { "description": "An optional set of key-value pairs to hold additional information.", "type": "object" @@ -1278,6 +1038,242 @@ } } }, + "/gift-cards": { + "post": { + "operationId": "PostGiftCards", + "summary": "Create a Gift Card", + "description": "Creates a Gift Card that can redeemed by its unique code. The Gift Card is only valid within 1 region.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "value": { + "type": "integer", + "description": "The value (excluding VAT) that the Gift Card should represent." + }, + "is_disabled": { + "type": "boolean", + "description": "Whether the Gift Card is disabled on creation. You will have to enable it later to make it available to Customers." + }, + "ends_at": { + "type": "string", + "format": "date-time", + "description": "The time at which the Gift Card should no longer be available." + }, + "region_id": { + "description": "The id of the Region in which the Gift Card can be used.", + "type": "array", + "items": { + "type": "string" + } + }, + "metadata": { + "description": "An optional set of key-value pairs to hold additional information.", + "type": "object" + } + } + } + } + } + }, + "tags": [ + "Gift Card" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "gift_card": { + "$ref": "#/components/schemas/gift_card" + } + } + } + } + } + } + } + }, + "get": { + "operationId": "GetGiftCards", + "summary": "List Gift Cards", + "description": "Retrieves a list of Gift Cards.", + "tags": [ + "Gift Card" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "gift_cards": { + "type": "array", + "items": { + "$ref": "#/components/schemas/gift_card" + } + } + } + } + } + } + } + } + } + }, + "/gift-cards/{id}": { + "delete": { + "operationId": "DeleteGiftCardsGiftCard", + "summary": "Delete a Gift Card", + "description": "Deletes a Gift Card", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Gift Card to delete.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Gift Card" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "id": { + "type": "string", + "description": "The id of the deleted Gift Card" + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted." + }, + "deleted": { + "type": "boolean" + } + } + } + } + } + } + } + }, + "get": { + "operationId": "GetGiftCardsGiftCard", + "summary": "Retrieve a Gift Card", + "description": "Retrieves a Gift Card.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Gift Card.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Gift Card" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "gift_card": { + "$ref": "#/components/schemas/gift_card" + } + } + } + } + } + } + } + }, + "post": { + "operationId": "PostGiftCardsGiftCard", + "summary": "Create a Gift Card", + "description": "Creates a Gift Card that can redeemed by its unique code. The Gift Card is only valid within 1 region.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Gift Card.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "balance": { + "type": "integer", + "description": "The value (excluding VAT) that the Gift Card should represent." + }, + "is_disabled": { + "type": "boolean", + "description": "Whether the Gift Card is disabled on creation. You will have to enable it later to make it available to Customers." + }, + "ends_at": { + "type": "string", + "format": "date-time", + "description": "The time at which the Gift Card should no longer be available." + }, + "region_id": { + "description": "The id of the Region in which the Gift Card can be used.", + "type": "array", + "items": { + "type": "string" + } + }, + "metadata": { + "description": "An optional set of key-value pairs to hold additional information.", + "type": "object" + } + } + } + } + } + }, + "tags": [ + "Gift Card" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "gift_card": { + "$ref": "#/components/schemas/gift_card" + } + } + } + } + } + } + } + } + }, "/notifications": { "get": { "operationId": "GetNotifications", @@ -1964,10 +1960,6 @@ } } } - }, - "no_notification": { - "description": "If set to true no notification will be send", - "type": "boolean" } } } @@ -2273,6 +2265,82 @@ } } }, + "/orders/{id}/returns/{return_id}/receive": { + "post": { + "operationId": "PostOrdersOrderReturnsReturnReceive", + "summary": "Receive a Return", + "description": "Registers a Return as received.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Order.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "return_id", + "required": true, + "description": "The id of the Return.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "items": { + "description": "The Line Items that have been received.", + "type": "array", + "items": { + "properties": { + "item_id": { + "description": "The id of the Line Item.", + "type": "string" + }, + "quantity": { + "description": "The quantity of the Line Item.", + "type": "integer" + } + } + } + }, + "refund": { + "description": "The amount to refund.", + "type": "integer" + } + } + } + } + } + }, + "tags": [ + "Order" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "order": { + "$ref": "#/components/schemas/order" + } + } + } + } + } + } + } + } + }, "/orders/{id}/swaps/{swap_id}/receive": { "post": { "operationId": "PostOrdersOrderSwapsSwapReceive", @@ -3858,183 +3926,6 @@ } } }, - "/return-reasons": { - "post": { - "operationId": "PostReturnReasons", - "summary": "Create a Return Reason", - "description": "Creates a Return Reason", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "label": { - "description": "The label to display to the Customer.", - "type": "string" - }, - "value": { - "description": "The value that the Return Reason will be identified by. Must be unique.", - "type": "string" - }, - "description": { - "description": "An optional description to for the Reason.", - "type": "string" - }, - "metadata": { - "description": "An optional set of key-value pairs with additional information.", - "type": "object" - } - } - } - } - } - }, - "tags": [ - "Return Reason" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "return_reason": { - "$ref": "#/components/schemas/return_reason" - } - } - } - } - } - } - } - }, - "get": { - "operationId": "GetReturnReasons", - "summary": "List Return Reasons", - "description": "Retrieves a list of Return Reasons.", - "tags": [ - "Return Reason" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "return_reasons": { - "type": "array", - "items": { - "$ref": "#/components/schemas/return_reason" - } - } - } - } - } - } - } - } - } - }, - "/return-reasons/{id}": { - "get": { - "operationId": "GetReturnReasonsReason", - "summary": "Retrieve a Return Reason", - "description": "Retrieves a Return Reason.", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Return Reason.", - "schema": { - "type": "string" - } - } - ], - "tags": [ - "Return Reason" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "return_reason": { - "$ref": "#/components/schemas/return_reason" - } - } - } - } - } - } - } - }, - "post": { - "operationId": "PostReturnReasonsReason", - "summary": "Update a Return Reason", - "description": "Updates a Return Reason", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Return Reason.", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "label": { - "description": "The label to display to the Customer.", - "type": "string" - }, - "value": { - "description": "The value that the Return Reason will be identified by. Must be unique.", - "type": "string" - }, - "description": { - "description": "An optional description to for the Reason.", - "type": "string" - }, - "metadata": { - "description": "An optional set of key-value pairs with additional information.", - "type": "object" - } - } - } - } - } - }, - "tags": [ - "Return Reason" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "return_reason": { - "$ref": "#/components/schemas/return_reason" - } - } - } - } - } - } - } - } - }, "/regions/{id}/countries": { "post": { "operationId": "PostRegionsRegionCountries", @@ -4674,6 +4565,183 @@ } } }, + "/return-reasons": { + "post": { + "operationId": "PostReturnReasons", + "summary": "Create a Return Reason", + "description": "Creates a Return Reason", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "label": { + "description": "The label to display to the Customer.", + "type": "string" + }, + "value": { + "description": "The value that the Return Reason will be identified by. Must be unique.", + "type": "string" + }, + "description": { + "description": "An optional description to for the Reason.", + "type": "string" + }, + "metadata": { + "description": "An optional set of key-value pairs with additional information.", + "type": "object" + } + } + } + } + } + }, + "tags": [ + "Return Reason" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "return_reason": { + "$ref": "#/components/schemas/return_reason" + } + } + } + } + } + } + } + }, + "get": { + "operationId": "GetReturnReasons", + "summary": "List Return Reasons", + "description": "Retrieves a list of Return Reasons.", + "tags": [ + "Return Reason" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "return_reasons": { + "type": "array", + "items": { + "$ref": "#/components/schemas/return_reason" + } + } + } + } + } + } + } + } + } + }, + "/return-reasons/{id}": { + "get": { + "operationId": "GetReturnReasonsReason", + "summary": "Retrieve a Return Reason", + "description": "Retrieves a Return Reason.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Return Reason.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Return Reason" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "return_reason": { + "$ref": "#/components/schemas/return_reason" + } + } + } + } + } + } + } + }, + "post": { + "operationId": "PostReturnReasonsReason", + "summary": "Update a Return Reason", + "description": "Updates a Return Reason", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Return Reason.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "label": { + "description": "The label to display to the Customer.", + "type": "string" + }, + "value": { + "description": "The value that the Return Reason will be identified by. Must be unique.", + "type": "string" + }, + "description": { + "description": "An optional description to for the Reason.", + "type": "string" + }, + "metadata": { + "description": "An optional set of key-value pairs with additional information.", + "type": "object" + } + } + } + } + } + }, + "tags": [ + "Return Reason" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "return_reason": { + "$ref": "#/components/schemas/return_reason" + } + } + } + } + } + } + } + } + }, "/returns": { "get": { "operationId": "GetReturns", @@ -4703,269 +4771,6 @@ } } }, - "/returns/{id}receive": { - "post": { - "operationId": "PostReturnsReturnReceive", - "summary": "Receive a Return", - "description": "Registers a Return as received. Updates statuses on Orders and Swaps accordingly.", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Return.", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "items": { - "description": "The Line Items that have been received.", - "type": "array", - "items": { - "properties": { - "item_id": { - "description": "The id of the Line Item.", - "type": "string" - }, - "quantity": { - "description": "The quantity of the Line Item.", - "type": "integer" - } - } - } - }, - "refund": { - "description": "The amount to refund.", - "type": "integer" - } - } - } - } - } - }, - "tags": [ - "Return" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "return": { - "$ref": "#/components/schemas/return" - } - } - } - } - } - } - } - } - }, - "/shipping-profiles": { - "post": { - "operationId": "PostShippingProfiles", - "summary": "Create a Shipping Profile", - "description": "Creates a Shipping Profile", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "name": { - "description": "The name of the Shipping Profile", - "type": "string" - } - } - } - } - } - }, - "tags": [ - "Shipping Profile" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "shipping_profile": { - "$ref": "#/components/schemas/shipping_profile" - } - } - } - } - } - } - } - }, - "get": { - "operationId": "GetShippingProfiles", - "summary": "List Shipping Profiles", - "description": "Retrieves a list of Shipping Profile.", - "tags": [ - "Shipping Profile" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "shipping_profiles": { - "type": "array", - "items": { - "$ref": "#/components/schemas/shipping_profile" - } - } - } - } - } - } - } - } - } - }, - "/shipping-profiles/{id}": { - "delete": { - "operationId": "DeleteShippingProfilesProfile", - "summary": "Delete a Shipping Profile", - "description": "Deletes a Shipping Profile.", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Shipping Profile.", - "schema": { - "type": "string" - } - } - ], - "tags": [ - "Shipping Profile" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "string", - "description": "The id of the deleted Shipping Profile." - }, - "object": { - "type": "string", - "description": "The type of the object that was deleted." - }, - "deleted": { - "type": "boolean" - } - } - } - } - } - } - } - }, - "get": { - "operationId": "GetShippingProfilesProfile", - "summary": "Retrieve a Shipping Profile", - "description": "Retrieves a Shipping Profile.", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Shipping Profile.", - "schema": { - "type": "string" - } - } - ], - "tags": [ - "Shipping Profile" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "shipping_profile": { - "$ref": "#/components/schemas/shipping_profile" - } - } - } - } - } - } - } - }, - "post": { - "operationId": "PostShippingProfilesProfile", - "summary": "Update a Shipping Profiles", - "description": "Updates a Shipping Profile", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Shipping Profile.", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "name": { - "description": "The name of the Shipping Profile", - "type": "string" - } - } - } - } - } - }, - "tags": [ - "Shipping Profile" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "shipping_profiles": { - "$ref": "#/components/schemas/shipping_profile" - } - } - } - } - } - } - } - } - }, "/shipping-options": { "post": { "operationId": "PostShippingOptions", @@ -5238,6 +5043,202 @@ } } }, + "/shipping-profiles": { + "post": { + "operationId": "PostShippingProfiles", + "summary": "Create a Shipping Profile", + "description": "Creates a Shipping Profile", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "name": { + "description": "The name of the Shipping Profile", + "type": "string" + } + } + } + } + } + }, + "tags": [ + "Shipping Profile" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "shipping_profile": { + "$ref": "#/components/schemas/shipping_profile" + } + } + } + } + } + } + } + }, + "get": { + "operationId": "GetShippingProfiles", + "summary": "List Shipping Profiles", + "description": "Retrieves a list of Shipping Profile.", + "tags": [ + "Shipping Profile" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "shipping_profiles": { + "type": "array", + "items": { + "$ref": "#/components/schemas/shipping_profile" + } + } + } + } + } + } + } + } + } + }, + "/shipping-profiles/{id}": { + "delete": { + "operationId": "DeleteShippingProfilesProfile", + "summary": "Delete a Shipping Profile", + "description": "Deletes a Shipping Profile.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Shipping Profile.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Shipping Profile" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "id": { + "type": "string", + "description": "The id of the deleted Shipping Profile." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted." + }, + "deleted": { + "type": "boolean" + } + } + } + } + } + } + } + }, + "get": { + "operationId": "GetShippingProfilesProfile", + "summary": "Retrieve a Shipping Profile", + "description": "Retrieves a Shipping Profile.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Shipping Profile.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Shipping Profile" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "shipping_profile": { + "$ref": "#/components/schemas/shipping_profile" + } + } + } + } + } + } + } + }, + "post": { + "operationId": "PostShippingProfilesProfile", + "summary": "Update a Shipping Profiles", + "description": "Updates a Shipping Profile", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Shipping Profile.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "name": { + "description": "The name of the Shipping Profile", + "type": "string" + } + } + } + } + } + }, + "tags": [ + "Shipping Profile" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "shipping_profiles": { + "$ref": "#/components/schemas/shipping_profile" + } + } + } + } + } + } + } + } + }, "/store/currencies/{code}": { "post": { "operationId": "PostStoreCurrenciesCode", @@ -6019,6 +6020,10 @@ "$ref": "#/components/schemas/product" } }, + "usage_limit": { + "description": "The maximum number of times that a discount can be used.", + "type": "integer" + }, "created_at": { "description": "The date with timezone at which the resource was created.", "type": "string", @@ -6090,14 +6095,6 @@ "$ref": "#/components/schemas/region" } }, - "usage_limit": { - "description": "The maximum number of times that a discount can be used.", - "type": "integer" - }, - "usage_count": { - "description": "The number of times a discount has been used.", - "type": "integer" - }, "created_at": { "description": "The date with timezone at which the resource was created.", "type": "string", @@ -6872,9 +6869,6 @@ }, "gift_card_total": { "type": "integer" - }, - "paid_total": { - "type": "integer" } } }, diff --git a/docs/api/admin-spec3.yaml b/docs/api/admin-spec3.yaml index f2e31cce28..048de24094 100644 --- a/docs/api/admin-spec3.yaml +++ b/docs/api/admin-spec3.yaml @@ -85,387 +85,6 @@ paths: properties: user: $ref: '#/components/schemas/user' - '/discounts/{id}/regions/{region_id}': - post: - operationId: PostDiscountsDiscountRegionsRegion - summary: Adds Region availability - description: Adds a Region to the list of Regions that a Discount can be used in. - parameters: - - in: path - name: id - required: true - description: The id of the Discount. - schema: - type: string - - in: path - name: region_id - required: true - description: The id of the Region. - schema: - type: string - tags: - - Discount - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - discount: - $ref: '#/components/schemas/discount' - delete: - operationId: DeleteDiscountsDiscountRegionsRegion - summary: Remove Region availability - description: >- - Removes a Region from the list of Regions that a Discount can be used - in. - parameters: - - in: path - name: id - required: true - description: The id of the Discount. - schema: - type: string - - in: path - name: region_id - required: true - description: The id of the Region. - schema: - type: string - tags: - - Discount - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - discount: - $ref: '#/components/schemas/discount' - '/discounts/{id}/products/{product_id}': - post: - operationId: DeleteDiscountsDiscountProductsProduct - summary: Remove Product availability - description: >- - Removes a Product from the list of Products that a Discount can be used - for. - parameters: - - in: path - name: id - required: true - description: The id of the Discount. - schema: - type: string - - in: path - name: product_id - required: true - description: The id of the Product. - schema: - type: string - tags: - - Discount - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - discount: - $ref: '#/components/schemas/discount' - /discounts: - post: - operationId: PostDiscounts - summary: Creates a Discount - description: >- - Creates a Discount with a given set of rules that define how the - Discount behaves. - requestBody: - content: - application/json: - schema: - properties: - code: - type: string - description: A unique code that will be used to redeem the Discount - is_dynamic: - type: string - description: >- - Whether the Discount should have multiple instances of - itself, each with a different code. This can be useful for - automatically generated codes that all have to follow a - common set of rules. - rule: - description: The Discount Rule that defines how Discounts are calculated - oneOf: - - $ref: '#/components/schemas/discount_rule' - is_disabled: - type: boolean - description: >- - Whether the Discount code is disabled on creation. You will - have to enable it later to make it available to Customers. - starts_at: - type: string - format: date-time - description: The time at which the Discount should be available. - ends_at: - type: string - format: date-time - description: >- - The time at which the Discount should no longer be - available. - regions: - description: >- - A list of Region ids representing the Regions in which the - Discount can be used. - type: array - items: - type: string - usage_limit: - type: number - description: Maximum times the discount can be used - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - tags: - - Discount - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - discount: - $ref: '#/components/schemas/discount' - get: - operationId: GetDiscounts - summary: List Discounts - description: Retrieves a list of Discounts - tags: - - Discount - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - discount: - $ref: '#/components/schemas/discount' - '/discounts/{id}/dynamic-codes': - post: - operationId: PostDiscountsDiscountDynamicCodes - summary: Create a dynamic Discount code - description: >- - Creates a unique code that can map to a parent Discount. This is useful - if you want to automatically generate codes with the same behaviour. - parameters: - - in: path - name: id - required: true - description: The id of the Discount to create the dynamic code from." - schema: - type: string - tags: - - Discount - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - discount: - $ref: '#/components/schemas/discount' - requestBody: - content: - application/json: - schema: - type: object - required: - - code - properties: - code: - type: string - description: The unique code that will be used to redeem the Discount. - metadata: - type: object - description: >- - An optional set of key-value paris to hold additional - information. - '/discounts/{id}': - delete: - operationId: DeleteDiscountsDiscount - summary: Delete a Discount - description: Deletes a Discount. - parameters: - - in: path - name: id - required: true - description: The id of the Discount - schema: - type: string - tags: - - Discount - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - id: - type: string - description: The id of the deleted Discount - object: - type: string - description: The type of the object that was deleted. - deleted: - type: boolean - get: - operationId: GetDiscountsDiscount - summary: Retrieve a Discount - description: Retrieves a Discount - parameters: - - in: path - name: id - required: true - description: The id of the Discount - schema: - type: string - tags: - - Discount - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - discount: - $ref: '#/components/schemas/discount' - post: - operationId: PostDiscountsDiscount - summary: Update a Discount - description: >- - Updates a Discount with a given set of rules that define how the - Discount behaves. - parameters: - - in: path - name: id - required: true - description: The id of the Discount. - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - code: - type: string - description: A unique code that will be used to redeem the Discount - is_dynamic: - type: string - description: >- - Whether the Discount should have multiple instances of - itself, each with a different code. This can be useful for - automatically generated codes that all have to follow a - common set of rules. - rule: - description: The Discount Rule that defines how Discounts are calculated - oneOf: - - $ref: '#/components/schemas/discount_rule' - is_disabled: - type: boolean - description: >- - Whether the Discount code is disabled on creation. You will - have to enable it later to make it available to Customers. - starts_at: - type: string - format: date-time - description: The time at which the Discount should be available. - ends_at: - type: string - format: date-time - description: >- - The time at which the Discount should no longer be - available. - regions: - description: >- - A list of Region ids representing the Regions in which the - Discount can be used. - type: array - items: - type: string - tags: - - Discount - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - discount: - $ref: '#/components/schemas/discount' - '/discounts/{id}/dynamic-codes/{code}': - delete: - operationId: DeleteDiscountsDiscountDynamicCodesCode - summary: Delete a dynamic code - description: Deletes a dynamic code from a Discount. - parameters: - - in: path - name: id - required: true - description: The id of the Discount - schema: - type: string - - in: path - name: code - required: true - description: The id of the Discount - schema: - type: string - tags: - - Discount - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - discount: - $ref: '#/components/schemas/discount' - '/discounts/code/{id}': - get: - operationId: GetDiscountsDiscountCode - summary: Retrieve a Discount by code - description: Retrieves a Discount by its discount code - parameters: - - in: path - name: code - required: true - description: The code of the Discount - schema: - type: string - tags: - - Discount - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - discount: - $ref: '#/components/schemas/discount' /collections: post: operationId: PostCollections @@ -721,174 +340,230 @@ paths: properties: customer: $ref: '#/components/schemas/customer' - /draft-orders: + '/discounts/{id}/regions/{region_id}': post: - operationId: PostDraftOrders - summary: Create a Draft Order - description: Creates a Draft Order - requestBody: - content: - application/json: - schema: - properties: - status: - description: The status of the draft order - type: string - email: - description: The email of the customer of the draft order - type: string - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: '#/components/schemas/address' - shipping_address: - description: The Address to be used for shipping. - anyOf: - - $ref: '#/components/schemas/address' - items: - description: The Line Items that have been received. - type: array - items: - properties: - variant_id: - description: >- - The id of the Product Variant to generate the Line - Item from. - type: string - unit_price: - description: The potential custom price of the item. - type: integer - title: - description: The potential custom title of the item. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - metadata: - description: >- - The optional key-value map with additional details - about the Line Item. - type: object - region_id: - description: The id of the region for the draft order - type: string - discounts: - description: The discounts to add on the draft order - type: array - items: - properties: - code: - description: The code of the discount to apply - type: string - customer_id: - description: The id of the customer to add on the draft order - type: string - no_notification_order: - description: >- - An optional flag passed to the resulting order to determine - use of notifications. - type: boolean - shipping_methods: - description: The shipping methods for the draft order - type: array - items: - properties: - option_id: - description: The id of the shipping option in use - type: string - data: - description: >- - The optional additional data needed for the shipping - method - type: object - price: - description: The potential custom price of the shipping - type: integer - metadata: - description: >- - The optional key-value map with additional details about the - Draft Order. - type: object - tags: - - Draft Order - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - draft_order: - $ref: '#/components/schemas/draft-order' - get: - operationId: GetDraftOrders - summary: List Draft Orders - description: Retrieves an list of Draft Orders - tags: - - Draft Order - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - draft_order: - $ref: '#/components/schemas/draft-order' - '/draft-orders/{id}/line-items': - post: - operationId: PostDraftOrdersDraftOrderLineItems - summary: Create a Line Item for Draft Order - description: Creates a Line Item for the Draft Order - requestBody: - content: - application/json: - schema: - properties: - variant_id: - description: >- - The id of the Product Variant to generate the Line Item - from. - type: string - unit_price: - description: The potential custom price of the item. - type: integer - title: - description: The potential custom title of the item. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - metadata: - description: >- - The optional key-value map with additional details about the - Line Item. - type: object - tags: - - Draft Order - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - draft_order: - $ref: '#/components/schemas/draft-order' - '/draft-orders/{id}': - delete: - operationId: DeleteDraftOrdersDraftOrder - summary: Delete a Draft Order - description: Deletes a Draft Order + operationId: PostDiscountsDiscountRegionsRegion + summary: Adds Region availability + description: Adds a Region to the list of Regions that a Discount can be used in. parameters: - in: path name: id required: true - description: The id of the Draft Order. + description: The id of the Discount. + schema: + type: string + - in: path + name: region_id + required: true + description: The id of the Region. schema: type: string tags: - - Draft Order + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + discount: + $ref: '#/components/schemas/discount' + delete: + operationId: DeleteDiscountsDiscountRegionsRegion + summary: Remove Region availability + description: >- + Removes a Region from the list of Regions that a Discount can be used + in. + parameters: + - in: path + name: id + required: true + description: The id of the Discount. + schema: + type: string + - in: path + name: region_id + required: true + description: The id of the Region. + schema: + type: string + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + discount: + $ref: '#/components/schemas/discount' + '/discounts/{id}/products/{product_id}': + post: + operationId: DeleteDiscountsDiscountProductsProduct + summary: Remove Product availability + description: >- + Removes a Product from the list of Products that a Discount can be used + for. + parameters: + - in: path + name: id + required: true + description: The id of the Discount. + schema: + type: string + - in: path + name: product_id + required: true + description: The id of the Product. + schema: + type: string + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + discount: + $ref: '#/components/schemas/discount' + /discounts: + post: + operationId: PostDiscounts + summary: Creates a Discount + description: >- + Creates a Discount with a given set of rules that define how the + Discount behaves. + requestBody: + content: + application/json: + schema: + properties: + code: + type: string + description: A unique code that will be used to redeem the Discount + is_dynamic: + type: string + description: >- + Whether the Discount should have multiple instances of + itself, each with a different code. This can be useful for + automatically generated codes that all have to follow a + common set of rules. + rule: + description: The Discount Rule that defines how Discounts are calculated + oneOf: + - $ref: '#/components/schemas/discount_rule' + is_disabled: + type: boolean + description: >- + Whether the Discount code is disabled on creation. You will + have to enable it later to make it available to Customers. + starts_at: + type: string + format: date-time + description: The time at which the Discount should be available. + ends_at: + type: string + format: date-time + description: >- + The time at which the Discount should no longer be + available. + regions: + description: >- + A list of Region ids representing the Regions in which the + Discount can be used. + type: array + items: + type: string + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + discount: + $ref: '#/components/schemas/discount' + get: + operationId: GetDiscounts + summary: List Discounts + description: Retrieves a list of Discounts + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + discount: + $ref: '#/components/schemas/discount' + '/discounts/{id}/dynamic-codes': + post: + operationId: PostDiscountsDiscountDynamicCodes + summary: Create a dynamic Discount code + description: >- + Creates a unique code that can map to a parent Discount. This is useful + if you want to automatically generate codes with the same behaviour. + parameters: + - in: path + name: id + required: true + description: The id of the Discount to create the dynamic code from." + schema: + type: string + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + discount: + $ref: '#/components/schemas/discount' + requestBody: + content: + application/json: + schema: + type: object + required: + - code + properties: + code: + type: string + description: The unique code that will be used to redeem the Discount. + metadata: + type: object + description: >- + An optional set of key-value paris to hold additional + information. + '/discounts/{id}': + delete: + operationId: DeleteDiscountsDiscount + summary: Delete a Discount + description: Deletes a Discount. + parameters: + - in: path + name: id + required: true + description: The id of the Discount + schema: + type: string + tags: + - Discount responses: '200': description: OK @@ -898,25 +573,25 @@ paths: properties: id: type: string - description: The id of the deleted Draft Order. + description: The id of the deleted Discount object: type: string description: The type of the object that was deleted. deleted: type: boolean get: - operationId: GetDraftOrdersDraftOrder - summary: Retrieve a Draft Order - description: Retrieves a Draft Order. + operationId: GetDiscountsDiscount + summary: Retrieve a Discount + description: Retrieves a Discount parameters: - in: path name: id required: true - description: The id of the Draft Order. + description: The id of the Discount schema: type: string tags: - - Draft Order + - Discount responses: '200': description: OK @@ -924,143 +599,64 @@ paths: application/json: schema: properties: - draft_order: - $ref: '#/components/schemas/draft-order' - '/draft-orders/{id}/line-items/{line_id}': - delete: - operationId: DeleteDraftOrdersDraftOrderLineItemsItem - summary: Delete a Line Item - description: Removes a Line Item from a Draft Order. - parameters: - - in: path - name: id - required: true - description: The id of the Draft Order. - schema: - type: string - - in: path - name: line_id - required: true - description: The id of the Draft Order. - schema: - type: string - tags: - - Draft Order - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - draft_order: - $ref: '#/components/schemas/draft-order' + discount: + $ref: '#/components/schemas/discount' post: - operationId: PostDraftOrdersDraftOrderLineItemsItem - summary: Update a Line Item for a Draft Order - description: Updates a Line Item for a Draft Order + operationId: PostDiscountsDiscount + summary: Update a Discount + description: >- + Updates a Discount with a given set of rules that define how the + Discount behaves. + parameters: + - in: path + name: id + required: true + description: The id of the Discount. + schema: + type: string requestBody: content: application/json: schema: properties: - unit_price: - description: The potential custom price of the item. - type: integer - title: - description: The potential custom title of the item. + code: + type: string + description: A unique code that will be used to redeem the Discount + is_dynamic: type: string - quantity: - description: The quantity of the Line Item. - type: integer - metadata: description: >- - The optional key-value map with additional details about the - Line Item. - type: object - tags: - - Draft Order - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - draft_order: - $ref: '#/components/schemas/draft-order' - '/draft-orders/{id}/register-payment': - post: - summary: Registers a payment for a Draft Order - operationId: PostDraftOrdersDraftOrderRegisterPayment - description: Registers a payment for a Draft Order. - parameters: - - in: path - name: id - required: true - description: The Draft Order id. - schema: - type: string - tags: - - Draft Order - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - draft_order: - $ref: '#/components/schemas/draft-order' - '/admin/draft-orders/{id}': - post: - operationId: PostDraftOrdersDraftOrder - summary: Update a Draft Order" - description: Updates a Draft Order. - parameters: - - in: path - name: id - required: true - description: The id of the Draft Order. - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - region_id: + Whether the Discount should have multiple instances of + itself, each with a different code. This can be useful for + automatically generated codes that all have to follow a + common set of rules. + rule: + description: The Discount Rule that defines how Discounts are calculated + oneOf: + - $ref: '#/components/schemas/discount_rule' + is_disabled: + type: boolean + description: >- + Whether the Discount code is disabled on creation. You will + have to enable it later to make it available to Customers. + starts_at: type: string - description: The id of the Region to create the Draft Order in. - email: + format: date-time + description: The time at which the Discount should be available. + ends_at: type: string - description: An email to be used on the Draft Order. - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: '#/components/schemas/address' - shipping_address: - description: The Address to be used for shipping. - anyOf: - - $ref: '#/components/schemas/address' - discounts: - description: An array of Discount codes to add to the Draft Order. + format: date-time + description: >- + The time at which the Discount should no longer be + available. + regions: + description: >- + A list of Region ids representing the Regions in which the + Discount can be used. type: array items: - properties: - code: - description: The code that a Discount is identifed by. - type: string - no_notification_order: - description: >- - An optional flag passed to the resulting order to determine - use of notifications. - type: boolean - customer_id: - description: The id of the Customer to associate the Draft Order with. - type: string + type: string tags: - - Draft Order + - Discount responses: '200': description: OK @@ -1068,8 +664,37 @@ paths: application/json: schema: properties: - draft_order: - $ref: '#/components/schemas/draft-order' + discount: + $ref: '#/components/schemas/discount' + '/discounts/{id}/dynamic-codes/{code}': + delete: + operationId: DeleteDiscountsDiscountDynamicCodesCode + summary: Delete a dynamic code + description: Deletes a dynamic code from a Discount. + parameters: + - in: path + name: id + required: true + description: The id of the Discount + schema: + type: string + - in: path + name: code + required: true + description: The id of the Discount + schema: + type: string + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + discount: + $ref: '#/components/schemas/discount' /gift-cards: post: operationId: PostGiftCards @@ -1285,6 +910,938 @@ paths: properties: notification: $ref: '#/components/schemas/notification' + '/orders/{id}/shipping-methods': + post: + operationId: PostOrdersOrderShippingMethods + summary: Add a Shipping Method + description: >- + Adds a Shipping Method to an Order. If another Shipping Method exists + with the same Shipping Profile, the previous Shipping Method will be + replaced. + parameters: + - in: path + name: id + required: true + description: The id of the Order. + schema: + type: string + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + order: + $ref: '#/components/schemas/order' + requestBody: + content: + application/json: + schema: + type: object + required: + - price + - option_id + - data + properties: + price: + type: integer + description: >- + The price (excluding VAT) that should be charged for the + Shipping Method + option_id: + type: string + description: >- + The id of the Shipping Option to create the Shipping Method + from. + data: + type: object + description: >- + The data required for the Shipping Option to create a + Shipping Method. This will depend on the Fulfillment + Provider. + '/orders/{id}/cancel': + post: + operationId: PostOrdersOrderCancel + summary: Cancel an Order + description: >- + Registers an Order as canceled. This triggers a flow that will cancel + any created Fulfillments and Payments, may fail if the Payment or + Fulfillment Provider is unable to cancel the Payment/Fulfillment. + parameters: + - in: path + name: id + required: true + description: The id of the Order. + schema: + type: string + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + order: + $ref: '#/components/schemas/order' + '/orders/{id}/capture': + post: + operationId: PostOrdersOrderCapture + summary: Capture an Order + description: Captures all the Payments associated with an Order. + parameters: + - in: path + name: id + required: true + description: The id of the Order. + schema: + type: string + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + order: + $ref: '#/components/schemas/order' + '/orders/{id}/claims/{claim_id}/shipments': + post: + operationId: PostOrdersOrderClaimsClaimShipments + summary: Create Claim Shipment + description: Registers a Claim Fulfillment as shipped. + parameters: + - in: path + name: id + required: true + description: The id of the Order. + schema: + type: string + - in: path + name: claim_id + required: true + description: The id of the Claim. + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + fulfillment_id: + description: The id of the Fulfillment. + type: string + tracking_numbers: + description: The tracking numbers for the shipment. + type: array + items: + type: string + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + order: + $ref: '#/components/schemas/order' + '/order/{id}/claims': + post: + operationId: PostOrdersOrderClaims + summary: Create a Claim + description: Creates a Claim. + parameters: + - in: path + name: id + required: true + description: The id of the Order. + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + type: + description: >- + The type of the Claim. This will determine how the Claim is + treated: `replace` Claims will result in a Fulfillment with + new items being created, while a `refund` Claim will refund + the amount paid for the claimed items. + type: string + enum: + - replace + - refund + claim_items: + description: The Claim Items that the Claim will consist of. + type: array + items: + properties: + item_id: + description: The id of the Line Item that will be claimed. + type: string + quantity: + description: The number of items that will be returned + type: integer + note: + description: >- + Short text describing the Claim Item in further + detail. + type: string + reason: + description: The reason for the Claim + type: string + enum: + - missing_item + - wrong_item + - production_failure + - other + tags: + description: A list o tags to add to the Claim Item + type: array + items: + type: string + images: + description: >- + A list of image URL's that will be associated with the + Claim + items: + type: string + return_shipping: + description: >- + Optional details for the Return Shipping Method, if the + items are to be sent back. + type: object + properties: + option_id: + type: string + description: >- + The id of the Shipping Option to create the Shipping + Method from. + price: + type: integer + description: The price to charge for the Shipping Method. + additional_items: + description: >- + The new items to send to the Customer when the Claim type is + Replace. + type: array + items: + properties: + variant_id: + description: The id of the Product Variant to ship. + type: string + quantity: + description: The quantity of the Product Variant to ship. + type: integer + shipping_methods: + description: The Shipping Methods to send the additional Line Items with. + type: array + items: + properties: + id: + description: The id of an existing Shipping Method + type: string + option_id: + description: >- + The id of the Shipping Option to create a Shipping + Method from + type: string + price: + description: The price to charge for the Shipping Method + type: integer + refund_amount: + description: >- + The amount to refund the Customer when the Claim type is + `refund`. + type: integer + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + order: + $ref: '#/components/schemas/order' + '/orders/{id}/fulfillments': + post: + operationId: PostOrdersOrderFulfillments + summary: Create a Fulfillment + description: >- + Creates a Fulfillment of an Order - will notify Fulfillment Providers to + prepare a shipment. + parameters: + - in: path + name: id + required: true + description: The id of the Order. + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + items: + description: The Line Items to include in the Fulfillment. + type: array + items: + properties: + item_id: + description: The id of Line Item to fulfill. + type: string + quantity: + description: The quantity of the Line Item to fulfill. + type: integer + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + order: + $ref: '#/components/schemas/order' + '/orders/{id}/shipment': + post: + operationId: PostOrdersOrderShipment + summary: Create a Shipment + description: Registers a Fulfillment as shipped. + parameters: + - in: path + name: id + required: true + description: The id of the Order. + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + fulfillment_id: + description: The id of the Fulfillment. + type: string + tracking_numbers: + description: The tracking numbers for the shipment. + type: array + items: + type: string + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + order: + $ref: '#/components/schemas/order' + '/orders/{id}/swaps/{swap_id}/shipments': + post: + operationId: PostOrdersOrderSwapsSwapShipments + summary: Create Swap Shipment + description: Registers a Swap Fulfillment as shipped. + parameters: + - in: path + name: id + required: true + description: The id of the Order. + schema: + type: string + - in: path + name: swap_id + required: true + description: The id of the Swap. + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + fulfillment_id: + description: The id of the Fulfillment. + type: string + tracking_numbers: + description: The tracking numbers for the shipment. + type: array + items: + type: string + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + order: + $ref: '#/components/schemas/order' + '/order/{id}/swaps': + post: + operationId: PostOrdersOrderSwaps + summary: Create a Swap + description: >- + Creates a Swap. Swaps are used to handle Return of previously purchased + goods and Fulfillment of replacements simultaneously. + parameters: + - in: path + name: id + required: true + description: The id of the Order. + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + return_items: + description: The Line Items to return as part of the Swap. + type: array + items: + properties: + item_id: + description: The id of the Line Item that will be claimed. + type: string + quantity: + description: The number of items that will be returned + type: integer + return_shipping: + description: How the Swap will be returned. + type: object + properties: + option_id: + type: string + description: >- + The id of the Shipping Option to create the Shipping + Method from. + price: + type: integer + description: The price to charge for the Shipping Method. + additional_items: + description: The new items to send to the Customer. + type: array + items: + properties: + variant_id: + description: The id of the Product Variant to ship. + type: string + quantity: + description: The quantity of the Product Variant to ship. + type: integer + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + order: + $ref: '#/components/schemas/order' + '/order/{id}/metadata/{key}': + delete: + operationId: DeleteOrdersOrderMetadataKey + summary: Delete Metadata + description: Deletes a metadata key. + parameters: + - in: path + name: id + required: true + description: The id of the Order. + schema: + type: string + - in: path + name: key + required: true + description: The metadata key. + schema: + type: string + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + order: + $ref: '#/components/schemas/order' + '/orders/{id}/claims/{claim_id}/fulfillments': + post: + operationId: PostOrdersOrderClaimsClaimFulfillments + summary: Create a Claim Fulfillment + description: Creates a Fulfillment for a Claim. + parameters: + - in: path + name: id + required: true + description: The id of the Order. + schema: + type: string + - in: path + name: claim_id + required: true + description: The id of the Claim. + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + order: + $ref: '#/components/schemas/order' + '/orders/{id}/swaps/{swap_id}/fulfillments': + post: + operationId: PostOrdersOrderSwapsSwapFulfillments + summary: Create a Swap Fulfillment + description: Creates a Fulfillment for a Swap. + parameters: + - in: path + name: id + required: true + description: The id of the Order. + schema: + type: string + - in: path + name: swap_id + required: true + description: The id of the Swap. + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + order: + $ref: '#/components/schemas/order' + '/orders/{id}': + get: + operationId: GetOrdersOrder + summary: Retrieve an Order + description: Retrieves an Order + parameters: + - in: path + name: id + required: true + description: The id of the Order. + schema: + type: string + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + order: + $ref: '#/components/schemas/order' + /orders: + get: + operationId: GetOrders + summary: List Orders + description: Retrieves a list of Orders + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + orders: + type: array + items: + $ref: '#/components/schemas/order' + '/orders/{id}/swaps/{swap_id}/process-payment': + post: + operationId: PostOrdersOrderSwapsSwapProcessPayment + summary: Process a Swap difference + description: >- + When there are differences between the returned and shipped Products in + a Swap, the difference must be processed. Either a Refund will be issued + or a Payment will be captured. + parameters: + - in: path + name: id + required: true + description: The id of the Order. + schema: + type: string + - in: path + name: swap_id + required: true + description: The id of the Swap. + schema: + type: string + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + order: + $ref: '#/components/schemas/order' + '/orders/{id}/returns/{return_id}/receive': + post: + operationId: PostOrdersOrderReturnsReturnReceive + summary: Receive a Return + description: Registers a Return as received. + parameters: + - in: path + name: id + required: true + description: The id of the Order. + schema: + type: string + - in: path + name: return_id + required: true + description: The id of the Return. + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + items: + description: The Line Items that have been received. + type: array + items: + properties: + item_id: + description: The id of the Line Item. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + refund: + description: The amount to refund. + type: integer + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + order: + $ref: '#/components/schemas/order' + '/orders/{id}/swaps/{swap_id}/receive': + post: + operationId: PostOrdersOrderSwapsSwapReceive + summary: Receive a Swap + description: Registers a Swap as received. + parameters: + - in: path + name: id + required: true + description: The id of the Order. + schema: + type: string + - in: path + name: swap_id + required: true + description: The id of the Swap. + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + items: + description: The Line Items that have been received. + type: array + items: + properties: + item_id: + description: The id of the Line Item. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + order: + $ref: '#/components/schemas/order' + '/orders/{id}/refunds': + post: + operationId: PostOrdersOrderRefunds + summary: Create a Refund + description: Issues a Refund. + parameters: + - in: path + name: id + required: true + description: The id of the Order. + schema: + type: string + requestBody: + content: + application/json: + schema: + required: + - amount + - reason + properties: + amount: + description: The amount to refund. + type: integer + reason: + description: The reason for the Refund. + type: string + note: + description: A not with additional details about the Refund. + type: string + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + order: + $ref: '#/components/schemas/order' + '/orders/{id}/returns': + post: + operationId: PostOrdersOrderReturns + summary: Request a Return + description: >- + Requests a Return. If applicable a return label will be created and + other plugins notified. + parameters: + - in: path + name: id + required: true + description: The id of the Order. + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + items: + description: The Line Items that will be returned. + type: array + items: + properties: + item_id: + description: The id of the Line Item. + type: string + reason_id: + description: The id of the Return Reason to use. + type: string + note: + description: An optional note with information about the Return. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + return_shipping: + description: >- + The Shipping Method to be used to handle the return + shipment. + type: object + properties: + option_id: + type: string + description: >- + The id of the Shipping Option to create the Shipping + Method from. + price: + type: integer + description: The price to charge for the Shipping Method. + receive_now: + description: >- + A flag to indicate if the Return should be registerd as + received immediately. + type: boolean + refund: + description: The amount to refund. + type: integer + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + order: + $ref: '#/components/schemas/order' + '/order/{id}/claims/{claim_id}': + post: + operationId: PostOrdersOrderClaimsClaim + summary: Update a Claim + description: Updates a Claim. + parameters: + - in: path + name: id + required: true + description: The id of the Order. + schema: + type: string + - in: path + name: claim_id + required: true + description: The id of the Claim. + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + claim_items: + description: The Claim Items that the Claim will consist of. + type: array + items: + properties: + id: + description: The id of the Claim Item. + type: string + item_id: + description: The id of the Line Item that will be claimed. + type: string + quantity: + description: The number of items that will be returned + type: integer + note: + description: >- + Short text describing the Claim Item in further + detail. + type: string + reason: + description: The reason for the Claim + type: string + enum: + - missing_item + - wrong_item + - production_failure + - other + tags: + description: A list o tags to add to the Claim Item + type: array + items: + type: string + images: + description: >- + A list of image URL's that will be associated with the + Claim + items: + type: string + shipping_methods: + description: The Shipping Methods to send the additional Line Items with. + type: array + items: + properties: + id: + description: The id of an existing Shipping Method + type: string + option_id: + description: >- + The id of the Shipping Option to create a Shipping + Method from + type: string + price: + description: The price to charge for the Shipping Method + type: integer + metadata: + description: >- + An optional set of key-value pairs to hold additional + information. + type: object + tags: + - Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + order: + $ref: '#/components/schemas/order' '/products/{id}/options': post: operationId: PostProductsProductOptions @@ -2190,188 +2747,6 @@ paths: type: array items: $ref: '#/components/schemas/product_type' - /returns: - get: - operationId: GetReturns - summary: List Returns - description: Retrieves a list of Returns - tags: - - Return - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - returns: - type: array - items: - $ref: '#/components/schemas/return' - '/returns/{id}receive': - post: - operationId: PostReturnsReturnReceive - summary: Receive a Return - description: >- - Registers a Return as received. Updates statuses on Orders and Swaps - accordingly. - parameters: - - in: path - name: id - required: true - description: The id of the Return. - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - items: - description: The Line Items that have been received. - type: array - items: - properties: - item_id: - description: The id of the Line Item. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - refund: - description: The amount to refund. - type: integer - tags: - - Return - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - return: - $ref: '#/components/schemas/return' - /return-reasons: - post: - operationId: PostReturnReasons - summary: Create a Return Reason - description: Creates a Return Reason - requestBody: - content: - application/json: - schema: - properties: - label: - description: The label to display to the Customer. - type: string - value: - description: >- - The value that the Return Reason will be identified by. Must - be unique. - type: string - description: - description: An optional description to for the Reason. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - tags: - - Return Reason - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - return_reason: - $ref: '#/components/schemas/return_reason' - get: - operationId: GetReturnReasons - summary: List Return Reasons - description: Retrieves a list of Return Reasons. - tags: - - Return Reason - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - return_reasons: - type: array - items: - $ref: '#/components/schemas/return_reason' - '/return-reasons/{id}': - get: - operationId: GetReturnReasonsReason - summary: Retrieve a Return Reason - description: Retrieves a Return Reason. - parameters: - - in: path - name: id - required: true - description: The id of the Return Reason. - schema: - type: string - tags: - - Return Reason - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - return_reason: - $ref: '#/components/schemas/return_reason' - post: - operationId: PostReturnReasonsReason - summary: Update a Return Reason - description: Updates a Return Reason - parameters: - - in: path - name: id - required: true - description: The id of the Return Reason. - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - label: - description: The label to display to the Customer. - type: string - value: - description: >- - The value that the Return Reason will be identified by. Must - be unique. - type: string - description: - description: An optional description to for the Reason. - type: string - metadata: - description: >- - An optional set of key-value pairs with additional - information. - type: object - tags: - - Return Reason - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - return_reason: - $ref: '#/components/schemas/return_reason' '/regions/{id}/countries': post: operationId: PostRegionsRegionCountries @@ -2784,276 +3159,34 @@ paths: properties: region: $ref: '#/components/schemas/region' - '/orders/{id}/shipping-methods': + /return-reasons: post: - operationId: PostOrdersOrderShippingMethods - summary: Add a Shipping Method - description: >- - Adds a Shipping Method to an Order. If another Shipping Method exists - with the same Shipping Profile, the previous Shipping Method will be - replaced. - parameters: - - in: path - name: id - required: true - description: The id of the Order. - schema: - type: string - tags: - - Order - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - order: - $ref: '#/components/schemas/order' - requestBody: - content: - application/json: - schema: - type: object - required: - - price - - option_id - - data - properties: - price: - type: integer - description: >- - The price (excluding VAT) that should be charged for the - Shipping Method - option_id: - type: string - description: >- - The id of the Shipping Option to create the Shipping Method - from. - data: - type: object - description: >- - The data required for the Shipping Option to create a - Shipping Method. This will depend on the Fulfillment - Provider. - '/orders/{id}/cancel': - post: - operationId: PostOrdersOrderCancel - summary: Cancel an Order - description: >- - Registers an Order as canceled. This triggers a flow that will cancel - any created Fulfillments and Payments, may fail if the Payment or - Fulfillment Provider is unable to cancel the Payment/Fulfillment. - parameters: - - in: path - name: id - required: true - description: The id of the Order. - schema: - type: string - tags: - - Order - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - order: - $ref: '#/components/schemas/order' - '/orders/{id}/capture': - post: - operationId: PostOrdersOrderCapture - summary: Capture an Order - description: Captures all the Payments associated with an Order. - parameters: - - in: path - name: id - required: true - description: The id of the Order. - schema: - type: string - tags: - - Order - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - order: - $ref: '#/components/schemas/order' - '/orders/{id}/claims/{claim_id}/shipments': - post: - operationId: PostOrdersOrderClaimsClaimShipments - summary: Create Claim Shipment - description: Registers a Claim Fulfillment as shipped. - parameters: - - in: path - name: id - required: true - description: The id of the Order. - schema: - type: string - - in: path - name: claim_id - required: true - description: The id of the Claim. - schema: - type: string + operationId: PostReturnReasons + summary: Create a Return Reason + description: Creates a Return Reason requestBody: content: application/json: schema: properties: - fulfillment_id: - description: The id of the Fulfillment. + label: + description: The label to display to the Customer. type: string - tracking_numbers: - description: The tracking numbers for the shipment. - type: array - items: - type: string - tags: - - Order - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - order: - $ref: '#/components/schemas/order' - '/order/{id}/claims': - post: - operationId: PostOrdersOrderClaims - summary: Create a Claim - description: Creates a Claim. - parameters: - - in: path - name: id - required: true - description: The id of the Order. - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - type: + value: description: >- - The type of the Claim. This will determine how the Claim is - treated: `replace` Claims will result in a Fulfillment with - new items being created, while a `refund` Claim will refund - the amount paid for the claimed items. + The value that the Return Reason will be identified by. Must + be unique. + type: string + description: + description: An optional description to for the Reason. type: string - enum: - - replace - - refund - claim_items: - description: The Claim Items that the Claim will consist of. - type: array - items: - properties: - item_id: - description: The id of the Line Item that will be claimed. - type: string - quantity: - description: The number of items that will be returned - type: integer - note: - description: >- - Short text describing the Claim Item in further - detail. - type: string - reason: - description: The reason for the Claim - type: string - enum: - - missing_item - - wrong_item - - production_failure - - other - tags: - description: A list o tags to add to the Claim Item - type: array - items: - type: string - images: - description: >- - A list of image URL's that will be associated with the - Claim - items: - type: string - return_shipping: - description: >- - Optional details for the Return Shipping Method, if the - items are to be sent back. - type: object - properties: - option_id: - type: string - description: >- - The id of the Shipping Option to create the Shipping - Method from. - price: - type: integer - description: The price to charge for the Shipping Method. - additional_items: - description: >- - The new items to send to the Customer when the Claim type is - Replace. - type: array - items: - properties: - variant_id: - description: The id of the Product Variant to ship. - type: string - quantity: - description: The quantity of the Product Variant to ship. - type: integer - shipping_methods: - description: The Shipping Methods to send the additional Line Items with. - type: array - items: - properties: - id: - description: The id of an existing Shipping Method - type: string - option_id: - description: >- - The id of the Shipping Option to create a Shipping - Method from - type: string - price: - description: The price to charge for the Shipping Method - type: integer - shipping_address: - type: object - description: >- - An optional shipping address to send the claim to. Defaults - to the parent order's shipping address - refund_amount: - description: >- - The amount to refund the Customer when the Claim type is - `refund`. - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Claim. - type: boolean metadata: description: >- - An optional set of key-value pairs to hold additional + An optional set of key-value pairs with additional information. type: object tags: - - Order + - Return Reason responses: '200': description: OK @@ -3061,332 +3194,14 @@ paths: application/json: schema: properties: - order: - $ref: '#/components/schemas/order' - '/orders/{id}/fulfillments': - post: - operationId: PostOrdersOrderFulfillments - summary: Create a Fulfillment - description: >- - Creates a Fulfillment of an Order - will notify Fulfillment Providers to - prepare a shipment. - parameters: - - in: path - name: id - required: true - description: The id of the Order. - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - items: - description: The Line Items to include in the Fulfillment. - type: array - items: - properties: - item_id: - description: The id of Line Item to fulfill. - type: string - quantity: - description: The quantity of the Line Item to fulfill. - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Swap. - type: boolean - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - tags: - - Order - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - order: - $ref: '#/components/schemas/order' - '/orders/{id}/shipment': - post: - operationId: PostOrdersOrderShipment - summary: Create a Shipment - description: Registers a Fulfillment as shipped. - parameters: - - in: path - name: id - required: true - description: The id of the Order. - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - fulfillment_id: - description: The id of the Fulfillment. - type: string - tracking_numbers: - description: The tracking numbers for the shipment. - type: array - items: - type: string - no_notification: - description: >- - If set to true no notification will be send related to this - Claim. - type: boolean - tags: - - Order - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - order: - $ref: '#/components/schemas/order' - '/orders/{id}/swaps/{swap_id}/shipments': - post: - operationId: PostOrdersOrderSwapsSwapShipments - summary: Create Swap Shipment - description: Registers a Swap Fulfillment as shipped. - parameters: - - in: path - name: id - required: true - description: The id of the Order. - schema: - type: string - - in: path - name: swap_id - required: true - description: The id of the Swap. - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - fulfillment_id: - description: The id of the Fulfillment. - type: string - tracking_numbers: - description: The tracking numbers for the shipment. - type: array - items: - type: string - tags: - - Order - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - order: - $ref: '#/components/schemas/order' - '/order/{id}/swaps': - post: - operationId: PostOrdersOrderSwaps - summary: Create a Swap - description: >- - Creates a Swap. Swaps are used to handle Return of previously purchased - goods and Fulfillment of replacements simultaneously. - parameters: - - in: path - name: id - required: true - description: The id of the Order. - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - return_items: - description: The Line Items to return as part of the Swap. - type: array - items: - properties: - item_id: - description: The id of the Line Item that will be claimed. - type: string - quantity: - description: The number of items that will be returned - type: integer - return_shipping: - description: How the Swap will be returned. - type: object - properties: - option_id: - type: string - description: >- - The id of the Shipping Option to create the Shipping - Method from. - price: - type: integer - description: The price to charge for the Shipping Method. - additional_items: - description: The new items to send to the Customer. - type: array - items: - properties: - variant_id: - description: The id of the Product Variant to ship. - type: string - quantity: - description: The quantity of the Product Variant to ship. - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Swap. - type: boolean - tags: - - Order - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - order: - $ref: '#/components/schemas/order' - '/order/{id}/metadata/{key}': - delete: - operationId: DeleteOrdersOrderMetadataKey - summary: Delete Metadata - description: Deletes a metadata key. - parameters: - - in: path - name: id - required: true - description: The id of the Order. - schema: - type: string - - in: path - name: key - required: true - description: The metadata key. - schema: - type: string - tags: - - Order - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - order: - $ref: '#/components/schemas/order' - '/orders/{id}/claims/{claim_id}/fulfillments': - post: - operationId: PostOrdersOrderClaimsClaimFulfillments - summary: Create a Claim Fulfillment - description: Creates a Fulfillment for a Claim. - parameters: - - in: path - name: id - required: true - description: The id of the Order. - schema: - type: string - - in: path - name: claim_id - required: true - description: The id of the Claim. - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - tags: - - Order - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - order: - $ref: '#/components/schemas/order' - '/orders/{id}/swaps/{swap_id}/fulfillments': - post: - operationId: PostOrdersOrderSwapsSwapFulfillments - summary: Create a Swap Fulfillment - description: Creates a Fulfillment for a Swap. - parameters: - - in: path - name: id - required: true - description: The id of the Order. - schema: - type: string - - in: path - name: swap_id - required: true - description: The id of the Swap. - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - metadata: - description: >- - An optional set of key-value pairs to hold additional - information. - type: object - tags: - - Order - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - order: - $ref: '#/components/schemas/order' - '/orders/{id}': + return_reason: + $ref: '#/components/schemas/return_reason' get: - operationId: GetOrdersOrder - summary: Retrieve an Order - description: Retrieves an Order - parameters: - - in: path - name: id - required: true - description: The id of the Order. - schema: - type: string + operationId: GetReturnReasons + summary: List Return Reasons + description: Retrieves a list of Return Reasons. tags: - - Order + - Return Reason responses: '200': description: OK @@ -3394,49 +3209,24 @@ paths: application/json: schema: properties: - order: - $ref: '#/components/schemas/order' - /orders: - get: - operationId: GetOrders - summary: List Orders - description: Retrieves a list of Orders - tags: - - Order - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - orders: + return_reasons: type: array items: - $ref: '#/components/schemas/order' - '/orders/{id}/swaps/{swap_id}/process-payment': - post: - operationId: PostOrdersOrderSwapsSwapProcessPayment - summary: Process a Swap difference - description: >- - When there are differences between the returned and shipped Products in - a Swap, the difference must be processed. Either a Refund will be issued - or a Payment will be captured. + $ref: '#/components/schemas/return_reason' + '/return-reasons/{id}': + get: + operationId: GetReturnReasonsReason + summary: Retrieve a Return Reason + description: Retrieves a Return Reason. parameters: - in: path name: id required: true - description: The id of the Order. - schema: - type: string - - in: path - name: swap_id - required: true - description: The id of the Swap. + description: The id of the Return Reason. schema: type: string tags: - - Order + - Return Reason responses: '200': description: OK @@ -3444,24 +3234,17 @@ paths: application/json: schema: properties: - order: - $ref: '#/components/schemas/order' - '/orders/{id}/swaps/{swap_id}/receive': + return_reason: + $ref: '#/components/schemas/return_reason' post: - operationId: PostOrdersOrderSwapsSwapReceive - summary: Receive a Swap - description: Registers a Swap as received. + operationId: PostReturnReasonsReason + summary: Update a Return Reason + description: Updates a Return Reason parameters: - in: path name: id required: true - description: The id of the Order. - schema: - type: string - - in: path - name: swap_id - required: true - description: The id of the Swap. + description: The id of the Return Reason. schema: type: string requestBody: @@ -3469,236 +3252,24 @@ paths: application/json: schema: properties: - items: - description: The Line Items that have been received. - type: array - items: - properties: - item_id: - description: The id of the Line Item. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - tags: - - Order - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - order: - $ref: '#/components/schemas/order' - '/orders/{id}/refunds': - post: - operationId: PostOrdersOrderRefunds - summary: Create a Refund - description: Issues a Refund. - parameters: - - in: path - name: id - required: true - description: The id of the Order. - schema: - type: string - requestBody: - content: - application/json: - schema: - required: - - amount - - reason - properties: - amount: - description: The amount to refund. - type: integer - reason: - description: The reason for the Refund. + label: + description: The label to display to the Customer. type: string - note: - description: A not with additional details about the Refund. + value: + description: >- + The value that the Return Reason will be identified by. Must + be unique. + type: string + description: + description: An optional description to for the Reason. type: string - no_notification: - description: >- - If set to true no notification will be send related to this - Swap. - type: boolean - tags: - - Order - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - order: - $ref: '#/components/schemas/order' - '/orders/{id}/returns': - post: - operationId: PostOrdersOrderReturns - summary: Request a Return - description: >- - Requests a Return. If applicable a return label will be created and - other plugins notified. - parameters: - - in: path - name: id - required: true - description: The id of the Order. - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - items: - description: The Line Items that will be returned. - type: array - items: - properties: - item_id: - description: The id of the Line Item. - type: string - reason_id: - description: The id of the Return Reason to use. - type: string - note: - description: An optional note with information about the Return. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - return_shipping: - description: >- - The Shipping Method to be used to handle the return - shipment. - type: object - properties: - option_id: - type: string - description: >- - The id of the Shipping Option to create the Shipping - Method from. - price: - type: integer - description: The price to charge for the Shipping Method. - receive_now: - description: >- - A flag to indicate if the Return should be registerd as - received immediately. - type: boolean - no_notification: - description: >- - A flag to indicate if no notifications should be emitted - related to the requested Return. - type: boolean - refund: - description: The amount to refund. - type: integer - tags: - - Order - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - order: - $ref: '#/components/schemas/order' - '/order/{id}/claims/{claim_id}': - post: - operationId: PostOrdersOrderClaimsClaim - summary: Update a Claim - description: Updates a Claim. - parameters: - - in: path - name: id - required: true - description: The id of the Order. - schema: - type: string - - in: path - name: claim_id - required: true - description: The id of the Claim. - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - claim_items: - description: The Claim Items that the Claim will consist of. - type: array - items: - properties: - id: - description: The id of the Claim Item. - type: string - item_id: - description: The id of the Line Item that will be claimed. - type: string - quantity: - description: The number of items that will be returned - type: integer - note: - description: >- - Short text describing the Claim Item in further - detail. - type: string - reason: - description: The reason for the Claim - type: string - enum: - - missing_item - - wrong_item - - production_failure - - other - tags: - description: A list o tags to add to the Claim Item - type: array - items: - type: string - images: - description: >- - A list of image URL's that will be associated with the - Claim - items: - type: string - shipping_methods: - description: The Shipping Methods to send the additional Line Items with. - type: array - items: - properties: - id: - description: The id of an existing Shipping Method - type: string - option_id: - description: >- - The id of the Shipping Option to create a Shipping - Method from - type: string - price: - description: The price to charge for the Shipping Method - type: integer - no_notification: - description: >- - If set to true no notification will be send related to this - Swap. - type: boolean metadata: description: >- - An optional set of key-value pairs to hold additional + An optional set of key-value pairs with additional information. type: object tags: - - Order + - Return Reason responses: '200': description: OK @@ -3706,8 +3277,26 @@ paths: application/json: schema: properties: - order: - $ref: '#/components/schemas/order' + return_reason: + $ref: '#/components/schemas/return_reason' + /returns: + get: + operationId: GetReturns + summary: List Returns + description: Retrieves a list of Returns + tags: + - Return + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + returns: + type: array + items: + $ref: '#/components/schemas/return' /shipping-options: post: operationId: PostShippingOptions @@ -4431,11 +4020,6 @@ components: deleted_at: type: string format: date-time - no_notification: - description: >- - Flag for describing whether or not notifications related to this - should be send. - type: boolean metadata: type: object claim_tag: @@ -4583,6 +4167,9 @@ components: type: array items: $ref: '#/components/schemas/product' + usage_limit: + description: The maximum number of times that a discount can be used. + type: integer created_at: description: The date with timezone at which the resource was created. type: string @@ -4645,12 +4232,6 @@ components: type: array items: $ref: '#/components/schemas/region' - usage_limit: - description: The maximum number of times that a discount can be used. - type: integer - usage_count: - description: The number of times a discount has been used. - type: integer created_at: description: The date with timezone at which the resource was created. type: string @@ -4666,51 +4247,6 @@ components: metadata: description: An optional key-value map with additional information. type: object - draft-order: - title: DraftOrder - description: Represents a draft order - x-resourceId: draft-order - properties: - id: - type: string - status: - type: string - enum: - - open - - completed - display_id: - type: string - cart_id: - type: string - cart: - anyOf: - - $ref: '#/components/schemas/cart' - order_id: - type: string - order: - anyOf: - - $ref: '#/components/schemas/order' - canceled_at: - type: string - format: date-time - created_at: - type: string - format: date-time - update_at: - type: string - format: date-time - deleted_at: - type: string - format: date-time - completed_at: - type: string - format: date-time - no_notification_order: - type: boolean - metadata: - type: object - idempotency_key: - type: string fulfillment_item: title: Fulfillment Item description: >- @@ -5329,13 +4865,6 @@ components: type: integer gift_card_total: type: integer - paid_total: - type: integer - no_notification: - description: >- - Flag for describing whether or not notifications related to this - should be send. - type: boolean payment_provider: title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. @@ -6141,11 +5670,6 @@ components: description: The date with timezone at which the resource was last updated. type: string format: date-time - no_notification: - description: >- - When set to true, no notification will be sent related to this - return. - type: boolean metadata: description: An optional key-value map with additional information. type: object @@ -6506,9 +6030,6 @@ components: description: The date with timezone at which the resource was last updated. type: string format: date-time - no_notification: - description: 'If set to true, no notification will be sent related to this swap' - type: boolean metadata: description: An optional key-value map with additional information. type: object diff --git a/docs/api/store-spec3.json b/docs/api/store-spec3.json index 9fcf3c6e85..5727ac1234 100644 --- a/docs/api/store-spec3.json +++ b/docs/api/store-spec3.json @@ -258,7 +258,7 @@ } } }, - "/carts/{id}/complete": { + "/carts/{id}/complete-cart": { "post": { "summary": "Complete a Cart", "operationId": "PostCartsCartComplete", @@ -673,9 +673,9 @@ } }, "post": { - "operationId": "PostCartsCartPaymentSessionUpdate", - "summary": "Update a Payment Session", - "description": "Updates a Payment Session with additional data.", + "operationId": "PostCartsCartPaymentSessionsSession", + "summary": "Refresh a Payment Session", + "description": "Refreshes a Payment Session to ensure that it is in sync with the Cart - this is usually not necessary.", "parameters": [ { "in": "path", @@ -690,7 +690,7 @@ "in": "path", "name": "provider_id", "required": true, - "description": "The id of the payment provider.", + "description": "The id of the Payment Provider that created the Payment Session to be refreshed.", "schema": { "type": "string" } @@ -714,29 +714,6 @@ } } } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "provider_id", - "data" - ], - "properties": { - "provider_id": { - "type": "string", - "description": "The id of the Payment Provider responsible for the Payment Session to update." - }, - "data": { - "type": "object", - "description": "The data to update the payment session with." - } - } - } - } - } } } }, @@ -939,24 +916,24 @@ } } }, - "/gift-cards/{code}": { - "get": { - "operationId": "GetGiftCardsCode", - "summary": "Retrieve Gift Card by Code", - "description": "Retrieves a Gift Card by its associated unqiue code.", + "/carts/{id}/payment-session/update": { + "post": { + "operationId": "PostCartsCartPaymentSessionUpdate", + "summary": "Update a Payment Session", + "description": "Updates a Payment Session with additional data.", "parameters": [ { "in": "path", - "name": "code", + "name": "id", "required": true, - "description": "The unique Gift Card code.", + "description": "The id of the Cart.", "schema": { "type": "string" } } ], "tags": [ - "Gift Card" + "Cart" ], "responses": { "200": { @@ -965,26 +942,37 @@ "application/json": { "schema": { "properties": { - "id": { - "description": "The id of the Gift Card" - }, - "code": { - "description": "The code of the Gift Card" - }, - "value": { - "description": "The original value of the Gift Card." - }, - "balance": { - "description": "The current balanace of the Gift Card" - }, - "region": { - "$ref": "#/components/schemas/region" + "cart": { + "$ref": "#/components/schemas/cart" } } } } } } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "provider_id", + "data" + ], + "properties": { + "provider_id": { + "type": "string", + "description": "The id of the Payment Provider responsible for the Payment Session to update." + }, + "data": { + "type": "object", + "description": "The data to update the payment session with." + } + } + } + } + } } } }, @@ -1493,24 +1481,24 @@ } } }, - "/orders/cart/{cart_id}": { + "/gift-cards/{code}": { "get": { - "operationId": "GetOrdersOrderCartId", - "summary": "Retrieves Order by Cart id", - "description": "Retrieves an Order by the id of the Cart that was used to create the Order.", + "operationId": "GetGiftCardsCode", + "summary": "Retrieve Gift Card by Code", + "description": "Retrieves a Gift Card by its associated unqiue code.", "parameters": [ { "in": "path", - "name": "cart_id", + "name": "code", "required": true, - "description": "The id of Cart.", + "description": "The unique Gift Card code.", "schema": { "type": "string" } } ], "tags": [ - "Order" + "Gift Card" ], "responses": { "200": { @@ -1519,91 +1507,20 @@ "application/json": { "schema": { "properties": { - "order": { - "$ref": "#/components/schemas/order" - } - } - } - } - } - } - } - } - }, - "/orders/{id}": { - "get": { - "operationId": "GetOrdersOrder", - "summary": "Retrieves an Order", - "description": "Retrieves an Order", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Order.", - "schema": { - "type": "string" - } - } - ], - "tags": [ - "Order" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "customer": { - "$ref": "#/components/schemas/customer" - } - } - } - } - } - } - } - } - }, - "/orders": { - "get": { - "operationId": "GetOrders", - "summary": "Look Up an Order", - "description": "Looks for an Order with a given `display_id`, `email` pair. The `display_id`, `email` pair must match in order for the Order to be returned.", - "parameters": [ - { - "in": "query", - "name": "display_id", - "required": true, - "description": "The display id given to the Order.", - "schema": { - "type": "number" - } - }, - { - "in": "query", - "name": "email", - "required": true, - "description": "The email of the Order with the given display_id.", - "schema": { - "type": "string" - } - } - ], - "tags": [ - "Order" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "order": { - "$ref": "#/components/schemas/order" + "id": { + "description": "The id of the Gift Card" + }, + "code": { + "description": "The code of the Gift Card" + }, + "value": { + "description": "The original value of the Gift Card." + }, + "balance": { + "description": "The current balanace of the Gift Card" + }, + "region": { + "$ref": "#/components/schemas/region" } } } @@ -1691,72 +1608,6 @@ } } }, - "/returns": { - "post": { - "operationId": "PostReturns", - "summary": "Create Return", - "description": "Creates a Return for an Order.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "order_id": { - "type": "string", - "description": "The id of the Order to create the Return from." - }, - "items": { - "description": "The items to include in the Return.", - "type": "array", - "items": { - "properties": { - "item_id": { - "description": "The id of the Line Item from the Order.", - "type": "string" - }, - "quantity": { - "description": "The quantity to return.", - "type": "integer" - } - } - } - }, - "return_shipping": { - "description": "If the Return is to be handled by the store operator the Customer can choose a Return Shipping Method. Alternatvely the Customer can handle the Return themselves.", - "type": "object", - "properties": { - "option_id": { - "type": "string", - "description": "The id of the Shipping Option to create the Shipping Method from." - } - } - } - } - } - } - } - }, - "tags": [ - "Return" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "return": { - "$ref": "#/components/schemas/return" - } - } - } - } - } - } - } - } - }, "/return-reasons/{id}": { "get": { "operationId": "GetReturnReasonsReason", @@ -1901,24 +1752,24 @@ } } }, - "/swaps/{cart_id}": { + "/orders/cart/{cart_id}": { "get": { - "operationId": "GetSwapsSwapCartId", - "summary": "Retrieve Swap by Cart id", - "description": "Retrieves a Swap by the id of the Cart used to confirm the Swap.", + "operationId": "GetOrdersOrderCartId", + "summary": "Retrieves Order by Cart id", + "description": "Retrieves an Order by the id of the Cart that was used to create the Order.", "parameters": [ { "in": "path", "name": "cart_id", "required": true, - "description": "The id of the Cart", + "description": "The id of Cart.", "schema": { "type": "string" } } ], "tags": [ - "Swap" + "Order" ], "responses": { "200": { @@ -1927,8 +1778,157 @@ "application/json": { "schema": { "properties": { - "swap": { - "$ref": "#/components/schemas/swap" + "order": { + "$ref": "#/components/schemas/order" + } + } + } + } + } + } + } + } + }, + "/orders/{id}": { + "get": { + "operationId": "GetOrdersOrder", + "summary": "Retrieves an Order", + "description": "Retrieves an Order", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Order.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Order" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "customer": { + "$ref": "#/components/schemas/customer" + } + } + } + } + } + } + } + } + }, + "/orders": { + "get": { + "operationId": "GetOrders", + "summary": "Look Up an Order", + "description": "Looks for an Order with a given `display_id`, `email` pair. The `display_id`, `email` pair must match in order for the Order to be returned.", + "parameters": [ + { + "in": "query", + "name": "display_id", + "required": true, + "description": "The display id given to the Order.", + "schema": { + "type": "number" + } + }, + { + "in": "query", + "name": "email", + "required": true, + "description": "The email of the Order with the given display_id.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Order" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "order": { + "$ref": "#/components/schemas/order" + } + } + } + } + } + } + } + } + }, + "/returns": { + "post": { + "operationId": "PostReturns", + "summary": "Create Return", + "description": "Creates a Return for an Order.", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "order_id": { + "type": "string", + "description": "The id of the Order to create the Return from." + }, + "items": { + "description": "The items to include in the Return.", + "type": "array", + "items": { + "properties": { + "item_id": { + "description": "The id of the Line Item from the Order.", + "type": "string" + }, + "quantity": { + "description": "The quantity to return.", + "type": "integer" + } + } + } + }, + "return_shipping": { + "description": "If the Return is to be handled by the store operator the Customer can choose a Return Shipping Method. Alternatvely the Customer can handle the Return themselves.", + "type": "object", + "properties": { + "option_id": { + "type": "string", + "description": "The id of the Shipping Option to create the Shipping Method from." + } + } + } + } + } + } + } + }, + "tags": [ + "Return" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "return": { + "$ref": "#/components/schemas/return" } } } @@ -2033,6 +2033,43 @@ } } }, + "/swaps/{cart_id}": { + "get": { + "operationId": "GetSwapsSwapCartId", + "summary": "Retrieve Swap by Cart id", + "description": "Retrieves a Swap by the id of the Cart used to confirm the Swap.", + "parameters": [ + { + "in": "path", + "name": "cart_id", + "required": true, + "description": "The id of the Cart", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Swap" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "swap": { + "$ref": "#/components/schemas/swap" + } + } + } + } + } + } + } + } + }, "/variants/{variant_id}": { "get": { "operationId": "GetVariantsVariant", @@ -2468,10 +2505,6 @@ "type": "string", "format": "date-time" }, - "no_notification": { - "description": "Flag for describing whether or not notifications related to this should be send.", - "type": "boolean" - }, "metadata": { "type": "object" } @@ -2663,6 +2696,10 @@ "$ref": "#/components/schemas/product" } }, + "usage_limit": { + "description": "The maximum number of times that a discount can be used.", + "type": "integer" + }, "created_at": { "description": "The date with timezone at which the resource was created.", "type": "string", @@ -2734,14 +2771,6 @@ "$ref": "#/components/schemas/region" } }, - "usage_limit": { - "description": "The maximum number of times that a discount can be used.", - "type": "integer" - }, - "usage_count": { - "description": "The number of times a discount has been used.", - "type": "integer" - }, "created_at": { "description": "The date with timezone at which the resource was created.", "type": "string", @@ -2763,75 +2792,6 @@ } } }, - "draft-order": { - "title": "DraftOrder", - "description": "Represents a draft order", - "x-resourceId": "draft-order", - "properties": { - "id": { - "type": "string" - }, - "status": { - "type": "string", - "enum": [ - "open", - "completed" - ] - }, - "display_id": { - "type": "string" - }, - "cart_id": { - "type": "string" - }, - "cart": { - "anyOf": [ - { - "$ref": "#/components/schemas/cart" - } - ] - }, - "order_id": { - "type": "string" - }, - "order": { - "anyOf": [ - { - "$ref": "#/components/schemas/order" - } - ] - }, - "canceled_at": { - "type": "string", - "format": "date-time" - }, - "created_at": { - "type": "string", - "format": "date-time" - }, - "update_at": { - "type": "string", - "format": "date-time" - }, - "deleted_at": { - "type": "string", - "format": "date-time" - }, - "completed_at": { - "type": "string", - "format": "date-time" - }, - "no_notification_order": { - "type": "boolean" - }, - "metadata": { - "type": "object" - }, - "idempotency_key": { - "type": "string" - } - } - }, "fulfillment_item": { "title": "Fulfillment Item", "description": "Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item.", @@ -3585,13 +3545,6 @@ }, "gift_card_total": { "type": "integer" - }, - "paid_total": { - "type": "integer" - }, - "no_notification": { - "description": "Flag for describing whether or not notifications related to this should be send.", - "type": "boolean" } } }, @@ -4447,10 +4400,6 @@ "type": "string", "format": "date-time" }, - "no_notification": { - "description": "When set to true, no notification will be sent related to this return.", - "type": "boolean" - }, "metadata": { "description": "An optional key-value map with additional information.", "type": "object" @@ -4829,10 +4778,6 @@ "type": "string", "format": "date-time" }, - "no_notification": { - "description": "If set to true, no notification will be sent related to this swap", - "type": "boolean" - }, "metadata": { "description": "An optional key-value map with additional information.", "type": "object" diff --git a/docs/api/store-spec3.yaml b/docs/api/store-spec3.yaml index 3ac9dc6bd0..43e7a49d17 100644 --- a/docs/api/store-spec3.yaml +++ b/docs/api/store-spec3.yaml @@ -121,6 +121,539 @@ paths: properties: exists: type: boolean + '/carts/{id}/shipping-methods': + post: + operationId: PostCartsCartShippingMethod + description: Adds a Shipping Method to the Cart. + summary: Add a Shipping Method + tags: + - Cart + parameters: + - in: path + name: id + required: true + description: The cart id. + schema: + type: string + responses: + '200': + description: A successful response + content: + application/json: + schema: + properties: + cart: + $ref: '#/components/schemas/cart' + requestBody: + content: + application/json: + schema: + type: object + required: + - option_id + properties: + option_id: + type: string + description: id of the shipping option to create the method from + data: + type: object + description: >- + Used to hold any data that the shipping method may need to + process the fulfillment of the order. Look at the + documentation for your installed fulfillment providers to + find out what to send. + '/carts/{id}/complete-cart': + post: + summary: Complete a Cart + operationId: PostCartsCartComplete + description: >- + Completes a cart. The following steps will be performed. Payment + authorization is attempted and if more work is required, we simply + return the cart for further updates. If payment is authorized and order + is not yet created, we make sure to do so. The completion of a cart can + be performed idempotently with a provided header `Idempotency-Key`. If + not provided, we will generate one for the request. + parameters: + - in: path + name: id + required: true + description: The Cart id. + schema: + type: string + tags: + - Cart + responses: + '200': + description: >- + If a cart was successfully authorized, but requires further action + from the user the response body will contain the cart with an + updated payment session. If the Cart was successfully completed the + response body will contain the newly created Order. + content: + application/json: + schema: + oneOf: + - type: object + properties: + order: + $ref: '#/components/schemas/order' + - type: object + properties: + cart: + $ref: '#/components/schemas/cart' + /carts: + post: + summary: Create a Cart + operationId: PostCart + description: >- + Creates a Cart within the given region and with the initial items. If no + `region_id` is provided the cart will be associated with the first + Region available. If no items are provided the cart will be empty after + creation. If a user is logged in the cart's customer id and email will + be set. + requestBody: + content: + application/json: + schema: + properties: + region_id: + type: string + description: The id of the Region to create the Cart in. + country_code: + type: string + description: The 2 character ISO country code to create the Cart in. + items: + description: >- + An optional array of `variant_id`, `quantity` pairs to + generate Line Items from. + type: array + items: + properties: + variant_id: + description: >- + The id of the Product Variant to generate a Line Item + from. + type: string + quantity: + description: The quantity of the Product Variant to add + type: integer + context: + description: >- + An optional object to provide context to the Cart. The + `context` field is automatically populated with `ip` and + `user_agent` + type: object + tags: + - Cart + responses: + '200': + description: Successfully created a new Cart + content: + application/json: + schema: + properties: + cart: + $ref: '#/components/schemas/cart' + '/carts/{id}/line-items': + post: + operationId: PostCartsCartLineItems + summary: Add a Line Item + description: >- + Generates a Line Item with a given Product Variant and adds it to the + Cart + parameters: + - in: path + name: id + required: true + description: The id of the Cart to add the Line Item to. + schema: + type: string + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + cart: + $ref: '#/components/schemas/cart' + requestBody: + content: + application/json: + schema: + type: object + required: + - variant_id + - quantity + properties: + variant_id: + type: string + description: >- + The id of the Product Variant to generate the Line Item + from. + quantity: + type: integer + description: The quantity of the Product Variant to add to the Line Item. + metadata: + type: object + description: >- + An optional key-value map with additional details about the + Line Item. + '/carts/{id}/payment-sessions': + post: + operationId: PostCartsCartPaymentSessions + summary: Initialize Payment Sessions + description: >- + Creates Payment Sessions for each of the available Payment Providers in + the Cart's Region. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + cart: + $ref: '#/components/schemas/cart' + '/carts/{id}/discounts/{code}': + delete: + operationId: DeleteCartsCartDiscountsDiscount + description: Removes a Discount from a Cart. + summary: Remove Discount from Cart + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: code + required: true + description: The unique Discount code. + schema: + type: string + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + cart: + $ref: '#/components/schemas/cart' + '/carts/{id}/line-items/{line_id}': + delete: + operationId: DeleteCartsCartLineItemsItem + summary: Delete a Line Item + description: Removes a Line Item from a Cart. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: line_id + required: true + description: The id of the Line Item. + schema: + type: string + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + cart: + $ref: '#/components/schemas/cart' + post: + operationId: PostCartsCartLineItemsItem + summary: Update a Line Item + description: Updates a Line Item if the desired quantity can be fulfilled. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: line_id + required: true + description: The id of the Line Item. + schema: + type: string + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + cart: + $ref: '#/components/schemas/cart' + requestBody: + content: + application/json: + schema: + type: object + required: + - quantity + properties: + quantity: + type: integer + description: The quantity to set the Line Item to. + '/carts/{id}/payment-sessions/{provider_id}': + delete: + operationId: DeleteCartsCartPaymentSessionsSession + summary: Delete a Payment Session + description: >- + Deletes a Payment Session on a Cart. May be useful if a payment has + failed. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: provider_id + required: true + description: >- + The id of the Payment Provider used to create the Payment Session to + be deleted. + schema: + type: string + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + cart: + $ref: '#/components/schemas/cart' + post: + operationId: PostCartsCartPaymentSessionsSession + summary: Refresh a Payment Session + description: >- + Refreshes a Payment Session to ensure that it is in sync with the Cart - + this is usually not necessary. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + - in: path + name: provider_id + required: true + description: >- + The id of the Payment Provider that created the Payment Session to + be refreshed. + schema: + type: string + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + cart: + $ref: '#/components/schemas/cart' + '/carts/{id}': + get: + operationId: GetCartsCart + summary: Retrieve a Cart + description: Retrieves a Cart. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + cart: + $ref: '#/components/schemas/cart' + '/carts/{id}/payment-session': + post: + operationId: PostCartsCartPaymentSession + summary: Select a Payment Session + description: >- + Selects a Payment Session as the session intended to be used towards the + completion of the Cart. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + cart: + $ref: '#/components/schemas/cart' + requestBody: + content: + application/json: + schema: + type: object + required: + - provider_id + properties: + provider_id: + type: string + description: The id of the Payment Provider. + '/store/carts/{id}': + post: + operationId: PostCartsCart + summary: Update a Cart" + description: Updates a Cart. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + region_id: + type: string + description: The id of the Region to create the Cart in. + country_code: + type: string + description: The 2 character ISO country code to create the Cart in. + email: + type: string + description: An email to be used on the Cart. + billing_address: + description: The Address to be used for billing purposes. + anyOf: + - $ref: '#/components/schemas/address' + shipping_address: + description: The Address to be used for shipping. + anyOf: + - $ref: '#/components/schemas/address' + gift_cards: + description: An array of Gift Card codes to add to the Cart. + type: array + items: + properties: + code: + description: The code that a Gift Card is identified by. + type: string + discounts: + description: An array of Discount codes to add to the Cart. + type: array + items: + properties: + code: + description: The code that a Discount is identifed by. + type: string + customer_id: + description: The id of the Customer to associate the Cart with. + type: string + context: + description: An optional object to provide context to the Cart. + type: object + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + cart: + $ref: '#/components/schemas/cart' + '/carts/{id}/payment-session/update': + post: + operationId: PostCartsCartPaymentSessionUpdate + summary: Update a Payment Session + description: Updates a Payment Session with additional data. + parameters: + - in: path + name: id + required: true + description: The id of the Cart. + schema: + type: string + tags: + - Cart + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + cart: + $ref: '#/components/schemas/cart' + requestBody: + content: + application/json: + schema: + type: object + required: + - provider_id + - data + properties: + provider_id: + type: string + description: >- + The id of the Payment Provider responsible for the Payment + Session to update. + data: + type: object + description: The data to update the payment session with. '/customers/{id}/addresses': post: operationId: PostCustomersCustomerAddresses @@ -453,512 +986,6 @@ paths: password: type: string description: The new password to set for the Customer. - '/carts/{id}/shipping-methods': - post: - operationId: PostCartsCartShippingMethod - description: Adds a Shipping Method to the Cart. - summary: Add a Shipping Method - tags: - - Cart - parameters: - - in: path - name: id - required: true - description: The cart id. - schema: - type: string - responses: - '200': - description: A successful response - content: - application/json: - schema: - properties: - cart: - $ref: '#/components/schemas/cart' - requestBody: - content: - application/json: - schema: - type: object - required: - - option_id - properties: - option_id: - type: string - description: id of the shipping option to create the method from - data: - type: object - description: >- - Used to hold any data that the shipping method may need to - process the fulfillment of the order. Look at the - documentation for your installed fulfillment providers to - find out what to send. - '/carts/{id}/complete': - post: - summary: Complete a Cart - operationId: PostCartsCartComplete - description: >- - Completes a cart. The following steps will be performed. Payment - authorization is attempted and if more work is required, we simply - return the cart for further updates. If payment is authorized and order - is not yet created, we make sure to do so. The completion of a cart can - be performed idempotently with a provided header `Idempotency-Key`. If - not provided, we will generate one for the request. - parameters: - - in: path - name: id - required: true - description: The Cart id. - schema: - type: string - tags: - - Cart - responses: - '200': - description: >- - If a cart was successfully authorized, but requires further action - from the user the response body will contain the cart with an - updated payment session. If the Cart was successfully completed the - response body will contain the newly created Order. - content: - application/json: - schema: - oneOf: - - type: object - properties: - order: - $ref: '#/components/schemas/order' - - type: object - properties: - cart: - $ref: '#/components/schemas/cart' - /carts: - post: - summary: Create a Cart - operationId: PostCart - description: >- - Creates a Cart within the given region and with the initial items. If no - `region_id` is provided the cart will be associated with the first - Region available. If no items are provided the cart will be empty after - creation. If a user is logged in the cart's customer id and email will - be set. - requestBody: - content: - application/json: - schema: - properties: - region_id: - type: string - description: The id of the Region to create the Cart in. - country_code: - type: string - description: The 2 character ISO country code to create the Cart in. - items: - description: >- - An optional array of `variant_id`, `quantity` pairs to - generate Line Items from. - type: array - items: - properties: - variant_id: - description: >- - The id of the Product Variant to generate a Line Item - from. - type: string - quantity: - description: The quantity of the Product Variant to add - type: integer - context: - description: >- - An optional object to provide context to the Cart. The - `context` field is automatically populated with `ip` and - `user_agent` - type: object - tags: - - Cart - responses: - '200': - description: Successfully created a new Cart - content: - application/json: - schema: - properties: - cart: - $ref: '#/components/schemas/cart' - '/carts/{id}/line-items': - post: - operationId: PostCartsCartLineItems - summary: Add a Line Item - description: >- - Generates a Line Item with a given Product Variant and adds it to the - Cart - parameters: - - in: path - name: id - required: true - description: The id of the Cart to add the Line Item to. - schema: - type: string - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - cart: - $ref: '#/components/schemas/cart' - requestBody: - content: - application/json: - schema: - type: object - required: - - variant_id - - quantity - properties: - variant_id: - type: string - description: >- - The id of the Product Variant to generate the Line Item - from. - quantity: - type: integer - description: The quantity of the Product Variant to add to the Line Item. - metadata: - type: object - description: >- - An optional key-value map with additional details about the - Line Item. - '/carts/{id}/payment-sessions': - post: - operationId: PostCartsCartPaymentSessions - summary: Initialize Payment Sessions - description: >- - Creates Payment Sessions for each of the available Payment Providers in - the Cart's Region. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - cart: - $ref: '#/components/schemas/cart' - '/carts/{id}/discounts/{code}': - delete: - operationId: DeleteCartsCartDiscountsDiscount - description: Removes a Discount from a Cart. - summary: Remove Discount from Cart - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - - in: path - name: code - required: true - description: The unique Discount code. - schema: - type: string - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - cart: - $ref: '#/components/schemas/cart' - '/carts/{id}/line-items/{line_id}': - delete: - operationId: DeleteCartsCartLineItemsItem - summary: Delete a Line Item - description: Removes a Line Item from a Cart. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - - in: path - name: line_id - required: true - description: The id of the Line Item. - schema: - type: string - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - cart: - $ref: '#/components/schemas/cart' - post: - operationId: PostCartsCartLineItemsItem - summary: Update a Line Item - description: Updates a Line Item if the desired quantity can be fulfilled. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - - in: path - name: line_id - required: true - description: The id of the Line Item. - schema: - type: string - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - cart: - $ref: '#/components/schemas/cart' - requestBody: - content: - application/json: - schema: - type: object - required: - - quantity - properties: - quantity: - type: integer - description: The quantity to set the Line Item to. - '/carts/{id}/payment-sessions/{provider_id}': - delete: - operationId: DeleteCartsCartPaymentSessionsSession - summary: Delete a Payment Session - description: >- - Deletes a Payment Session on a Cart. May be useful if a payment has - failed. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - - in: path - name: provider_id - required: true - description: >- - The id of the Payment Provider used to create the Payment Session to - be deleted. - schema: - type: string - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - cart: - $ref: '#/components/schemas/cart' - post: - operationId: PostCartsCartPaymentSessionUpdate - summary: Update a Payment Session - description: Updates a Payment Session with additional data. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - - in: path - name: provider_id - required: true - description: The id of the payment provider. - schema: - type: string - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - cart: - $ref: '#/components/schemas/cart' - requestBody: - content: - application/json: - schema: - type: object - required: - - provider_id - - data - properties: - provider_id: - type: string - description: >- - The id of the Payment Provider responsible for the Payment - Session to update. - data: - type: object - description: The data to update the payment session with. - '/carts/{id}': - get: - operationId: GetCartsCart - summary: Retrieve a Cart - description: Retrieves a Cart. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - cart: - $ref: '#/components/schemas/cart' - '/carts/{id}/payment-session': - post: - operationId: PostCartsCartPaymentSession - summary: Select a Payment Session - description: >- - Selects a Payment Session as the session intended to be used towards the - completion of the Cart. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - cart: - $ref: '#/components/schemas/cart' - requestBody: - content: - application/json: - schema: - type: object - required: - - provider_id - properties: - provider_id: - type: string - description: The id of the Payment Provider. - '/store/carts/{id}': - post: - operationId: PostCartsCart - summary: Update a Cart" - description: Updates a Cart. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - region_id: - type: string - description: The id of the Region to create the Cart in. - country_code: - type: string - description: The 2 character ISO country code to create the Cart in. - email: - type: string - description: An email to be used on the Cart. - billing_address: - description: The Address to be used for billing purposes. - anyOf: - - $ref: '#/components/schemas/address' - shipping_address: - description: The Address to be used for shipping. - anyOf: - - $ref: '#/components/schemas/address' - gift_cards: - description: An array of Gift Card codes to add to the Cart. - type: array - items: - properties: - code: - description: The code that a Gift Card is identified by. - type: string - discounts: - description: An array of Discount codes to add to the Cart. - type: array - items: - properties: - code: - description: The code that a Discount is identifed by. - type: string - customer_id: - description: The id of the Customer to associate the Cart with. - type: string - context: - description: An optional object to provide context to the Cart. - type: object - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - cart: - $ref: '#/components/schemas/cart' '/gift-cards/{code}': get: operationId: GetGiftCardsCode @@ -990,106 +1017,6 @@ paths: description: The current balanace of the Gift Card region: $ref: '#/components/schemas/region' - '/products/{id}': - get: - operationId: GetProductsProduct - summary: Retrieves a Product - description: Retrieves a Product. - parameters: - - in: path - name: id - required: true - description: The id of the Product. - schema: - type: string - tags: - - Product - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - product: - $ref: '#/components/schemas/product' - /products: - get: - operationId: GetProducts - summary: List Products - description: Retrieves a list of Products. - tags: - - Product - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - count: - description: The total number of Products. - type: integer - offset: - description: The offset for pagination. - type: integer - limit: - description: 'The maxmimum number of Products to return,' - type: integer - products: - type: array - items: - $ref: '#/components/schemas/product' - '/regions/{id}': - get: - operationId: GetRegionsRegion - summary: Retrieves a Region - description: Retrieves a Region. - parameters: - - in: path - name: id - required: true - description: The id of the Region. - schema: - type: string - tags: - - Region - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - region: - $ref: '#/components/schemas/region' - /regions: - get: - operationId: GetRegions - summary: List Regions - description: Retrieves a list of Regions. - tags: - - Region - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - count: - description: The total number of regions. - type: integer - offset: - description: The offset for pagination. - type: integer - limit: - description: 'The maxmimum number of regions to return,' - type: integer - regions: - type: array - items: - $ref: '#/components/schemas/region' '/orders/cart/{cart_id}': get: operationId: GetOrdersOrderCartId @@ -1170,6 +1097,56 @@ paths: properties: order: $ref: '#/components/schemas/order' + '/products/{id}': + get: + operationId: GetProductsProduct + summary: Retrieves a Product + description: Retrieves a Product. + parameters: + - in: path + name: id + required: true + description: The id of the Product. + schema: + type: string + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + product: + $ref: '#/components/schemas/product' + /products: + get: + operationId: GetProducts + summary: List Products + description: Retrieves a list of Products. + tags: + - Product + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + count: + description: The total number of Products. + type: integer + offset: + description: The offset for pagination. + type: integer + limit: + description: 'The maxmimum number of Products to return,' + type: integer + products: + type: array + items: + $ref: '#/components/schemas/product' '/return-reasons/{id}': get: operationId: GetReturnReasonsReason @@ -1211,6 +1188,103 @@ paths: type: array items: $ref: '#/components/schemas/return_reason' + '/regions/{id}': + get: + operationId: GetRegionsRegion + summary: Retrieves a Region + description: Retrieves a Region. + parameters: + - in: path + name: id + required: true + description: The id of the Region. + schema: + type: string + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + region: + $ref: '#/components/schemas/region' + /regions: + get: + operationId: GetRegions + summary: List Regions + description: Retrieves a list of Regions. + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + count: + description: The total number of regions. + type: integer + offset: + description: The offset for pagination. + type: integer + limit: + description: 'The maxmimum number of regions to return,' + type: integer + regions: + type: array + items: + $ref: '#/components/schemas/region' + /returns: + post: + operationId: PostReturns + summary: Create Return + description: Creates a Return for an Order. + requestBody: + content: + application/json: + schema: + properties: + order_id: + type: string + description: The id of the Order to create the Return from. + items: + description: The items to include in the Return. + type: array + items: + properties: + item_id: + description: The id of the Line Item from the Order. + type: string + quantity: + description: The quantity to return. + type: integer + return_shipping: + description: >- + If the Return is to be handled by the store operator the + Customer can choose a Return Shipping Method. Alternatvely + the Customer can handle the Return themselves. + type: object + properties: + option_id: + type: string + description: >- + The id of the Shipping Option to create the Shipping + Method from. + tags: + - Return + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + return: + $ref: '#/components/schemas/return' /shipping-options: get: operationId: GetShippingOptions @@ -1272,44 +1346,20 @@ paths: type: array items: $ref: '#/components/schemas/shipping_option' - /returns: - post: - operationId: PostReturns - summary: Create Return - description: Creates a Return for an Order. - requestBody: - content: - application/json: - schema: - properties: - order_id: - type: string - description: The id of the Order to create the Return from. - items: - description: The items to include in the Return. - type: array - items: - properties: - item_id: - description: The id of the Line Item from the Order. - type: string - quantity: - description: The quantity to return. - type: integer - return_shipping: - description: >- - If the Return is to be handled by the store operator the - Customer can choose a Return Shipping Method. Alternatvely - the Customer can handle the Return themselves. - type: object - properties: - option_id: - type: string - description: >- - The id of the Shipping Option to create the Shipping - Method from. + '/swaps/{cart_id}': + get: + operationId: GetSwapsSwapCartId + summary: Retrieve Swap by Cart id + description: Retrieves a Swap by the id of the Cart used to confirm the Swap. + parameters: + - in: path + name: cart_id + required: true + description: The id of the Cart + schema: + type: string tags: - - Return + - Swap responses: '200': description: OK @@ -1317,8 +1367,8 @@ paths: application/json: schema: properties: - return: - $ref: '#/components/schemas/return' + swap: + $ref: '#/components/schemas/swap' '/variants/{variant_id}': get: operationId: GetVariantsVariant @@ -1366,29 +1416,6 @@ paths: type: array items: $ref: '#/components/schemas/product_variant' - '/swaps/{cart_id}': - get: - operationId: GetSwapsSwapCartId - summary: Retrieve Swap by Cart id - description: Retrieves a Swap by the id of the Cart used to confirm the Swap. - parameters: - - in: path - name: cart_id - required: true - description: The id of the Cart - schema: - type: string - tags: - - Swap - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - swap: - $ref: '#/components/schemas/swap' components: schemas: address: @@ -1655,11 +1682,6 @@ components: deleted_at: type: string format: date-time - no_notification: - description: >- - Flag for describing whether or not notifications related to this - should be send. - type: boolean metadata: type: object claim_tag: @@ -1807,6 +1829,9 @@ components: type: array items: $ref: '#/components/schemas/product' + usage_limit: + description: The maximum number of times that a discount can be used. + type: integer created_at: description: The date with timezone at which the resource was created. type: string @@ -1869,12 +1894,6 @@ components: type: array items: $ref: '#/components/schemas/region' - usage_limit: - description: The maximum number of times that a discount can be used. - type: integer - usage_count: - description: The number of times a discount has been used. - type: integer created_at: description: The date with timezone at which the resource was created. type: string @@ -1890,51 +1909,6 @@ components: metadata: description: An optional key-value map with additional information. type: object - draft-order: - title: DraftOrder - description: Represents a draft order - x-resourceId: draft-order - properties: - id: - type: string - status: - type: string - enum: - - open - - completed - display_id: - type: string - cart_id: - type: string - cart: - anyOf: - - $ref: '#/components/schemas/cart' - order_id: - type: string - order: - anyOf: - - $ref: '#/components/schemas/order' - canceled_at: - type: string - format: date-time - created_at: - type: string - format: date-time - update_at: - type: string - format: date-time - deleted_at: - type: string - format: date-time - completed_at: - type: string - format: date-time - no_notification_order: - type: boolean - metadata: - type: object - idempotency_key: - type: string fulfillment_item: title: Fulfillment Item description: >- @@ -2553,13 +2527,6 @@ components: type: integer gift_card_total: type: integer - paid_total: - type: integer - no_notification: - description: >- - Flag for describing whether or not notifications related to this - should be send. - type: boolean payment_provider: title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. @@ -3365,11 +3332,6 @@ components: description: The date with timezone at which the resource was last updated. type: string format: date-time - no_notification: - description: >- - When set to true, no notification will be sent related to this - return. - type: boolean metadata: description: An optional key-value map with additional information. type: object @@ -3730,9 +3692,6 @@ components: description: The date with timezone at which the resource was last updated. type: string format: date-time - no_notification: - description: 'If set to true, no notification will be sent related to this swap' - type: boolean metadata: description: An optional key-value map with additional information. type: object