diff --git a/docs/api/admin-spec3.json b/docs/api/admin-spec3.json index 9c76462bd2..af5df7beb5 100644 --- a/docs/api/admin-spec3.json +++ b/docs/api/admin-spec3.json @@ -63,6 +63,10 @@ { "name": "Product Variant", "x-resourceId": "product_variant" + }, + { + "name": "OAuth", + "x-resourceId": "OAuth" } ], "servers": [ @@ -71,14 +75,41 @@ } ], "paths": { - "/auth": { + "/apps": { "post": { - "operationId": "PostAuth", - "summary": "Authenticate a User", - "description": "Logs a User in and authorizes them to manage Store settings.", - "parameters": [], + "operationId": "PostApps", + "summary": "Generates a token for an application.", + "description": "Generates a token for an application.", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "application_name", + "state", + "code" + ], + "properties": { + "application_name": { + "type": "string", + "description": "Name of the application for the token to be generated for." + }, + "state": { + "type": "string", + "description": "State of the application." + }, + "code": { + "type": "string", + "description": "The code for the generated token." + } + } + } + } + } + }, "tags": [ - "Auth" + "Apps" ], "responses": { "200": { @@ -87,8 +118,61 @@ "application/json": { "schema": { "properties": { - "user": { - "$ref": "#/components/schemas/user" + "apps": { + "$ref": "#/components/schemas/OAuth" + } + } + } + } + } + } + } + }, + "get": { + "operationId": "GetApps", + "summary": "List applications", + "description": "Retrieve a list of applications.", + "x-authenticated": true, + "tags": [ + "Apps" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "collection": { + "$ref": "#/components/schemas/OAuth" + } + } + } + } + } + } + } + } + }, + "/customer-groups": { + "post": { + "operationId": "PostCustomerGroups", + "summary": "Create a CustomerGroup", + "description": "Creates a CustomerGroup.", + "x-authenticated": true, + "parameters": [], + "tags": [ + "CustomerGroup" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "customer_group": { + "$ref": "#/components/schemas/customer_group" } } } @@ -102,297 +186,16 @@ "schema": { "type": "object", "required": [ - "email", - "password" + "name" ], "properties": { - "email": { + "name": { "type": "string", - "description": "The User's email." - }, - "password": { - "type": "string", - "description": "The User's password." - } - } - } - } - } - } - }, - "get": { - "operationId": "GetAuth", - "summary": "Get Session", - "description": "Gets the currently logged in User.", - "tags": [ - "Auth" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "user": { - "$ref": "#/components/schemas/user" - } - } - } - } - } - } - } - } - }, - "/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": { - "email": { - "type": "string", - "description": "The Customer's email. Only providable if user not registered." - }, - "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", - "summary": "Create a Product Collection", - "description": "Creates a Product Collection.", - "requestBody": { - "content": { - "application/json": { - "schema": { - "required": [ - "title" - ], - "properties": { - "title": { - "type": "string", - "description": "The title to identify the Collection by." - }, - "handle": { - "type": "string", - "description": "An optional handle to be used in slugs, if none is provided we will kebab-case the title." + "description": "Name of the customer group" }, "metadata": { - "description": "An optional set of key-value pairs to hold additional information.", - "type": "object" - } - } - } - } - } - }, - "tags": [ - "Collection" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "collection": { - "$ref": "#/components/schemas/product_collection" - } - } - } - } - } - } - } - }, - "get": { - "operationId": "GetCollections", - "summary": "List Product Collections", - "description": "Retrieve a list of Product Collection.", - "tags": [ - "Collection" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "collection": { - "$ref": "#/components/schemas/product_collection" - } + "type": "object", + "description": "Metadata for the customer." } } } @@ -401,24 +204,25 @@ } } }, - "/collections/{id}": { + "/customer-groups/{id}": { "delete": { - "operationId": "DeleteCollectionsCollection", - "summary": "Delete a Product Collection", - "description": "Deletes a Product Collection.", + "operationId": "DeleteCustomerGroupsCustomerGroup", + "summary": "Delete a CustomerGroup", + "description": "Deletes a CustomerGroup.", + "x-authenticated": true, "parameters": [ { "in": "path", "name": "id", "required": true, - "description": "The id of the Collection.", + "description": "The id of the Customer Group", "schema": { "type": "string" } } ], "tags": [ - "Collection" + "CustomerGroup" ], "responses": { "200": { @@ -429,7 +233,7 @@ "properties": { "id": { "type": "string", - "description": "The id of the deleted Collection" + "description": "The id of the deleted customer group." }, "object": { "type": "string", @@ -445,23 +249,24 @@ } } }, - "get": { - "operationId": "GetCollectionsCollection", - "summary": "Retrieve a Product Collection", - "description": "Retrieves a Product Collection.", + "post": { + "operationId": "PostCustomerGroupsGroup", + "summary": "Update a CustomerGroup", + "description": "Update a CustomerGroup.", + "x-authenticated": true, "parameters": [ { "in": "path", "name": "id", "required": true, - "description": "The id of the Product Collection", + "description": "The id of the customer group.", "schema": { "type": "string" } } ], "tags": [ - "Collection" + "CustomerGroup" ], "responses": { "200": { @@ -470,55 +275,58 @@ "application/json": { "schema": { "properties": { - "collection": { - "$ref": "#/components/schemas/product_collection" + "customer_group": { + "$ref": "#/components/schemas/customer_group" } } } } } } - } - }, - "post": { - "operationId": "PostCollectionsCollection", - "summary": "Update a Product Collection", - "description": "Updates a Product Collection.", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Collection.", - "schema": { - "type": "string" - } - } - ], + }, "requestBody": { "content": { "application/json": { "schema": { + "type": "object", + "required": [ + "name" + ], "properties": { - "title": { + "name": { "type": "string", - "description": "The title to identify the Collection by." - }, - "handle": { - "type": "string", - "description": "An optional handle to be used in slugs, if none is provided we will kebab-case the title." + "description": "Name of the customer group" }, "metadata": { - "description": "An optional set of key-value pairs to hold additional information.", - "type": "object" + "type": "object", + "description": "Metadata for the customer." } } } } } - }, + } + } + }, + "/customer-group/{id}": { + "get": { + "operationId": "GetCustomerGroupsGroup", + "summary": "Retrieve a CustomerGroup", + "description": "Retrieves a Customer Group.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Customer Group.", + "schema": { + "type": "string" + } + } + ], "tags": [ - "Collection" + "CustomerGroup" ], "responses": { "200": { @@ -527,8 +335,8 @@ "application/json": { "schema": { "properties": { - "collection": { - "$ref": "#/components/schemas/product_collection" + "customer_group": { + "$ref": "#/components/schemas/customer_group" } } } @@ -543,6 +351,7 @@ "operationId": "PostDiscountsDiscountRegionsRegion", "summary": "Adds Region availability", "description": "Adds a Region to the list of Regions that a Discount can be used in.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -586,6 +395,7 @@ "delete": { "operationId": "DeleteDiscountsDiscountRegionsRegion", "summary": "Remove Region availability", + "x-authenticated": true, "description": "Removes a Region from the list of Regions that a Discount can be used in.", "parameters": [ { @@ -630,9 +440,55 @@ }, "/discounts/{id}/products/{product_id}": { "post": { + "operationId": "PostDiscountsDiscountProductsProduct", + "summary": "Adds Product availability", + "description": "Adds a Product to the list of Products that a Discount can be used for.", + "x-authenticated": true, + "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" + } + } + } + } + } + } + } + }, + "delete": { "operationId": "DeleteDiscountsDiscountProductsProduct", "summary": "Remove Product availability", "description": "Removes a Product from the list of Products that a Discount can be used for.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -678,11 +534,16 @@ "post": { "operationId": "PostDiscounts", "summary": "Creates a Discount", + "x-authenticated": true, "description": "Creates a Discount with a given set of rules that define how the Discount behaves.", "requestBody": { "content": { "application/json": { "schema": { + "required": [ + "code", + "rule" + ], "properties": { "code": { "type": "string", @@ -757,7 +618,58 @@ "get": { "operationId": "GetDiscounts", "summary": "List Discounts", + "x-authenticated": true, "description": "Retrieves a list of Discounts", + "parameters": [ + { + "in": "query", + "name": "q", + "description": "Search query applied on results.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "is_dynamic", + "description": "Return only dynamic discounts.", + "schema": { + "type": "boolean" + } + }, + { + "in": "query", + "name": "is_disabled", + "description": "Return only disabled discounts.", + "schema": { + "type": "boolean" + } + }, + { + "in": "query", + "name": "limit", + "description": "The number of items in the response", + "schema": { + "type": "number" + } + }, + { + "in": "query", + "name": "offset", + "description": "The offset of items in response", + "schema": { + "type": "number" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the results.", + "schema": { + "type": "string" + } + } + ], "tags": [ "Discount" ], @@ -784,6 +696,7 @@ "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.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -843,6 +756,7 @@ "operationId": "DeleteDiscountsDiscount", "summary": "Delete a Discount", "description": "Deletes a Discount.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -886,6 +800,7 @@ "operationId": "GetDiscountsDiscount", "summary": "Retrieve a Discount", "description": "Retrieves a Discount", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -921,6 +836,7 @@ "operationId": "PostDiscountsDiscount", "summary": "Update a Discount", "description": "Updates a Discount with a given set of rules that define how the Discount behaves.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -973,6 +889,10 @@ "items": { "type": "string" } + }, + "metadata": { + "description": "An object containing metadata of the discount", + "type": "object" } } } @@ -1005,6 +925,7 @@ "operationId": "DeleteDiscountsDiscountDynamicCodesCode", "summary": "Delete a dynamic code", "description": "Deletes a dynamic code from a Discount.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -1051,6 +972,7 @@ "operationId": "GetDiscountsDiscountCode", "summary": "Retrieve a Discount by code", "description": "Retrieves a Discount by its discount code", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -1083,15 +1005,469 @@ } } }, + "/collections/{id}/products/batch": { + "post": { + "operationId": "PostProductsToCollection", + "summary": "Updates products associated with a Product Collection", + "description": "Updates products associated with a Product Collection", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Collection.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "product_ids": { + "description": "An array of Product IDs to add to the Product Collection.", + "type": "array", + "items": { + "properties": { + "id": { + "description": "The ID of a Product to add to the Product Collection.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "tags": [ + "Collection" + ], + "responses": { + "200": { + "description": "OK" + } + } + }, + "delete": { + "operationId": "DeleteProductsFromCollection", + "summary": "Removes products associated with a Product Collection", + "description": "Removes products associated with a Product Collection", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Collection.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "product_ids": { + "description": "An array of Product IDs to remove from the Product Collection.", + "type": "array", + "items": { + "properties": { + "id": { + "description": "The ID of a Product to remove from the Product Collection.", + "type": "string" + } + } + } + } + } + } + } + } + }, + "tags": [ + "Collection" + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/collections": { + "post": { + "operationId": "PostCollections", + "summary": "Create a Product Collection", + "description": "Creates a Product Collection.", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "title" + ], + "properties": { + "title": { + "type": "string", + "description": "The title to identify the Collection by." + }, + "handle": { + "type": "string", + "description": "An optional handle to be used in slugs, if none is provided we will kebab-case the title." + }, + "metadata": { + "description": "An optional set of key-value pairs to hold additional information.", + "type": "object" + } + } + } + } + } + }, + "tags": [ + "Collection" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "collection": { + "$ref": "#/components/schemas/product_collection" + } + } + } + } + } + } + } + }, + "get": { + "operationId": "GetCollections", + "summary": "List Product Collections", + "description": "Retrieve a list of Product Collection.", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "limit", + "description": "The number of collections to return.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "offset", + "description": "The offset of collections to return.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "title", + "description": "The title of collections to return.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "handle", + "description": "The handle of collections to return.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "deleted_at", + "description": "Date comparison for when resulting collections was deleted, i.e. less than, greater than etc.", + "schema": { + "type": "object" + } + }, + { + "in": "query", + "name": "created_at", + "description": "Date comparison for when resulting collections was created, i.e. less than, greater than etc.", + "schema": { + "type": "object" + } + }, + { + "in": "query", + "name": "updated_at", + "description": "Date comparison for when resulting collections was updated, i.e. less than, greater than etc.", + "schema": { + "type": "object" + } + } + ], + "tags": [ + "Collection" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "collection": { + "$ref": "#/components/schemas/product_collection" + } + } + } + } + } + } + } + } + }, + "/collections/{id}": { + "delete": { + "operationId": "DeleteCollectionsCollection", + "summary": "Delete a Product Collection", + "description": "Deletes a Product Collection.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Collection.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Collection" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "id": { + "type": "string", + "description": "The id of the deleted Collection" + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted." + }, + "deleted": { + "type": "boolean" + } + } + } + } + } + } + } + }, + "get": { + "operationId": "GetCollectionsCollection", + "summary": "Retrieve a Product Collection", + "description": "Retrieves a Product Collection.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Product Collection", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Collection" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "collection": { + "$ref": "#/components/schemas/product_collection" + } + } + } + } + } + } + } + }, + "post": { + "operationId": "PostCollectionsCollection", + "summary": "Update a Product Collection", + "description": "Updates a Product Collection.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Collection.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "title": { + "type": "string", + "description": "The title to identify the Collection by." + }, + "handle": { + "type": "string", + "description": "An optional handle to be used in slugs, if none is provided we will kebab-case the title." + }, + "metadata": { + "description": "An optional set of key-value pairs to hold additional information.", + "type": "object" + } + } + } + } + } + }, + "tags": [ + "Collection" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "collection": { + "$ref": "#/components/schemas/product_collection" + } + } + } + } + } + } + } + } + }, + "/auth": { + "post": { + "operationId": "PostAuth", + "summary": "Authenticate a User", + "x-authenticated": false, + "description": "Logs a User in and authorizes them to manage Store settings.", + "parameters": [], + "tags": [ + "Auth" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "user": { + "$ref": "#/components/schemas/user" + } + } + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "email", + "password" + ], + "properties": { + "email": { + "type": "string", + "description": "The User's email." + }, + "password": { + "type": "string", + "description": "The User's password." + } + } + } + } + } + } + }, + "get": { + "operationId": "GetAuth", + "summary": "Get Session", + "x-authenticated": true, + "description": "Gets the currently logged in User.", + "tags": [ + "Auth" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "user": { + "$ref": "#/components/schemas/user" + } + } + } + } + } + } + } + } + }, "/draft-orders": { "post": { "operationId": "PostDraftOrders", "summary": "Create a Draft Order", "description": "Creates a Draft Order", + "x-authenticated": true, "requestBody": { "content": { "application/json": { "schema": { + "required": [ + "email", + "items", + "region_id", + "shipping_methods" + ], "properties": { "status": { "description": "The status of the draft order", @@ -1222,6 +1598,7 @@ "operationId": "GetDraftOrders", "summary": "List Draft Orders", "description": "Retrieves an list of Draft Orders", + "x-authenticated": true, "tags": [ "Draft Order" ], @@ -1248,10 +1625,25 @@ "operationId": "PostDraftOrdersDraftOrderLineItems", "summary": "Create a Line Item for Draft Order", "description": "Creates a Line Item for the Draft Order", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Draft Order.", + "schema": { + "type": "string" + } + } + ], "requestBody": { "content": { "application/json": { "schema": { + "required": [ + "quantity" + ], "properties": { "variant_id": { "description": "The id of the Product Variant to generate the Line Item from.", @@ -1304,6 +1696,7 @@ "operationId": "DeleteDraftOrdersDraftOrder", "summary": "Delete a Draft Order", "description": "Deletes a Draft Order", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -1347,6 +1740,7 @@ "operationId": "GetDraftOrdersDraftOrder", "summary": "Retrieve a Draft Order", "description": "Retrieves a Draft Order.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -1384,6 +1778,7 @@ "operationId": "DeleteDraftOrdersDraftOrderLineItemsItem", "summary": "Delete a Line Item", "description": "Removes a Line Item from a Draft Order.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -1428,6 +1823,27 @@ "operationId": "PostDraftOrdersDraftOrderLineItemsItem", "summary": "Update a Line Item for a Draft Order", "description": "Updates a Line Item for a Draft Order", + "x-authenticated": true, + "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 Line Item.", + "schema": { + "type": "string" + } + } + ], "requestBody": { "content": { "application/json": { @@ -1480,6 +1896,7 @@ "summary": "Registers a payment for a Draft Order", "operationId": "PostDraftOrdersDraftOrderRegisterPayment", "description": "Registers a payment for a Draft Order.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -1517,6 +1934,7 @@ "operationId": "PostDraftOrdersDraftOrder", "summary": "Update a Draft Order\"", "description": "Updates a Draft Order.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -1603,11 +2021,236 @@ } } }, + "/customers": { + "post": { + "operationId": "PostCustomers", + "summary": "Create a Customer", + "description": "Creates a Customer.", + "x-authenticated": true, + "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." + }, + "metadata": { + "type": "object", + "description": "Metadata for the customer." + } + } + } + } + } + } + }, + "get": { + "operationId": "GetCustomers", + "summary": "List Customers", + "description": "Retrieves a list of Customers.", + "x-authenticated": true, + "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.", + "x-authenticated": true, + "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.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Customer.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "email": { + "type": "string", + "description": "The Customer's email. Only providable if user not registered." + }, + "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." + }, + "password": { + "type": "string", + "description": "The Customer's password." + }, + "groups": { + "type": "array", + "items": { + "required": [ + "id" + ], + "properties": { + "id": { + "description": "The id of a customer group", + "type": "string" + } + } + }, + "description": "A list of customer groups to which the customer belongs." + }, + "metadata": { + "type": "object", + "description": "Metadata for the customer." + } + } + } + } + } + }, + "tags": [ + "Customer" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "customer": { + "$ref": "#/components/schemas/customer" + } + } + } + } + } + } + } + } + }, "/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.", + "x-authenticated": true, "requestBody": { "content": { "application/json": { @@ -1666,6 +2309,7 @@ "operationId": "GetGiftCards", "summary": "List Gift Cards", "description": "Retrieves a list of Gift Cards.", + "x-authenticated": true, "tags": [ "Gift Card" ], @@ -1695,6 +2339,7 @@ "operationId": "DeleteGiftCardsGiftCard", "summary": "Delete a Gift Card", "description": "Deletes a Gift Card", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -1738,6 +2383,7 @@ "operationId": "GetGiftCardsGiftCard", "summary": "Retrieve a Gift Card", "description": "Retrieves a Gift Card.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -1773,6 +2419,7 @@ "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.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -1839,11 +2486,188 @@ } } }, + "/invites/accept": { + "post": { + "operationId": "PostInvitesInviteAccept", + "summary": "Accept an Invite", + "description": "Accepts an Invite and creates a corresponding user", + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "token", + "user" + ], + "properties": { + "token": { + "description": "The invite token provided by the admin.", + "type": "string" + }, + "user": { + "description": "The User to create.", + "type": "object", + "required": [ + "first_name", + "last_name", + "password" + ], + "properties": { + "first_name": { + "type": "string", + "description": "the first name of the User" + }, + "last_name": { + "type": "string", + "description": "the last name of the User" + }, + "password": { + "description": "The desired password for the User", + "type": "string" + } + } + } + } + } + } + } + }, + "tags": [ + "Invites" + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/invites": { + "post": { + "operationId": "PostInvites", + "summary": "Create an Invite", + "description": "Creates an Invite and triggers an 'invite' created event", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "user", + "role" + ], + "properties": { + "user": { + "description": "The email for the user to be created.", + "type": "string" + }, + "role": { + "description": "The role of the user to be created.", + "type": "string" + } + } + } + } + } + }, + "tags": [ + "Invites" + ], + "responses": { + "200": { + "description": "OK" + } + } + }, + "get": { + "operationId": "GetInvites", + "summary": "Lists all Invites", + "description": "Lists all Invites", + "x-authenticated": true, + "tags": [ + "Invites" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "invites": { + "type": "array", + "items": { + "$ref": "#/components/schemas/invite" + } + } + } + } + } + } + } + } + } + }, + "/invites/{invite_id}": { + "delete": { + "operationId": "DeleteInvitesInvite", + "summary": "Create an Invite", + "description": "Creates an Invite and triggers an 'invite' created event", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "invite_id", + "required": true, + "description": "The id of the Invite", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Invites" + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/invites/{invite_id}/resend": { + "post": { + "operationId": "PostInvitesInviteResend", + "summary": "Resend an Invite", + "description": "Resends an Invite by triggering the 'invite' created event again", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "invite_id", + "required": true, + "description": "The id of the Invite", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Invites" + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, "/notes": { "post": { "operationId": "PostNotes", "summary": "Creates a Note", "description": "Creates a Note which can be associated with any resource as required.", + "x-authenticated": true, "requestBody": { "content": { "application/json": { @@ -1889,7 +2713,40 @@ "get": { "operationId": "GetNotes", "summary": "List Notes", + "x-authenticated": true, "description": "Retrieves a list of notes", + "parameters": [ + { + "in": "path", + "name": "limit", + "required": true, + "description": "The number of notes to get", + "schema": { + "type": "number", + "default": "" + } + }, + { + "in": "path", + "name": "offset", + "required": true, + "description": "The offset at which to get notes", + "schema": { + "type": "number", + "default": "" + } + }, + { + "in": "path", + "name": "resource_id", + "required": true, + "description": "The id which the notes belongs to", + "schema": { + "type": "string", + "default": "" + } + } + ], "tags": [ "Note" ], @@ -1919,6 +2776,7 @@ "operationId": "DeleteNotesNote", "summary": "Deletes a Note", "description": "Deletes a Note.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -1956,9 +2814,10 @@ } }, "get": { - "operationId": "GetNoteNote", + "operationId": "GetNotesNote", "summary": "Get Note", "description": "Retrieves a single note using its id", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -1993,6 +2852,7 @@ "post": { "operationId": "PostNotesNote", "summary": "Updates a Note", + "x-authenticated": true, "description": "Updates a Note associated with some resource", "parameters": [ { @@ -2009,6 +2869,9 @@ "content": { "application/json": { "schema": { + "required": [ + "value" + ], "properties": { "value": { "type": "string", @@ -2045,6 +2908,79 @@ "operationId": "GetNotifications", "summary": "List Notifications", "description": "Retrieves a list of Notifications.", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "offset", + "description": "The number of notifications to skip before starting to collect the notifications set", + "schema": { + "type": "integer", + "default": 0 + } + }, + { + "in": "query", + "name": "limit", + "description": "The number of notifications to return", + "schema": { + "type": "integer", + "default": 50 + } + }, + { + "in": "query", + "name": "fields", + "description": "The fields to include in the result set", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "The fields to populate", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "event_name", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "resource_type", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "resource_id", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "to", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "include_resends", + "description": "Whether the result set should include resent notifications or not", + "schema": { + "type": "boolean" + } + } + ], "tags": [ "Notification" ], @@ -2074,6 +3010,7 @@ "operationId": "PostNotificationsNotificationResend", "summary": "Resend Notification", "description": "Resends a previously sent notifications, with the same data but optionally to a different address", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -2085,6 +3022,20 @@ } } ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "to": { + "description": "The address or user identifier that the Notification was sent to", + "type": "string" + } + } + } + } + } + }, "tags": [ "Notification" ], @@ -2106,11 +3057,89 @@ } } }, + "/product-tags": { + "get": { + "operationId": "GetProductTags", + "summary": "List Product Tags", + "description": "Retrieve a list of Product Tags.", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "limit", + "description": "The number of tags to return.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "offset", + "description": "The offset of tags to return.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "value", + "description": "The value of tags to return.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "id", + "description": "The id of tags to return.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "created_at", + "description": "Date comparison for when resulting tas was created, i.e. less than, greater than etc.", + "schema": { + "type": "object" + } + }, + { + "in": "query", + "name": "updated_at", + "description": "Date comparison for when resulting tas was updated, i.e. less than, greater than etc.", + "schema": { + "type": "object" + } + } + ], + "tags": [ + "Product Tag" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "tags": { + "$ref": "#/components/schemas/product_tag" + } + } + } + } + } + } + } + } + }, "/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.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -2171,11 +3200,50 @@ } } }, + "/orders/{id}/archive": { + "post": { + "operationId": "PostOrdersOrderArchive", + "summary": "Archive order", + "description": "Archives the order with the given id.", + "x-authenticated": true, + "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}/cancel": { "post": { "operationId": "PostOrdersClaimCancel", "summary": "Cancels a Claim", "description": "Cancels a Claim", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -2222,6 +3290,7 @@ "operationId": "PostOrdersClaimFulfillmentsCancel", "summary": "Cancels a fulfilmment related to a Claim", "description": "Registers a Fulfillment as canceled.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -2277,6 +3346,7 @@ "operationId": "PostOrdersSwapFulfillmentsCancel", "summary": "Cancels a fulfilmment related to a Swap", "description": "Registers a Fulfillment as canceled.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -2332,6 +3402,7 @@ "operationId": "PostOrdersOrderFulfillmentsCancel", "summary": "Cancels a fulfilmment", "description": "Registers a Fulfillment as canceled.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -2378,6 +3449,7 @@ "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.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -2415,6 +3487,7 @@ "operationId": "PostOrdersSwapCancel", "summary": "Cancels a Swap", "description": "Cancels a Swap", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -2461,6 +3534,45 @@ "operationId": "PostOrdersOrderCapture", "summary": "Capture an Order", "description": "Captures all the Payments associated with an Order.", + "x-authenticated": true, + "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}/complete": { + "post": { + "operationId": "PostOrdersOrderComplete", + "summary": "Complete an Order", + "description": "Completes an Order", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -2498,6 +3610,7 @@ "operationId": "PostOrdersOrderClaimsClaimShipments", "summary": "Create Claim Shipment", "description": "Registers a Claim Fulfillment as shipped.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -2522,6 +3635,9 @@ "content": { "application/json": { "schema": { + "required": [ + "fulfillment_id" + ], "properties": { "fulfillment_id": { "description": "The id of the Fulfillment.", @@ -2565,6 +3681,7 @@ "operationId": "PostOrdersOrderClaims", "summary": "Create a Claim", "description": "Creates a Claim.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -2580,6 +3697,10 @@ "content": { "application/json": { "schema": { + "required": [ + "type", + "claim_items" + ], "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.", @@ -2729,6 +3850,7 @@ "operationId": "PostOrdersOrderFulfillments", "summary": "Create a Fulfillment", "description": "Creates a Fulfillment of an Order - will notify Fulfillment Providers to prepare a shipment.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -2744,6 +3866,9 @@ "content": { "application/json": { "schema": { + "required": [ + "items" + ], "properties": { "items": { "description": "The Line Items to include in the Fulfillment.", @@ -2795,11 +3920,347 @@ } } }, + "/orders": { + "post": { + "operationId": "PostOrders", + "summary": "Create an order", + "description": "Creates and order", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "email", + "billing_address", + "shipping_address", + "items", + "region", + "customer_id", + "payment_method", + "shipping_method" + ], + "properties": { + "status": { + "description": "status of the order", + "type": "string" + }, + "email": { + "description": "the email for the order", + "type": "string" + }, + "billing_address": { + "description": "Billing address", + "anyOf": [ + { + "$ref": "#/components/schemas/address" + } + ] + }, + "shipping_address": { + "description": "Shipping address", + "anyOf": [ + { + "$ref": "#/components/schemas/address" + } + ] + }, + "items": { + "description": "The Line Items for the order", + "type": "array", + "items": { + "$ref": "#/components/schemas/line_item" + } + }, + "region": { + "description": "Region where the order belongs", + "type": "string" + }, + "discounts": { + "description": "Discounts applied to the order", + "type": "array", + "items": { + "$ref": "#/components/schemas/line_item" + } + }, + "customer_id": { + "description": "id of the customer", + "type": "string" + }, + "payment_method": { + "description": "payment method chosen for the order", + "type": "object", + "required": [ + "provider_id" + ], + "properties": { + "provider_id": { + "type": "string", + "description": "id of the payment provider" + }, + "data": { + "description": "Data relevant for the given payment method", + "type": "object" + } + } + }, + "shipping_method": { + "description": "The Shipping Method used for shipping the order.", + "type": "object", + "required": [ + "provider_id", + "profile_id", + "price" + ], + "properties": { + "provider_id": { + "type": "string", + "description": "The id of the shipping provider." + }, + "profile_id": { + "type": "string", + "description": "The id of the shipping profile." + }, + "price": { + "type": "integer", + "description": "The price of the shipping." + }, + "data": { + "type": "object", + "description": "Data relevant to the specific shipping method." + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/line_item" + }, + "description": "Items to ship" + } + } + }, + "no_notification": { + "description": "A flag to indicate if no notifications should be emitted related to the updated order.", + "type": "boolean" + } + } + } + } + } + }, + "tags": [ + "Order" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "order": { + "$ref": "#/components/schemas/order" + } + } + } + } + } + } + } + }, + "get": { + "operationId": "GetOrders", + "summary": "List Orders", + "description": "Retrieves a list of Orders", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "q", + "description": "Query used for searching orders.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "id", + "description": "Id of the order to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "status", + "style": "form", + "explode": false, + "description": "Status to search for", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "fulfillment_status", + "description": "Fulfillment status to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "payment_status", + "description": "Payment status to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "display_id", + "description": "Display id to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "cart_id", + "description": "to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "customer_id", + "description": "to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "email", + "description": "to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "region_id", + "description": "to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "currency_code", + "description": "to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "tax_rate", + "description": "to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "cancelled_at", + "description": "Date comparison for when resulting orders was cancelled, i.e. less than, greater than etc.", + "schema": { + "type": "object" + } + }, + { + "in": "query", + "name": "created_at", + "description": "Date comparison for when resulting orders was created, i.e. less than, greater than etc.", + "schema": { + "type": "object" + } + }, + { + "in": "query", + "name": "updated_at", + "description": "Date comparison for when resulting orders was updated, i.e. less than, greater than etc.", + "schema": { + "type": "object" + } + }, + { + "in": "query", + "name": "offset", + "description": "How many orders to skip in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of orders returned.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which fields should be expanded in each order of the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated) Which fields should be included in each order of the result.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Order" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "orders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/order" + } + } + } + } + } + } + } + } + } + }, "/orders/{id}/shipment": { "post": { "operationId": "PostOrdersOrderShipment", "summary": "Create a Shipment", "description": "Registers a Fulfillment as shipped.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -2815,6 +4276,9 @@ "content": { "application/json": { "schema": { + "required": [ + "fulfillment_id" + ], "properties": { "fulfillment_id": { "description": "The id of the Fulfillment.", @@ -2862,6 +4326,7 @@ "operationId": "PostOrdersOrderSwapsSwapShipments", "summary": "Create Swap Shipment", "description": "Registers a Swap Fulfillment as shipped.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -2886,6 +4351,9 @@ "content": { "application/json": { "schema": { + "required": [ + "fulfillment_id" + ], "properties": { "fulfillment_id": { "description": "The id of the Fulfillment.", @@ -2933,6 +4401,7 @@ "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.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -2948,11 +4417,18 @@ "content": { "application/json": { "schema": { + "required": [ + "return_items" + ], "properties": { "return_items": { "description": "The Line Items to return as part of the Swap.", "type": "array", "items": { + "required": [ + "item_id", + "quantity" + ], "properties": { "item_id": { "description": "The id of the Line Item that will be claimed.", @@ -2983,6 +4459,10 @@ "description": "The new items to send to the Customer.", "type": "array", "items": { + "required": [ + "variant_id", + "quantity" + ], "properties": { "variant_id": { "description": "The id of the Product Variant to ship.", @@ -2999,6 +4479,10 @@ "description": "The custom shipping options to potentially create a Shipping Method from.", "type": "array", "items": { + "required": [ + "option_id", + "price" + ], "properties": { "option_id": { "description": "The id of the Shipping Option to override with a custom price.", @@ -3050,6 +4534,7 @@ "operationId": "DeleteOrdersOrderMetadataKey", "summary": "Delete Metadata", "description": "Deletes a metadata key.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -3096,6 +4581,7 @@ "operationId": "PostOrdersOrderClaimsClaimFulfillments", "summary": "Create a Claim Fulfillment", "description": "Creates a Fulfillment for a Claim.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -3160,6 +4646,7 @@ "operationId": "PostOrdersOrderSwapsSwapFulfillments", "summary": "Create a Swap Fulfillment", "description": "Creates a Fulfillment for a Swap.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -3224,6 +4711,7 @@ "operationId": "GetOrdersOrder", "summary": "Retrieve an Order", "description": "Retrieves an Order", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -3254,42 +4742,12 @@ } } } - } - }, - "/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.", + "operationId": "PostOrdersOrder", + "summary": "Update an order", + "description": "Updates and order", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -3299,61 +4757,6 @@ "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}/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": { @@ -3361,21 +4764,94 @@ "application/json": { "schema": { "properties": { + "email": { + "description": "the email for the order", + "type": "string" + }, + "billing_address": { + "description": "Billing address", + "anyOf": [ + { + "$ref": "#/components/schemas/address" + } + ] + }, + "shipping_address": { + "description": "Shipping address", + "anyOf": [ + { + "$ref": "#/components/schemas/address" + } + ] + }, "items": { - "description": "The Line Items that have been received.", + "description": "The Line Items for the order", "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" - } + "$ref": "#/components/schemas/line_item" + } + }, + "region": { + "description": "Region where the order belongs", + "type": "string" + }, + "discounts": { + "description": "Discounts applied to the order", + "type": "array", + "items": { + "$ref": "#/components/schemas/line_item" + } + }, + "customer_id": { + "description": "id of the customer", + "type": "string" + }, + "payment_method": { + "description": "payment method chosen for the order", + "type": "object", + "properties": { + "provider_id": { + "type": "string", + "description": "id of the payment provider" + }, + "data": { + "description": "Data relevant for the given payment method", + "type": "object" } } + }, + "shipping_method": { + "description": "The Shipping Method used for shipping the order.", + "type": "object", + "properties": { + "provider_id": { + "type": "string", + "description": "The id of the shipping provider." + }, + "profile_id": { + "type": "string", + "description": "The id of the shipping profile." + }, + "price": { + "type": "integer", + "description": "The price of the shipping." + }, + "data": { + "type": "object", + "description": "Data relevant to the specific shipping method." + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/line_item" + }, + "description": "Items to ship" + } + } + }, + "no_notification": { + "description": "A flag to indicate if no notifications should be emitted related to the updated order.", + "type": "boolean" } } } @@ -3403,11 +4879,59 @@ } } }, + "/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.", + "x-authenticated": true, + "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}/refunds": { "post": { "operationId": "PostOrdersOrderRefunds", "summary": "Create a Refund", "description": "Issues a Refund.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -3475,6 +4999,7 @@ "operationId": "PostOrdersOrderReturns", "summary": "Request a Return", "description": "Requests a Return. If applicable a return label will be created and other plugins notified.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -3490,6 +5015,9 @@ "content": { "application/json": { "schema": { + "required": [ + "items" + ], "properties": { "items": { "description": "The Line Items that will be returned.", @@ -3572,6 +5100,7 @@ "operationId": "PostOrdersOrderClaimsClaim", "summary": "Update a Claim", "description": "Updates a Claim.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -3698,10 +5227,88 @@ } } }, + "/product-types": { + "get": { + "operationId": "GetProductTypes", + "summary": "List Product Types", + "description": "Retrieve a list of Product Types.", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "limit", + "description": "The number of types to return.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "offset", + "description": "The offset of types to return.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "value", + "description": "The value of types to return.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "id", + "description": "The id of types to return.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "created_at", + "description": "Date comparison for when resulting tas was created, i.e. less than, greater than etc.", + "schema": { + "type": "object" + } + }, + { + "in": "query", + "name": "updated_at", + "description": "Date comparison for when resulting tas was updated, i.e. less than, greater than etc.", + "schema": { + "type": "object" + } + } + ], + "tags": [ + "Product Tag" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "types": { + "$ref": "#/components/schemas/product_tag" + } + } + } + } + } + } + } + } + }, "/products/{id}/options": { "post": { "operationId": "PostProductsProductOptions", "summary": "Add an Option", + "x-authenticated": true, "description": "Adds a Product Option to a Product", "parameters": [ { @@ -3718,6 +5325,9 @@ "content": { "application/json": { "schema": { + "required": [ + "title" + ], "properties": { "title": { "description": "The title the Product Option will be identified by i.e. \"Size\"", @@ -3753,11 +5363,17 @@ "post": { "operationId": "PostProducts", "summary": "Create a Product", + "x-authenticated": true, "description": "Creates a Product", "requestBody": { "content": { "application/json": { "schema": { + "required": [ + "title", + "subtitle", + "description" + ], "properties": { "title": { "description": "The title of the Product", @@ -4007,6 +5623,168 @@ "operationId": "GetProducts", "summary": "List Product", "description": "Retrieves a list of Product", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "q", + "description": "Query used for searching products.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "id", + "description": "Id of the product to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "status", + "style": "form", + "explode": false, + "description": "Status to search for", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "collection_id", + "style": "form", + "explode": false, + "description": "Collection ids to search for.", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "tags", + "style": "form", + "explode": false, + "description": "Tags to search for", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "title", + "description": "to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "description", + "description": "to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "handle", + "description": "to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "is_giftcard", + "description": "Search for giftcards using is_giftcard=true.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "type", + "description": "to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "order", + "description": "to retrieve products in.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "deleted_at", + "description": "Date comparison for when resulting products was deleted, i.e. less than, greater than etc.", + "schema": { + "type": "object" + } + }, + { + "in": "query", + "name": "created_at", + "description": "Date comparison for when resulting products was created, i.e. less than, greater than etc.", + "schema": { + "type": "object" + } + }, + { + "in": "query", + "name": "updated_at", + "description": "Date comparison for when resulting products was updated, i.e. less than, greater than etc.", + "schema": { + "type": "object" + } + }, + { + "in": "query", + "name": "offset", + "description": "How many products to skip in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of products returned.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which fields should be expanded in each product of the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated) Which fields should be included in each product of the result.", + "schema": { + "type": "string" + } + } + ], "tags": [ "Product" ], @@ -4048,6 +5826,7 @@ "operationId": "PostProductsProductVariants", "summary": "Create a Product Variant", "description": "Creates a Product Variant. Each Product Variant must have a unique combination of Product Option Values.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -4063,6 +5842,11 @@ "content": { "application/json": { "schema": { + "required": [ + "title", + "prices", + "options" + ], "properties": { "title": { "description": "The title to identify the Product Variant by.", @@ -4199,6 +5983,7 @@ "operationId": "GetProductsProductVariants", "summary": "List a Product's Product Variants", "description": "Retrieves a list of the Product Variants associated with a Product.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -4239,6 +6024,7 @@ "operationId": "DeleteProductsProductOptionsOption", "summary": "Delete a Product Option", "description": "Deletes a Product Option. Before a Product Option can be deleted all Option Values for the Product Option must be the same. You may, for example, have to delete some of your variants prior to deleting the Product Option", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -4294,6 +6080,7 @@ "operationId": "PostProductsProductOptionsOption", "summary": "Update a Product Option.", "description": "Updates a Product Option", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -4318,6 +6105,9 @@ "content": { "application/json": { "schema": { + "required": [ + "title" + ], "properties": { "title": { "description": "The title of the Product Option", @@ -4354,6 +6144,7 @@ "operationId": "DeleteProductsProduct", "summary": "Delete a Product", "description": "Deletes a Product and it's associated Product Variants.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -4397,6 +6188,7 @@ "operationId": "GetProductsProduct", "summary": "Retrieve a Product", "description": "Retrieves a Product.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -4432,6 +6224,7 @@ "operationId": "PostProductsProduct", "summary": "Update a Product", "description": "Updates a Product", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -4698,6 +6491,7 @@ "operationId": "DeleteProductsProductVariantsVariant", "summary": "Delete a Product Variant", "description": "Deletes a Product Variant.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -4750,6 +6544,7 @@ "operationId": "PostProductsProductVariantsVariant", "summary": "Update a Product Variant", "description": "Update a Product Variant.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -4912,6 +6707,7 @@ "operationId": "GetProductsTypes", "summary": "List Product Types", "description": "Retrieves a list of Product Types.", + "x-authenticated": true, "tags": [ "Product" ], @@ -4936,11 +6732,72 @@ } } }, + "/products/{id}/metadata": { + "post": { + "operationId": "PostProductsProductMetadata", + "summary": "Set Product metadata", + "description": "Set metadata key/value pair for Product", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Product.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "key", + "value" + ], + "properties": { + "key": { + "description": "The metadata key", + "type": "string" + }, + "value": { + "description": "The metadata value", + "type": "string" + } + } + } + } + } + }, + "tags": [ + "Product" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "product": { + "$ref": "#/components/schemas/product" + } + } + } + } + } + } + } + } + }, "/regions/{id}/countries": { "post": { "operationId": "PostRegionsRegionCountries", "summary": "Add Country", "description": "Adds a Country to the list of Countries in a Region", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -4956,6 +6813,9 @@ "content": { "application/json": { "schema": { + "required": [ + "country_code" + ], "properties": { "country_code": { "description": "The 2 character ISO code for the Country.", @@ -4992,6 +6852,7 @@ "operationId": "PostRegionsRegionFulfillmentProviders", "summary": "Add Fulfillment Provider", "description": "Adds a Fulfillment Provider to a Region", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -5007,6 +6868,9 @@ "content": { "application/json": { "schema": { + "required": [ + "provider_id" + ], "properties": { "provider_id": { "description": "The id of the Fulfillment Provider to add.", @@ -5043,6 +6907,7 @@ "operationId": "PostRegionsRegionPaymentProviders", "summary": "Add Payment Provider", "description": "Adds a Payment Provider to a Region", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -5058,6 +6923,9 @@ "content": { "application/json": { "schema": { + "required": [ + "provider_id" + ], "properties": { "provider_id": { "description": "The id of the Payment Provider to add.", @@ -5094,10 +6962,16 @@ "operationId": "PostRegions", "summary": "Create a Region", "description": "Creates a Region", + "x-authenticated": true, "requestBody": { "content": { "application/json": { "schema": { + "required": [ + "name", + "currency_code", + "tax_rate" + ], "properties": { "name": { "description": "The name of the Region", @@ -5165,6 +7039,54 @@ "operationId": "GetRegions", "summary": "List Regions", "description": "Retrieves a list of Regions.", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + }, + "required": false, + "description": "limit the number of regions in response" + }, + { + "in": "query", + "name": "offset", + "schema": { + "type": "integer" + }, + "required": false, + "description": "Offset of regions in response (used for pagination)" + }, + { + "in": "query", + "name": "created_at", + "schema": { + "type": "object" + }, + "required": false, + "description": "Date comparison for when resulting region was created, i.e. less than, greater than etc." + }, + { + "in": "query", + "name": "updated_at", + "schema": { + "type": "object" + }, + "required": false, + "description": "Date comparison for when resulting region was updated, i.e. less than, greater than etc." + }, + { + "in": "query", + "name": "deleted_at", + "schema": { + "type": "object" + }, + "required": false, + "description": "Date comparison for when resulting region was deleted, i.e. less than, greater than etc." + } + ], "tags": [ "Region" ], @@ -5194,6 +7116,7 @@ "operationId": "DeleteRegionsRegionMetadataKey", "summary": "Delete Metadata", "description": "Deletes a metadata key.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -5240,6 +7163,7 @@ "operationId": "DeleteRegionsRegion", "summary": "Delete a Region", "description": "Deletes a Region.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -5283,6 +7207,7 @@ "operationId": "GetRegionsRegion", "summary": "Retrieve a Region", "description": "Retrieves a Region.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -5318,6 +7243,7 @@ "operationId": "PostRegionsRegion", "summary": "Update a Region", "description": "Updates a Region", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -5342,6 +7268,18 @@ "description": "The 3 character ISO currency code to use for the Region.", "type": "string" }, + "automatic_taxes": { + "description": "If true Medusa will automatically calculate taxes for carts in this region. If false you have to manually call POST /carts/:id/taxes.", + "type": "boolean" + }, + "gift_cards_taxable": { + "description": "Whether gift cards in this region should be applied sales tax when purchasing a gift card", + "type": "boolean" + }, + "tax_provider_id": { + "description": "The id of the tax provider to use; if null the system tax provider is used", + "type": "string" + }, "tax_code": { "description": "An optional tax code the Region.", "type": "string" @@ -5402,6 +7340,7 @@ "operationId": "GetRegionsRegionFulfillmentOptions", "summary": "List Fulfillment Options available in the Region", "description": "Gathers all the fulfillment options available to in the Region.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -5414,7 +7353,7 @@ } ], "tags": [ - "Product" + "Region" ], "responses": { "200": { @@ -5426,7 +7365,16 @@ "fulfillment_options": { "type": "array", "items": { - "type": "object" + "properties": { + "provider_id": { + "type": "string", + "description": "id of the fulfillment provider" + }, + "options": { + "type": "object", + "description": "fulfillment provider options" + } + } } } } @@ -5441,6 +7389,7 @@ "delete": { "operationId": "PostRegionsRegionCountriesCountry", "summary": "Remove Country", + "x-authenticated": true, "description": "Removes a Country from the list of Countries in a Region", "parameters": [ { @@ -5488,6 +7437,7 @@ "operationId": "PostRegionsRegionFulfillmentProvidersProvider", "summary": "Remove Fulfillment Provider", "description": "Removes a Fulfillment Provider.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -5534,6 +7484,7 @@ "operationId": "PostRegionsRegionPaymentProvidersProvider", "summary": "Remove Payment Provider", "description": "Removes a Payment Provider.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -5575,15 +7526,81 @@ } } }, + "/regions/{id}/metadata": { + "post": { + "operationId": "PostRegionsRegionMetadata", + "summary": "Set the metadata of a Region", + "description": "Sets the metadata of a Region", + "x-authenticated": true, + "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" + } + } + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "key", + "value" + ], + "properties": { + "key": { + "type": "string", + "description": "Key for the metadata value." + }, + "value": { + "type": "string", + "description": "The value that the key relates to." + } + } + } + } + } + } + } + }, "/return-reasons": { "post": { "operationId": "PostReturnReasons", "summary": "Create a Return Reason", "description": "Creates a Return Reason", + "x-authenticated": true, "requestBody": { "content": { "application/json": { "schema": { + "required": [ + "label", + "value" + ], "properties": { "label": { "description": "The label to display to the Customer.", @@ -5593,6 +7610,10 @@ "description": "The value that the Return Reason will be identified by. Must be unique.", "type": "string" }, + "parent_return_reason_id": { + "description": "The id of the parent return reason.", + "type": "string" + }, "description": { "description": "An optional description to for the Reason.", "type": "string" @@ -5630,6 +7651,7 @@ "operationId": "GetReturnReasons", "summary": "List Return Reasons", "description": "Retrieves a list of Return Reasons.", + "x-authenticated": true, "tags": [ "Return Reason" ], @@ -5654,11 +7676,12 @@ } } }, - "/return-reason/{id}": { + "/return-reasons/{id}": { "delete": { "operationId": "DeleteReturnReason", "summary": "Delete a return reason", "description": "Deletes a return reason.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -5697,13 +7720,12 @@ } } } - } - }, - "/return-reasons/{id}": { + }, "get": { "operationId": "GetReturnReasonsReason", "summary": "Retrieve a Return Reason", "description": "Retrieves a Return Reason.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -5739,6 +7761,7 @@ "operationId": "PostReturnReasonsReason", "summary": "Update a Return Reason", "description": "Updates a Return Reason", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -5759,10 +7782,6 @@ "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" @@ -5797,11 +7816,168 @@ } } }, + "/returns/{id}/cancel": { + "post": { + "operationId": "PostReturnsReturnCancel", + "summary": "Cancel a Return", + "description": "Registers a Return as canceled.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Return.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Return" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "return": { + "$ref": "#/components/schemas/order" + } + } + } + } + } + } + } + } + }, + "/returns": { + "get": { + "operationId": "GetReturns", + "summary": "List Returns", + "description": "Retrieves a list of Returns", + "parameters": [ + { + "in": "path", + "name": "limit", + "required": true, + "description": "The upper limit for the amount of responses returned.", + "schema": { + "type": "number" + } + }, + { + "in": "path", + "name": "offset", + "required": true, + "description": "The offset of the list returned.", + "schema": { + "type": "number" + } + } + ], + "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": { + "required": [ + "items" + ], + "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-options": { "post": { "operationId": "PostShippingOptions", "summary": "Create Shipping Option", "description": "Creates a Shipping Option", + "x-authenticated": true, "requestBody": { "content": { "application/json": { @@ -5862,6 +8038,14 @@ "is_return": { "description": "Whether the Shipping Option defines a return shipment.", "type": "boolean" + }, + "admin_only": { + "description": "If true, the option can be used for draft orders", + "type": "boolean" + }, + "metadata": { + "description": "An optional set of key-value pairs with additional information.", + "type": "object" } } } @@ -5892,6 +8076,33 @@ "operationId": "GetShippingOptions", "summary": "List Shipping Options", "description": "Retrieves a list of Shipping Options.", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "region_id", + "schema": { + "type": "string" + }, + "description": "Region to fetch options from" + }, + { + "in": "query", + "name": "is_return", + "schema": { + "type": "boolean" + }, + "description": "Flag for fetching return options" + }, + { + "in": "query", + "name": "admin_only", + "schema": { + "type": "boolean" + }, + "description": "Flag for fetching admin specific options" + } + ], "tags": [ "Shipping Option" ], @@ -5921,6 +8132,7 @@ "operationId": "DeleteShippingOptionsOption", "summary": "Delete a Shipping Option", "description": "Deletes a Shipping Option.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -5964,6 +8176,7 @@ "operationId": "GetShippingOptionsOption", "summary": "Retrieve a Shipping Option", "description": "Retrieves a Shipping Option.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -5999,6 +8212,7 @@ "operationId": "PostShippingOptionsOption", "summary": "Update Shipping Option", "description": "Updates a Shipping Option", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -6023,6 +8237,14 @@ "description": "The amount to charge for the Shipping Option.", "type": "integer" }, + "admin_only": { + "description": "If true, the option can be used for draft orders", + "type": "boolean" + }, + "metadata": { + "description": "An optional set of key-value pairs with additional information.", + "type": "object" + }, "requirements": { "description": "The requirements that must be satisfied for the Shipping Option to be available.", "type": "array", @@ -6074,10 +8296,14 @@ "operationId": "PostShippingProfiles", "summary": "Create a Shipping Profile", "description": "Creates a Shipping Profile", + "x-authenticated": true, "requestBody": { "content": { "application/json": { "schema": { + "required": [ + "name" + ], "properties": { "name": { "description": "The name of the Shipping Profile", @@ -6112,6 +8338,7 @@ "operationId": "GetShippingProfiles", "summary": "List Shipping Profiles", "description": "Retrieves a list of Shipping Profile.", + "x-authenticated": true, "tags": [ "Shipping Profile" ], @@ -6141,6 +8368,7 @@ "operationId": "DeleteShippingProfilesProfile", "summary": "Delete a Shipping Profile", "description": "Deletes a Shipping Profile.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -6184,6 +8412,7 @@ "operationId": "GetShippingProfilesProfile", "summary": "Retrieve a Shipping Profile", "description": "Retrieves a Shipping Profile.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -6270,6 +8499,7 @@ "operationId": "PostStoreCurrenciesCode", "summary": "Add a Currency Code", "description": "Adds a Currency Code to the available currencies.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -6303,8 +8533,9 @@ }, "delete": { "operationId": "DeleteStoreCurrenciesCode", - "summary": "Remvoe a Currency Code", + "summary": "Remove a Currency Code", "description": "Removes a Currency Code from the available currencies.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -6342,6 +8573,7 @@ "operationId": "GetStore", "summary": "Retrieve Store details.", "description": "Retrieves the Store details", + "x-authenticated": true, "tags": [ "Store" ], @@ -6366,6 +8598,7 @@ "operationId": "PostStore", "summary": "Update Store details.", "description": "Updates the Store details", + "x-authenticated": true, "requestBody": { "content": { "application/json": { @@ -6379,6 +8612,14 @@ "description": "A template for Swap links - use `{{cart_id}}` to insert the Swap Cart id", "type": "string" }, + "payment_link_template": { + "description": "A template for payment links links - use `{{cart_id}}` to insert the Cart id", + "type": "string" + }, + "invite_link_template": { + "description": "A template for invite links - use `{{invite_token}}` to insert the invite token", + "type": "string" + }, "default_currency_code": { "description": "The default currency code for the Store.", "type": "string" @@ -6414,6 +8655,7 @@ "operationId": "GetStorePaymentProviders", "summary": "Retrieve configured Payment Providers", "description": "Retrieves the configured Payment Providers", + "x-authenticated": true, "tags": [ "Store" ], @@ -6438,11 +8680,42 @@ } } }, + "/store/tax-providers": { + "get": { + "operationId": "GetStoreTaxProviders", + "summary": "Retrieve configured Tax Providers", + "description": "Retrieves the configured Tax Providers", + "x-authenticated": true, + "tags": [ + "Store" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "tax_providers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/store" + } + } + } + } + } + } + } + } + } + }, "/swaps/{id}": { "get": { "operationId": "GetSwapsSwap", "summary": "Retrieve a Swap", "description": "Retrieves a Swap.", + "x-authenticated": true, "parameters": [ { "in": "path", @@ -6480,6 +8753,7 @@ "operationId": "GetSwaps", "summary": "List Swaps", "description": "Retrieves a list of Swaps.", + "x-authenticated": true, "tags": [ "Swap" ], @@ -6504,11 +8778,800 @@ } } }, + "/tax-rates/:id/product-types/batch": { + "post": { + "operationId": "PostTaxRatesTaxRateProductTypes", + "summary": "Add Tax Rate to Product Types", + "description": "Associates a Tax Rate with a list of Product Types", + "x-authenticated": true, + "tags": [ + "Tax Rates" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "tax_rate": { + "type": "array", + "items": { + "$ref": "#/components/schemas/tax_rate" + } + } + } + } + } + } + } + } + }, + "delete": { + "operationId": "DeleteTaxRatesTaxRateProductTypes", + "summary": "Remove Tax Rate from Product Types", + "description": "Removes a Tax Rate from a list of Product Types", + "x-authenticated": true, + "tags": [ + "Tax Rates" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "tax_rate": { + "type": "array", + "items": { + "$ref": "#/components/schemas/tax_rate" + } + } + } + } + } + } + } + } + } + }, + "/tax-rates/:id/products/batch": { + "post": { + "operationId": "PostTaxRatesTaxRateProducts", + "summary": "Add Tax Rate to Products", + "description": "Associates a Tax Rate with a list of Products", + "x-authenticated": true, + "tags": [ + "Tax Rates" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "tax_rate": { + "type": "array", + "items": { + "$ref": "#/components/schemas/tax_rate" + } + } + } + } + } + } + } + } + }, + "delete": { + "operationId": "DeleteTaxRatesTaxRateProducts", + "summary": "Removes Tax Rate from Products", + "description": "Removes a Tax Rate from a list of Products", + "x-authenticated": true, + "tags": [ + "Tax Rates" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "tax_rate": { + "type": "array", + "items": { + "$ref": "#/components/schemas/tax_rate" + } + } + } + } + } + } + } + } + } + }, + "/tax-rates/:id/shipping-options/batch": { + "post": { + "operationId": "PostTaxRatesTaxRateShippingOptions", + "summary": "Add Tax Rate to Product Types", + "description": "Associates a Tax Rate with a list of Product Types", + "x-authenticated": true, + "tags": [ + "Tax Rates" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "tax_rate": { + "type": "array", + "items": { + "$ref": "#/components/schemas/tax_rate" + } + } + } + } + } + } + } + } + }, + "delete": { + "operationId": "DeleteTaxRatesTaxRateShippingOptions", + "summary": "Removes a Tax Rate from Product Types", + "description": "Removes a Tax Rate from a list of Product Types", + "x-authenticated": true, + "tags": [ + "Tax Rates" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "tax_rate": { + "type": "array", + "items": { + "$ref": "#/components/schemas/tax_rate" + } + } + } + } + } + } + } + } + } + }, + "/tax-rates": { + "post": { + "operationId": "PostTaxRates", + "summary": "Create a Tax Rate", + "description": "Creates a Tax Rate", + "x-authenticated": true, + "tags": [ + "Tax Rates" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "tax_rate": { + "type": "array", + "items": { + "$ref": "#/components/schemas/tax_rate" + } + } + } + } + } + } + } + } + }, + "get": { + "operationId": "GetTaxRates", + "summary": "List Tax Rates", + "description": "Retrieves a list of TaxRates", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "q", + "description": "Query used for searching orders.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "id", + "description": "Id of the order to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "region_id", + "description": "to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "code", + "description": "to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "rate", + "description": "to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "created_at", + "description": "Date comparison for when resulting orders was created, i.e. less than, greater than etc.", + "schema": { + "type": "object" + } + }, + { + "in": "query", + "name": "updated_at", + "description": "Date comparison for when resulting orders was updated, i.e. less than, greater than etc.", + "schema": { + "type": "object" + } + }, + { + "in": "query", + "name": "offset", + "description": "How many orders to skip in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of orders returned.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated) Which fields should be included in each order of the result.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Order" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "orders": { + "type": "array", + "items": { + "$ref": "#/components/schemas/order" + } + } + } + } + } + } + } + } + } + }, + "/tax-rates/{id}": { + "delete": { + "operationId": "DeleteTaxRatesTaxRate", + "summary": "Delete a Tax Rate", + "description": "Deletes a Tax Rate", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Shipping Option.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Tax Rates" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "id": { + "type": "string", + "description": "The id of the deleted Shipping Option." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted." + }, + "deleted": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "/tax-rates/:id": { + "get": { + "operationId": "GetTaxRatesTaxRate", + "summary": "Get Tax Rate", + "description": "Retrieves a TaxRate", + "x-authenticated": true, + "tags": [ + "Tax Rates" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "tax_rate": { + "type": "array", + "items": { + "$ref": "#/components/schemas/tax_rate" + } + } + } + } + } + } + } + } + }, + "post": { + "operationId": "PostTaxRatesTaxRate", + "summary": "Update a Tax Rate", + "description": "Updates a Tax Rate", + "x-authenticated": true, + "tags": [ + "Tax Rates" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "tax_rate": { + "type": "array", + "items": { + "$ref": "#/components/schemas/tax_rate" + } + } + } + } + } + } + } + } + } + }, + "/": { + "post": { + "operationId": "PostUploads", + "summary": "Uploads an array of files", + "description": "Uploads an array of files to the specific fileservice that is installed in medusa.", + "x-authenticated": true, + "tags": [ + "Uploads" + ], + "requestBody": { + "content": { + "multipart/form-data": { + "schema": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "type": "string", + "format": "binary" + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "uploads": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "/users": { + "post": { + "operationId": "PostUsers", + "summary": "Create a User", + "description": "Creates a User", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "email", + "password" + ], + "properties": { + "email": { + "description": "The Users email.", + "type": "string" + }, + "first_name": { + "description": "The name of the User.", + "type": "string" + }, + "last_name": { + "description": "The name of the User.", + "type": "string" + }, + "role": { + "description": "Userrole assigned to the user.", + "type": "string" + }, + "password": { + "description": "The Users password.", + "type": "string" + } + } + } + } + } + }, + "tags": [ + "Users" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "user": { + "$ref": "#/components/schemas/user" + } + } + } + } + } + } + } + }, + "get": { + "operationId": "GetUsers", + "summary": "Retrieve all users", + "description": "Retrieves all users.", + "x-authenticated": true, + "tags": [ + "Users" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "users": { + "type": "array", + "items": { + "$ref": "#/components/schemas/user" + } + } + } + } + } + } + } + } + } + }, + "/users/{user_id}": { + "delete": { + "operationId": "DeleteUsersUser", + "summary": "Delete a User", + "description": "Deletes a User", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "user_id", + "required": true, + "description": "The id of the User.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Users" + ], + "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" + } + } + } + } + } + } + } + }, + "post": { + "operationId": "PostUsersUser", + "summary": "Update a User", + "description": "Updates a User", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "user_id", + "required": true, + "description": "The id of the User.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Users" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "user": { + "$ref": "#/components/schemas/user" + } + } + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "first_name", + "last_name", + "role", + "api_token" + ], + "properties": { + "first_name": { + "type": "string", + "description": "The name of the User." + }, + "last_name": { + "type": "string", + "description": "The name of the User." + }, + "role": { + "type": "string", + "description": "The role of the User(admin, member, developer)." + }, + "api_token": { + "type": "string", + "description": "The api_token of the User." + } + } + } + } + } + } + } + }, + "/users/{id}": { + "get": { + "operationId": "GetUsersUser", + "summary": "Retrieve a User", + "description": "Retrieves a User.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the User.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Users" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "user": { + "$ref": "#/components/schemas/user" + } + } + } + } + } + } + } + } + }, + "/users/password-token": { + "post": { + "operationId": "PostUsersUserPassword", + "summary": "Set the password for a User.", + "description": "Sets the password for a User given the correct token.", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "email", + "token", + "password" + ], + "properties": { + "email": { + "description": "The Users email.", + "type": "string" + }, + "token": { + "description": "The token generated from the 'password-token' endpoint.", + "type": "string" + }, + "password": { + "description": "The Users new password.", + "type": "string" + } + } + } + } + } + }, + "tags": [ + "Users" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "user": { + "$ref": "#/components/schemas/user" + } + } + } + } + } + } + } + } + }, "/variants": { "get": { "operationId": "GetVariants", "summary": "List Product Variants.", "description": "Retrieves a list of Product Variants", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "q", + "description": "Query used for searching variants.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "offset", + "description": "How many variants to skip in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of variants returned.", + "schema": { + "type": "string" + } + } + ], "tags": [ "Product Variant" ], @@ -6532,139 +9595,6 @@ } } } - }, - "/returns/{id}/cancel": { - "post": { - "operationId": "PostReturnsReturnCancel", - "summary": "Cancel a Return", - "description": "Registers a Return as canceled.", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Return.", - "schema": { - "type": "string" - } - } - ], - "tags": [ - "Return" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "return": { - "$ref": "#/components/schemas/order" - } - } - } - } - } - } - } - } - }, - "/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" - } - } - } - } - } - } - } - } } }, "components": { @@ -7177,6 +10107,40 @@ } } }, + "customer_group": { + "title": "Customer Group", + "description": "Represents a customer group", + "x-resourceId": "customer_group", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "customers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/customer" + } + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "type": "string", + "format": "date-time" + }, + "metadata": { + "type": "object" + } + } + }, "customer": { "title": "Customer", "description": "Represents a customer", @@ -7700,6 +10664,52 @@ } } }, + "invite": { + "title": "Invite", + "description": "Represents an invite", + "x-resourceId": "invite", + "properties": { + "id": { + "type": "string" + }, + "user_email": { + "type": "string" + }, + "role": { + "type": "string", + "enum": [ + "admin", + "member", + "developer" + ] + }, + "accepted": { + "type": "boolean" + }, + "token": { + "type": "string" + }, + "expores_at": { + "type": "string", + "format": "date-time" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "type": "string", + "format": "date-time" + }, + "metadata": { + "type": "object" + } + } + }, "line_item": { "title": "Line Item", "description": "Line Items represent purchasable units that can be added to a Cart for checkout. When Line Items are purchased they will get copied to the resulting order and can eventually be referenced in Fulfillments and Returns. Line Items may also be created when processing Swaps and Claims.", @@ -8037,6 +11047,31 @@ } } }, + "OAuth": { + "title": "OAuth", + "description": "Represent an OAuth app", + "x-resourceId": "OAuth", + "properties": { + "id": { + "type": "string" + }, + "display_name": { + "type": "string" + }, + "application_name": { + "type": "string" + }, + "install_url": { + "type": "string" + }, + "uninstall_url": { + "type": "integer" + }, + "data": { + "type": "object" + } + } + }, "order": { "title": "Order", "description": "Represents an order", @@ -8091,7 +11126,7 @@ "type": "string" }, "tax_rate": { - "type": "integer" + "type": "number" }, "discounts": { "type": "array", @@ -8412,7 +11447,7 @@ "description": "The Products contained in the Product Collection.", "type": "array", "items": { - "type": "object" + "$ref": "#/components/schemas/product" } }, "created_at": { @@ -8557,6 +11592,74 @@ } } }, + "product_tax_rate": { + "title": "Product Tax Rate", + "description": "Associates a tax rate with a product to indicate that the product is taxed in a certain way", + "x-resourceId": "product_tax_rate", + "properties": { + "product_id": { + "description": "The id of the Product", + "type": "string" + }, + "rate_id": { + "description": "The id of the Tax Rate", + "type": "string" + }, + "created_at": { + "description": "The date with timezone at which the resource was created.", + "type": "string", + "format": "date-time" + }, + "updated_at": { + "description": "The date with timezone at which the resource was last updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional information.", + "type": "object" + } + } + }, + "product_type_tax_rate": { + "title": "Product Type Tax Rate", + "description": "Associates a tax rate with a product type to indicate that the product type is taxed in a certain way", + "x-resourceId": "product_type_tax_rate", + "properties": { + "product_type_id": { + "description": "The id of the Product type", + "type": "string" + }, + "rate_id": { + "description": "The id of the Tax Rate", + "type": "string" + }, + "created_at": { + "description": "The date with timezone at which the resource was created.", + "type": "string", + "format": "date-time" + }, + "updated_at": { + "description": "The date with timezone at which the resource was last updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional information.", + "type": "object" + } + } + }, "product_type": { "title": "Product Type", "description": "Product Type can be added to Products for filtering and reporting purposes.", @@ -9347,6 +12450,40 @@ } } }, + "shipping_tax_rate": { + "title": "Shipping Tax Rate", + "description": "Associates a tax rate with a shipping option to indicate that the shipping option is taxed in a certain way", + "x-resourceId": "shipping_tax_rate", + "properties": { + "shipping_option_id": { + "description": "The id of the Shipping Option", + "type": "string" + }, + "rate_id": { + "description": "The id of the Tax Rate", + "type": "string" + }, + "created_at": { + "description": "The date with timezone at which the resource was created.", + "type": "string", + "format": "date-time" + }, + "updated_at": { + "description": "The date with timezone at which the resource was last updated.", + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "description": "The date with timezone at which the resource was deleted.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional information.", + "type": "object" + } + } + }, "store": { "title": "Store", "description": "Holds settings for the Store, such as name, currencies, etc.", @@ -9518,6 +12655,103 @@ } } }, + "tax_line": { + "title": "Tax Line", + "description": "Line item that specifies an amount of tax to add to a line item.", + "x-resourceId": "tax_line", + "properties": { + "id": { + "description": "The id of the Tax Line. This value will be prefixed by `tl_`.", + "type": "string" + }, + "code": { + "description": "A code to identify the tax type by", + "type": "string" + }, + "name": { + "description": "A human friendly name for the tax", + "type": "string" + }, + "rate": { + "description": "The numeric rate to charge tax by", + "type": "number" + }, + "created_at": { + "description": "The date with timezone at which the resource was created.", + "type": "string", + "format": "date-time" + }, + "updated_at": { + "description": "The date with timezone at which the resource was last updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional information.", + "type": "object" + } + } + }, + "tax_provider": { + "title": "Tax Provider", + "description": "The tax service used to calculate taxes", + "x-resourceId": "tax_provider", + "properties": { + "id": { + "description": "The id of the tax provider as given by the plugin.", + "type": "string" + }, + "is_installed": { + "description": "Whether the plugin is installed in the current version. Plugins that are no longer installed are not deleted by will have this field set to `false`.", + "type": "boolean" + } + } + }, + "tax_rate": { + "title": "Tax Rate", + "description": "A Tax Rate can be used to associate a certain rate to charge on products within a given Region", + "x-resourceId": "line_item", + "properties": { + "id": { + "description": "The id of the Tax Rate. This value will be prefixed by `txr_`.", + "type": "string" + }, + "rate": { + "description": "The numeric rate to charge", + "type": "number" + }, + "code": { + "description": "A code to identify the tax type by", + "type": "string" + }, + "name": { + "description": "A human friendly name for the tax", + "type": "string" + }, + "region_id": { + "description": "The id of the Region that the rate belongs to", + "type": "string" + }, + "created_at": { + "description": "The date with timezone at which the resource was created.", + "type": "string", + "format": "date-time" + }, + "updated_at": { + "description": "The date with timezone at which the resource was last updated.", + "type": "string", + "format": "date-time" + }, + "metadata": { + "description": "An optional key-value map with additional information.", + "type": "object" + }, + "refundable": { + "description": "The amount that can be refunded from the given Line Item. Takes taxes and discounts into consideration.", + "type": "integer" + } + } + }, "tracking_link": { "title": "Tracking Link", "description": "Tracking Link holds information about tracking numbers for a Fulfillment. Tracking Links can optionally contain a URL that can be visited to see the status of the shipment.", diff --git a/docs/api/admin-spec3.yaml b/docs/api/admin-spec3.yaml index f0967aa938..8c42b10226 100644 --- a/docs/api/admin-spec3.yaml +++ b/docs/api/admin-spec3.yaml @@ -38,7 +38,7 @@ tags: - name: OAuth x-resourceId: OAuth servers: - - url: "https://api.medusa-commerce.com/admin" + - url: 'https://api.medusa-commerce.com/admin' paths: /apps: post: @@ -67,14 +67,14 @@ paths: tags: - Apps responses: - "200": + '200': description: OK content: application/json: schema: properties: apps: - $ref: "#/components/schemas/OAuth" + $ref: '#/components/schemas/OAuth' get: operationId: GetApps summary: List applications @@ -83,14 +83,14 @@ paths: tags: - Apps responses: - "200": + '200': description: OK content: application/json: schema: properties: collection: - $ref: "#/components/schemas/OAuth" + $ref: '#/components/schemas/OAuth' /auth: post: operationId: PostAuth @@ -101,14 +101,14 @@ paths: tags: - Auth responses: - "200": + '200': description: OK content: application/json: schema: properties: user: - $ref: "#/components/schemas/user" + $ref: '#/components/schemas/user' requestBody: content: application/json: @@ -132,15 +132,15 @@ paths: tags: - Auth responses: - "200": + '200': description: OK content: application/json: schema: properties: user: - $ref: "#/components/schemas/user" - "/collections/{id}/products/batch": + $ref: '#/components/schemas/user' + '/collections/{id}/products/batch': post: operationId: PostProductsToCollection summary: Updates products associated with a Product Collection @@ -169,7 +169,7 @@ paths: tags: - Collection responses: - "200": + '200': description: OK delete: operationId: DeleteProductsFromCollection @@ -203,7 +203,7 @@ paths: tags: - Collection responses: - "200": + '200': description: OK /collections: post: @@ -234,14 +234,14 @@ paths: tags: - Collection responses: - "200": + '200': description: OK content: application/json: schema: properties: collection: - $ref: "#/components/schemas/product_collection" + $ref: '#/components/schemas/product_collection' get: operationId: GetCollections summary: List Product Collections @@ -292,15 +292,15 @@ paths: tags: - Collection responses: - "200": + '200': description: OK content: application/json: schema: properties: collection: - $ref: "#/components/schemas/product_collection" - "/collections/{id}": + $ref: '#/components/schemas/product_collection' + '/collections/{id}': delete: operationId: DeleteCollectionsCollection summary: Delete a Product Collection @@ -316,7 +316,7 @@ paths: tags: - Collection responses: - "200": + '200': description: OK content: application/json: @@ -345,14 +345,14 @@ paths: tags: - Collection responses: - "200": + '200': description: OK content: application/json: schema: properties: collection: - $ref: "#/components/schemas/product_collection" + $ref: '#/components/schemas/product_collection' post: operationId: PostCollectionsCollection summary: Update a Product Collection @@ -386,14 +386,14 @@ paths: tags: - Collection responses: - "200": + '200': description: OK content: application/json: schema: properties: collection: - $ref: "#/components/schemas/product_collection" + $ref: '#/components/schemas/product_collection' /customer-groups: post: operationId: PostCustomerGroups @@ -404,14 +404,14 @@ paths: tags: - CustomerGroup responses: - "200": + '200': description: OK content: application/json: schema: properties: customer_group: - $ref: "#/components/schemas/customer_group" + $ref: '#/components/schemas/customer_group' requestBody: content: application/json: @@ -426,7 +426,7 @@ paths: metadata: type: object description: Metadata for the customer. - "/customer-groups/{id}": + '/customer-groups/{id}': delete: operationId: DeleteCustomerGroupsCustomerGroup summary: Delete a CustomerGroup @@ -442,7 +442,7 @@ paths: tags: - CustomerGroup responses: - "200": + '200': description: OK content: application/json: @@ -471,14 +471,14 @@ paths: tags: - CustomerGroup responses: - "200": + '200': description: OK content: application/json: schema: properties: customer_group: - $ref: "#/components/schemas/customer_group" + $ref: '#/components/schemas/customer_group' requestBody: content: application/json: @@ -493,7 +493,7 @@ paths: metadata: type: object description: Metadata for the customer. - "/customer-group/{id}": + '/customer-group/{id}': get: operationId: GetCustomerGroupsGroup summary: Retrieve a CustomerGroup @@ -509,14 +509,14 @@ paths: tags: - CustomerGroup responses: - "200": + '200': description: OK content: application/json: schema: properties: customer_group: - $ref: "#/components/schemas/customer_group" + $ref: '#/components/schemas/customer_group' /customers: post: operationId: PostCustomers @@ -527,14 +527,14 @@ paths: tags: - Customer responses: - "200": + '200': description: OK content: application/json: schema: properties: customer: - $ref: "#/components/schemas/customer" + $ref: '#/components/schemas/customer' requestBody: content: application/json: @@ -568,15 +568,15 @@ paths: tags: - Customer responses: - "200": + '200': description: OK content: application/json: schema: properties: customer: - $ref: "#/components/schemas/customer" - "/customers/{id}": + $ref: '#/components/schemas/customer' + '/customers/{id}': get: operationId: GetCustomersCustomer summary: Retrieve a Customer @@ -592,14 +592,14 @@ paths: tags: - Customer responses: - "200": + '200': description: OK content: application/json: schema: properties: customer: - $ref: "#/components/schemas/customer" + $ref: '#/components/schemas/customer' post: operationId: PostCustomersCustomer summary: Update a Customer @@ -612,6 +612,14 @@ paths: description: The id of the Customer. schema: type: string + - in: query + name: expand + style: form + explode: false + schema: + type: array + items: + type: string requestBody: content: application/json: @@ -636,7 +644,6 @@ paths: description: The Customer's password. groups: type: array - description: A list of customer groups to which the customer belongs. items: required: - id @@ -644,21 +651,22 @@ paths: id: description: The id of a customer group type: string + description: A list of customer groups to which the customer belongs. metadata: type: object description: Metadata for the customer. tags: - Customer responses: - "200": + '200': description: OK content: application/json: schema: properties: customer: - $ref: "#/components/schemas/customer" - "/discounts/{id}/regions/{region_id}": + $ref: '#/components/schemas/customer' + '/discounts/{id}/regions/{region_id}': post: operationId: PostDiscountsDiscountRegionsRegion summary: Adds Region availability @@ -680,14 +688,14 @@ paths: tags: - Discount responses: - "200": + '200': description: OK content: application/json: schema: properties: discount: - $ref: "#/components/schemas/discount" + $ref: '#/components/schemas/discount' delete: operationId: DeleteDiscountsDiscountRegionsRegion summary: Remove Region availability @@ -711,15 +719,15 @@ paths: tags: - Discount responses: - "200": + '200': description: OK content: application/json: schema: properties: discount: - $ref: "#/components/schemas/discount" - "/discounts/{id}/products/{product_id}": + $ref: '#/components/schemas/discount' + '/discounts/{id}/products/{product_id}': post: operationId: PostDiscountsDiscountProductsProduct summary: Adds Product availability @@ -741,14 +749,14 @@ paths: tags: - Discount responses: - "200": + '200': description: OK content: application/json: schema: properties: discount: - $ref: "#/components/schemas/discount" + $ref: '#/components/schemas/discount' delete: operationId: DeleteDiscountsDiscountProductsProduct summary: Remove Product availability @@ -772,14 +780,14 @@ paths: tags: - Discount responses: - "200": + '200': description: OK content: application/json: schema: properties: discount: - $ref: "#/components/schemas/discount" + $ref: '#/components/schemas/discount' /discounts: post: operationId: PostDiscounts @@ -791,10 +799,10 @@ paths: requestBody: content: application/json: - required: - - code - - rule schema: + required: + - code + - rule properties: code: type: string @@ -809,7 +817,7 @@ paths: rule: description: The Discount Rule that defines how Discounts are calculated oneOf: - - $ref: "#/components/schemas/discount_rule" + - $ref: '#/components/schemas/discount_rule' is_disabled: type: boolean description: >- @@ -843,14 +851,14 @@ paths: tags: - Discount responses: - "200": + '200': description: OK content: application/json: schema: properties: discount: - $ref: "#/components/schemas/discount" + $ref: '#/components/schemas/discount' get: operationId: GetDiscounts summary: List Discounts @@ -890,15 +898,15 @@ paths: tags: - Discount responses: - "200": + '200': description: OK content: application/json: schema: properties: discount: - $ref: "#/components/schemas/discount" - "/discounts/{id}/dynamic-codes": + $ref: '#/components/schemas/discount' + '/discounts/{id}/dynamic-codes': post: operationId: PostDiscountsDiscountDynamicCodes summary: Create a dynamic Discount code @@ -916,14 +924,14 @@ paths: tags: - Discount responses: - "200": + '200': description: OK content: application/json: schema: properties: discount: - $ref: "#/components/schemas/discount" + $ref: '#/components/schemas/discount' requestBody: content: application/json: @@ -940,7 +948,7 @@ paths: description: >- An optional set of key-value paris to hold additional information. - "/discounts/{id}": + '/discounts/{id}': delete: operationId: DeleteDiscountsDiscount summary: Delete a Discount @@ -956,7 +964,7 @@ paths: tags: - Discount responses: - "200": + '200': description: OK content: application/json: @@ -985,14 +993,14 @@ paths: tags: - Discount responses: - "200": + '200': description: OK content: application/json: schema: properties: discount: - $ref: "#/components/schemas/discount" + $ref: '#/components/schemas/discount' post: operationId: PostDiscountsDiscount summary: Update a Discount @@ -1025,17 +1033,19 @@ paths: rule: description: The Discount Rule that defines how Discounts are calculated oneOf: - - $ref: "#/components/schemas/discount_rule" + - $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: Date + type: string + format: date-time description: The time at which the Discount should be available. ends_at: - type: Date + type: string + format: date-time description: >- The time at which the Discount should no longer be available. @@ -1052,15 +1062,15 @@ paths: tags: - Discount responses: - "200": + '200': description: OK content: application/json: schema: properties: discount: - $ref: "#/components/schemas/discount" - "/discounts/{id}/dynamic-codes/{code}": + $ref: '#/components/schemas/discount' + '/discounts/{id}/dynamic-codes/{code}': delete: operationId: DeleteDiscountsDiscountDynamicCodesCode summary: Delete a dynamic code @@ -1082,15 +1092,15 @@ paths: tags: - Discount responses: - "200": + '200': description: OK content: application/json: schema: properties: discount: - $ref: "#/components/schemas/discount" - "/discounts/code/{code}": + $ref: '#/components/schemas/discount' + '/discounts/code/{code}': get: operationId: GetDiscountsDiscountCode summary: Retrieve a Discount by code @@ -1106,14 +1116,14 @@ paths: tags: - Discount responses: - "200": + '200': description: OK content: application/json: schema: properties: discount: - $ref: "#/components/schemas/discount" + $ref: '#/components/schemas/discount' /draft-orders: post: operationId: PostDraftOrders @@ -1139,11 +1149,11 @@ paths: billing_address: description: The Address to be used for billing purposes. anyOf: - - $ref: "#/components/schemas/address" + - $ref: '#/components/schemas/address' shipping_address: description: The Address to be used for shipping. anyOf: - - $ref: "#/components/schemas/address" + - $ref: '#/components/schemas/address' items: description: The Line Items that have been received. type: array @@ -1211,14 +1221,14 @@ paths: tags: - Draft Order responses: - "200": + '200': description: OK content: application/json: schema: properties: draft_order: - $ref: "#/components/schemas/draft-order" + $ref: '#/components/schemas/draft-order' get: operationId: GetDraftOrders summary: List Draft Orders @@ -1227,26 +1237,33 @@ paths: tags: - Draft Order responses: - "200": + '200': description: OK content: application/json: schema: properties: draft_order: - $ref: "#/components/schemas/draft-order" - "/draft-orders/{id}/line-items": + $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 x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The id of the Draft Order. + schema: + type: string requestBody: content: application/json: - required: - - quantity schema: + required: + - quantity properties: variant_id: description: >- @@ -1270,15 +1287,15 @@ paths: tags: - Draft Order responses: - "200": + '200': description: OK content: application/json: schema: properties: draft_order: - $ref: "#/components/schemas/draft-order" - "/draft-orders/{id}": + $ref: '#/components/schemas/draft-order' + '/draft-orders/{id}': delete: operationId: DeleteDraftOrdersDraftOrder summary: Delete a Draft Order @@ -1294,7 +1311,7 @@ paths: tags: - Draft Order responses: - "200": + '200': description: OK content: application/json: @@ -1323,15 +1340,15 @@ paths: tags: - Draft Order responses: - "200": + '200': description: OK content: application/json: schema: properties: draft_order: - $ref: "#/components/schemas/draft-order" - "/draft-orders/{id}/line-items/{line_id}": + $ref: '#/components/schemas/draft-order' + '/draft-orders/{id}/line-items/{line_id}': delete: operationId: DeleteDraftOrdersDraftOrderLineItemsItem summary: Delete a Line Item @@ -1353,19 +1370,32 @@ paths: tags: - Draft Order responses: - "200": + '200': description: OK content: application/json: schema: properties: draft_order: - $ref: "#/components/schemas/draft-order" + $ref: '#/components/schemas/draft-order' post: operationId: PostDraftOrdersDraftOrderLineItemsItem summary: Update a Line Item for a Draft Order description: Updates a Line Item for a Draft Order x-authenticated: true + 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 Line Item. + schema: + type: string requestBody: content: application/json: @@ -1388,15 +1418,15 @@ paths: tags: - Draft Order responses: - "200": + '200': description: OK content: application/json: schema: properties: draft_order: - $ref: "#/components/schemas/draft-order" - "/draft-orders/{id}/register-payment": + $ref: '#/components/schemas/draft-order' + '/draft-orders/{id}/register-payment': post: summary: Registers a payment for a Draft Order operationId: PostDraftOrdersDraftOrderRegisterPayment @@ -1412,15 +1442,15 @@ paths: tags: - Draft Order responses: - "200": + '200': description: OK content: application/json: schema: properties: draft_order: - $ref: "#/components/schemas/draft-order" - "/admin/draft-orders/{id}": + $ref: '#/components/schemas/draft-order' + '/admin/draft-orders/{id}': post: operationId: PostDraftOrdersDraftOrder summary: Update a Draft Order" @@ -1447,11 +1477,11 @@ paths: billing_address: description: The Address to be used for billing purposes. anyOf: - - $ref: "#/components/schemas/address" + - $ref: '#/components/schemas/address' shipping_address: description: The Address to be used for shipping. anyOf: - - $ref: "#/components/schemas/address" + - $ref: '#/components/schemas/address' discounts: description: An array of Discount codes to add to the Draft Order. type: array @@ -1471,14 +1501,14 @@ paths: tags: - Draft Order responses: - "200": + '200': description: OK content: application/json: schema: properties: draft_order: - $ref: "#/components/schemas/draft-order" + $ref: '#/components/schemas/draft-order' /gift-cards: post: operationId: PostGiftCards @@ -1521,14 +1551,14 @@ paths: tags: - Gift Card responses: - "200": + '200': description: OK content: application/json: schema: properties: gift_card: - $ref: "#/components/schemas/gift_card" + $ref: '#/components/schemas/gift_card' get: operationId: GetGiftCards summary: List Gift Cards @@ -1537,7 +1567,7 @@ paths: tags: - Gift Card responses: - "200": + '200': description: OK content: application/json: @@ -1546,8 +1576,8 @@ paths: gift_cards: type: array items: - $ref: "#/components/schemas/gift_card" - "/gift-cards/{id}": + $ref: '#/components/schemas/gift_card' + '/gift-cards/{id}': delete: operationId: DeleteGiftCardsGiftCard summary: Delete a Gift Card @@ -1563,7 +1593,7 @@ paths: tags: - Gift Card responses: - "200": + '200': description: OK content: application/json: @@ -1592,14 +1622,14 @@ paths: tags: - Gift Card responses: - "200": + '200': description: OK content: application/json: schema: properties: gift_card: - $ref: "#/components/schemas/gift_card" + $ref: '#/components/schemas/gift_card' post: operationId: PostGiftCardsGiftCard summary: Create a Gift Card @@ -1648,14 +1678,14 @@ paths: tags: - Gift Card responses: - "200": + '200': description: OK content: application/json: schema: properties: gift_card: - $ref: "#/components/schemas/gift_card" + $ref: '#/components/schemas/gift_card' /invites/accept: post: operationId: PostInvitesInviteAccept @@ -1692,7 +1722,7 @@ paths: tags: - Invites responses: - "200": + '200': description: OK /invites: post: @@ -1717,7 +1747,7 @@ paths: tags: - Invites responses: - "200": + '200': description: OK get: operationId: GetInvites @@ -1727,7 +1757,7 @@ paths: tags: - Invites responses: - "200": + '200': description: OK content: application/json: @@ -1736,8 +1766,8 @@ paths: invites: type: array items: - $ref: "#/components/schemas/invite" - "/invites/{invite_id}": + $ref: '#/components/schemas/invite' + '/invites/{invite_id}': delete: operationId: DeleteInvitesInvite summary: Create an Invite @@ -1753,9 +1783,9 @@ paths: tags: - Invites responses: - "200": + '200': description: OK - "/invites/{invite_id}/resend": + '/invites/{invite_id}/resend': post: operationId: PostInvitesInviteResend summary: Resend an Invite @@ -1771,7 +1801,7 @@ paths: tags: - Invites responses: - "200": + '200': description: OK /notes: post: @@ -1796,14 +1826,14 @@ paths: tags: - Note responses: - "200": + '200': description: OK content: application/json: schema: properties: note: - $ref: "#/components/schemas/note" + $ref: '#/components/schemas/note' get: operationId: GetNotes summary: List Notes @@ -1816,25 +1846,25 @@ paths: description: The number of notes to get schema: type: number - default: "" + default: '' - in: path name: offset required: true description: The offset at which to get notes schema: type: number - default: "" + default: '' - in: path name: resource_id required: true description: The id which the notes belongs to schema: type: string - default: "" + default: '' tags: - Note responses: - "200": + '200': description: OK content: application/json: @@ -1843,8 +1873,8 @@ paths: notes: type: array items: - $ref: "#/components/schemas/note" - "/notes/{id}": + $ref: '#/components/schemas/note' + '/notes/{id}': delete: operationId: DeleteNotesNote summary: Deletes a Note @@ -1860,7 +1890,7 @@ paths: tags: - Note responses: - "200": + '200': description: OK content: application/json: @@ -1887,14 +1917,14 @@ paths: tags: - Note responses: - "200": + '200': description: OK content: application/json: schema: properties: note: - $ref: "#/components/schemas/note" + $ref: '#/components/schemas/note' post: operationId: PostNotesNote summary: Updates a Note @@ -1920,14 +1950,14 @@ paths: tags: - Note responses: - "200": + '200': description: OK content: application/json: schema: properties: note: - $ref: "#/components/schemas/note" + $ref: '#/components/schemas/note' /notifications: get: operationId: GetNotifications @@ -1983,7 +2013,7 @@ paths: tags: - Notification responses: - "200": + '200': description: OK content: application/json: @@ -1992,8 +2022,8 @@ paths: notifications: type: array items: - $ref: "#/components/schemas/notification" - "/notifications/{id}/resend": + $ref: '#/components/schemas/notification' + '/notifications/{id}/resend': post: operationId: PostNotificationsNotificationResend summary: Resend Notification @@ -2021,15 +2051,15 @@ paths: tags: - Notification responses: - "200": + '200': description: OK content: application/json: schema: properties: notification: - $ref: "#/components/schemas/notification" - "/orders/{id}/shipping-methods": + $ref: '#/components/schemas/notification' + '/orders/{id}/shipping-methods': post: operationId: PostOrdersOrderShippingMethods summary: Add a Shipping Method @@ -2048,14 +2078,14 @@ paths: tags: - Order responses: - "200": + '200': description: OK content: application/json: schema: properties: order: - $ref: "#/components/schemas/order" + $ref: '#/components/schemas/order' requestBody: content: application/json: @@ -2082,7 +2112,7 @@ paths: The data required for the Shipping Option to create a Shipping Method. This will depend on the Fulfillment Provider. - "/orders/{id}/archive": + '/orders/{id}/archive': post: operationId: PostOrdersOrderArchive summary: Archive order @@ -2098,15 +2128,15 @@ paths: tags: - Order responses: - "200": + '200': description: OK content: application/json: schema: properties: order: - $ref: "#/components/schemas/order" - "/orders/{id}/claims/{claim_id}/cancel": + $ref: '#/components/schemas/order' + '/orders/{id}/claims/{claim_id}/cancel': post: operationId: PostOrdersClaimCancel summary: Cancels a Claim @@ -2128,15 +2158,15 @@ paths: tags: - Claim responses: - "200": + '200': description: OK content: application/json: schema: properties: order: - $ref: "#/components/schemas/claim_order" - "/orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel": + $ref: '#/components/schemas/claim_order' + '/orders/{id}/claims/{claim_id}/fulfillments/{fulfillment_id}/cancel': post: operationId: PostOrdersClaimFulfillmentsCancel summary: Cancels a fulfilmment related to a Claim @@ -2164,15 +2194,15 @@ paths: tags: - Fulfillment responses: - "200": + '200': description: OK content: application/json: schema: properties: fulfillment: - $ref: "#/components/schemas/fulfillment" - "/orders/{id}/swaps/{swap_id}/fulfillments/{fulfillment_id}/cancel": + $ref: '#/components/schemas/fulfillment' + '/orders/{id}/swaps/{swap_id}/fulfillments/{fulfillment_id}/cancel': post: operationId: PostOrdersSwapFulfillmentsCancel summary: Cancels a fulfilmment related to a Swap @@ -2200,15 +2230,15 @@ paths: tags: - Fulfillment responses: - "200": + '200': description: OK content: application/json: schema: properties: fulfillment: - $ref: "#/components/schemas/fulfillment" - "/orders/{id}/fulfillments/{fulfillment_id}/cancel": + $ref: '#/components/schemas/fulfillment' + '/orders/{id}/fulfillments/{fulfillment_id}/cancel': post: operationId: PostOrdersOrderFulfillmentsCancel summary: Cancels a fulfilmment @@ -2230,15 +2260,15 @@ paths: tags: - Fulfillment responses: - "200": + '200': description: OK content: application/json: schema: properties: fulfillment: - $ref: "#/components/schemas/fulfillment" - "/orders/{id}/cancel": + $ref: '#/components/schemas/fulfillment' + '/orders/{id}/cancel': post: operationId: PostOrdersOrderCancel summary: Cancel an Order @@ -2257,15 +2287,15 @@ paths: tags: - Order responses: - "200": + '200': description: OK content: application/json: schema: properties: order: - $ref: "#/components/schemas/order" - "/orders/{id}/swaps/{swap_id}/cancel": + $ref: '#/components/schemas/order' + '/orders/{id}/swaps/{swap_id}/cancel': post: operationId: PostOrdersSwapCancel summary: Cancels a Swap @@ -2287,15 +2317,15 @@ paths: tags: - Swap responses: - "200": + '200': description: OK content: application/json: schema: properties: order: - $ref: "#/components/schemas/swap" - "/orders/{id}/capture": + $ref: '#/components/schemas/swap' + '/orders/{id}/capture': post: operationId: PostOrdersOrderCapture summary: Capture an Order @@ -2311,15 +2341,15 @@ paths: tags: - Order responses: - "200": + '200': description: OK content: application/json: schema: properties: order: - $ref: "#/components/schemas/order" - "/orders/{id}/complete": + $ref: '#/components/schemas/order' + '/orders/{id}/complete': post: operationId: PostOrdersOrderComplete summary: Complete an Order @@ -2335,15 +2365,15 @@ paths: tags: - Order responses: - "200": + '200': description: OK content: application/json: schema: properties: order: - $ref: "#/components/schemas/order" - "/orders/{id}/claims/{claim_id}/shipments": + $ref: '#/components/schemas/order' + '/orders/{id}/claims/{claim_id}/shipments': post: operationId: PostOrdersOrderClaimsClaimShipments summary: Create Claim Shipment @@ -2380,15 +2410,15 @@ paths: tags: - Order responses: - "200": + '200': description: OK content: application/json: schema: properties: order: - $ref: "#/components/schemas/order" - "/order/{id}/claims": + $ref: '#/components/schemas/order' + '/order/{id}/claims': post: operationId: PostOrdersOrderClaims summary: Create a Claim @@ -2520,15 +2550,15 @@ paths: tags: - Order responses: - "200": + '200': description: OK content: application/json: schema: properties: order: - $ref: "#/components/schemas/order" - "/orders/{id}/fulfillments": + $ref: '#/components/schemas/order' + '/orders/{id}/fulfillments': post: operationId: PostOrdersOrderFulfillments summary: Create a Fulfillment @@ -2574,14 +2604,14 @@ paths: tags: - Order responses: - "200": + '200': description: OK content: application/json: schema: properties: order: - $ref: "#/components/schemas/order" + $ref: '#/components/schemas/order' /orders: post: operationId: PostOrders @@ -2591,16 +2621,16 @@ paths: requestBody: content: application/json: - required: - - email - - billing_address - - shipping_address - - items - - region - - customer_id - - payment_method - - shipping_method schema: + required: + - email + - billing_address + - shipping_address + - items + - region + - customer_id + - payment_method + - shipping_method properties: status: description: status of the order @@ -2611,22 +2641,24 @@ paths: billing_address: description: Billing address anyOf: - - $ref: >- - #/components/schemas/address + - $ref: '#/components/schemas/address' shipping_address: description: Shipping address anyOf: - - $ref: >- - #/components/schemas/address + - $ref: '#/components/schemas/address' items: description: The Line Items for the order type: array + items: + $ref: '#/components/schemas/line_item' region: description: Region where the order belongs type: string discounts: description: Discounts applied to the order type: array + items: + $ref: '#/components/schemas/line_item' customer_id: description: id of the customer type: string @@ -2664,6 +2696,8 @@ paths: description: Data relevant to the specific shipping method. items: type: array + items: + $ref: '#/components/schemas/line_item' description: Items to ship no_notification: description: >- @@ -2673,14 +2707,14 @@ paths: tags: - Order responses: - "200": + '200': description: OK content: application/json: schema: properties: order: - $ref: "#/components/schemas/order" + $ref: '#/components/schemas/order' get: operationId: GetOrders summary: List Orders @@ -2699,19 +2733,23 @@ paths: type: string - in: query name: status - description: Status to search for. + style: form + explode: false + description: Status to search for schema: - type: "string[]" + type: array + items: + type: string - in: query name: fulfillment_status description: Fulfillment status to search for. schema: - type: "string[]" + type: string - in: query name: payment_status description: Payment status to search for. schema: - type: "string[]" + type: string - in: query name: display_id description: Display id to search for. @@ -2795,7 +2833,7 @@ paths: tags: - Order responses: - "200": + '200': description: OK content: application/json: @@ -2804,8 +2842,8 @@ paths: orders: type: array items: - $ref: "#/components/schemas/order" - "/orders/{id}/shipment": + $ref: '#/components/schemas/order' + '/orders/{id}/shipment': post: operationId: PostOrdersOrderShipment summary: Create a Shipment @@ -2841,15 +2879,15 @@ paths: tags: - Order responses: - "200": + '200': description: OK content: application/json: schema: properties: order: - $ref: "#/components/schemas/order" - "/orders/{id}/swaps/{swap_id}/shipments": + $ref: '#/components/schemas/order' + '/orders/{id}/swaps/{swap_id}/shipments': post: operationId: PostOrdersOrderSwapsSwapShipments summary: Create Swap Shipment @@ -2891,15 +2929,15 @@ paths: tags: - Order responses: - "200": + '200': description: OK content: application/json: schema: properties: order: - $ref: "#/components/schemas/order" - "/order/{id}/swaps": + $ref: '#/components/schemas/order' + '/order/{id}/swaps': post: operationId: PostOrdersOrderSwaps summary: Create a Swap @@ -2985,20 +3023,20 @@ paths: Swap. type: boolean allow_backorder: - description: "If true, swaps can be completed with items out of stock" + description: 'If true, swaps can be completed with items out of stock' type: boolean tags: - Order responses: - "200": + '200': description: OK content: application/json: schema: properties: order: - $ref: "#/components/schemas/order" - "/order/{id}/metadata/{key}": + $ref: '#/components/schemas/order' + '/order/{id}/metadata/{key}': delete: operationId: DeleteOrdersOrderMetadataKey summary: Delete Metadata @@ -3020,15 +3058,15 @@ paths: tags: - Order responses: - "200": + '200': description: OK content: application/json: schema: properties: order: - $ref: "#/components/schemas/order" - "/orders/{id}/claims/{claim_id}/fulfillments": + $ref: '#/components/schemas/order' + '/orders/{id}/claims/{claim_id}/fulfillments': post: operationId: PostOrdersOrderClaimsClaimFulfillments summary: Create a Claim Fulfillment @@ -3065,15 +3103,15 @@ paths: tags: - Order responses: - "200": + '200': description: OK content: application/json: schema: properties: order: - $ref: "#/components/schemas/order" - "/orders/{id}/swaps/{swap_id}/fulfillments": + $ref: '#/components/schemas/order' + '/orders/{id}/swaps/{swap_id}/fulfillments': post: operationId: PostOrdersOrderSwapsSwapFulfillments summary: Create a Swap Fulfillment @@ -3110,15 +3148,15 @@ paths: tags: - Order responses: - "200": + '200': description: OK content: application/json: schema: properties: order: - $ref: "#/components/schemas/order" - "/orders/{id}": + $ref: '#/components/schemas/order' + '/orders/{id}': get: operationId: GetOrdersOrder summary: Retrieve an Order @@ -3134,14 +3172,14 @@ paths: tags: - Order responses: - "200": + '200': description: OK content: application/json: schema: properties: order: - $ref: "#/components/schemas/order" + $ref: '#/components/schemas/order' post: operationId: PostOrdersOrder summary: Update an order @@ -3165,23 +3203,29 @@ paths: billing_address: description: Billing address anyOf: - - $ref: >- - #/components/schemas/address shipping_address: - description: Shipping address anyOf: - $ref: + - $ref: '#/components/schemas/address' + shipping_address: + description: Shipping address + anyOf: + - $ref: '#/components/schemas/address' items: description: The Line Items for the order type: array + items: + $ref: '#/components/schemas/line_item' region: description: Region where the order belongs type: string discounts: description: Discounts applied to the order type: array + items: + $ref: '#/components/schemas/line_item' customer_id: description: id of the customer type: string payment_method: - description: null + description: payment method chosen for the order type: object properties: provider_id: @@ -3208,6 +3252,8 @@ paths: description: Data relevant to the specific shipping method. items: type: array + items: + $ref: '#/components/schemas/line_item' description: Items to ship no_notification: description: >- @@ -3217,15 +3263,15 @@ paths: tags: - Order responses: - "200": + '200': description: OK content: application/json: schema: properties: order: - $ref: "#/components/schemas/order" - "/orders/{id}/swaps/{swap_id}/process-payment": + $ref: '#/components/schemas/order' + '/orders/{id}/swaps/{swap_id}/process-payment': post: operationId: PostOrdersOrderSwapsSwapProcessPayment summary: Process a Swap difference @@ -3250,15 +3296,15 @@ paths: tags: - Order responses: - "200": + '200': description: OK content: application/json: schema: properties: order: - $ref: "#/components/schemas/order" - "/orders/{id}/refunds": + $ref: '#/components/schemas/order' + '/orders/{id}/refunds': post: operationId: PostOrdersOrderRefunds summary: Create a Refund @@ -3296,15 +3342,15 @@ paths: tags: - Order responses: - "200": + '200': description: OK content: application/json: schema: properties: order: - $ref: "#/components/schemas/order" - "/orders/{id}/returns": + $ref: '#/components/schemas/order' + '/orders/{id}/returns': post: operationId: PostOrdersOrderReturns summary: Request a Return @@ -3373,15 +3419,15 @@ paths: tags: - Order responses: - "200": + '200': description: OK content: application/json: schema: properties: order: - $ref: "#/components/schemas/order" - "/order/{id}/claims/{claim_id}": + $ref: '#/components/schemas/order' + '/order/{id}/claims/{claim_id}': post: operationId: PostOrdersOrderClaimsClaim summary: Update a Claim @@ -3472,14 +3518,14 @@ paths: tags: - Order responses: - "200": + '200': description: OK content: application/json: schema: properties: order: - $ref: "#/components/schemas/order" + $ref: '#/components/schemas/order' /product-tags: get: operationId: GetProductTags @@ -3524,14 +3570,14 @@ paths: tags: - Product Tag responses: - "200": + '200': description: OK content: application/json: schema: properties: tags: - $ref: "#/components/schemas/product_tag" + $ref: '#/components/schemas/product_tag' /product-types: get: operationId: GetProductTypes @@ -3565,553 +3611,26 @@ paths: Date comparison for when resulting tas was created, i.e. less than, greater than etc. schema: - type: datecomparisonoperator + type: object - in: query name: updated_at description: >- Date comparison for when resulting tas was updated, i.e. less than, greater than etc. schema: - type: datecomparisonoperator + type: object tags: - Product Tag responses: - "200": + '200': description: OK content: application/json: schema: properties: types: - $ref: "#/components/schemas/product_tag" - "/regions/{id}/countries": - post: - operationId: PostRegionsRegionCountries - summary: Add Country - description: Adds a Country to the list of Countries in a Region - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The id of the Region. - schema: - type: string - requestBody: - content: - application/json: - schema: - required: - - country_code - properties: - country_code: - description: The 2 character ISO code for the Country. - type: string - tags: - - Region - responses: - "200": - description: OK - content: - application/json: - schema: - properties: - region: - $ref: "#/components/schemas/region" - "/regions/{id}/fulfillment-providers": - post: - operationId: PostRegionsRegionFulfillmentProviders - summary: Add Fulfillment Provider - description: Adds a Fulfillment Provider to a Region - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The id of the Region. - schema: - type: string - requestBody: - content: - application/json: - required: - - provider_id - schema: - properties: - provider_id: - description: The id of the Fulfillment Provider to add. - type: string - tags: - - Region - responses: - "200": - description: OK - content: - application/json: - schema: - properties: - region: - $ref: "#/components/schemas/region" - "/regions/{id}/payment-providers": - post: - operationId: PostRegionsRegionPaymentProviders - summary: Add Payment Provider - description: Adds a Payment Provider to a Region - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The id of the Region. - schema: - type: string - requestBody: - content: - application/json: - required: - - provider_id - schema: - properties: - provider_id: - description: The id of the Payment Provider to add. - type: string - tags: - - Region - responses: - "200": - description: OK - content: - application/json: - schema: - properties: - region: - $ref: "#/components/schemas/region" - /regions: - post: - operationId: PostRegions - summary: Create a Region - description: Creates a Region - x-authenticated: true - requestBody: - content: - application/json: - required: - - name - - currency_code - - tax_rate - schema: - properties: - name: - description: The name of the Region - type: string - currency_code: - description: The 3 character ISO currency code to use for the Region. - type: string - tax_code: - description: An optional tax code the Region. - type: string - tax_rate: - description: The tax rate to use on Orders in the Region. - type: number - payment_providers: - description: >- - A list of Payment Providers that should be enabled for the - Region - type: array - items: - type: string - fulfillment_providers: - description: >- - A list of Fulfillment Providers that should be enabled for - the Region - type: array - items: - type: string - countries: - description: A list of countries that should be included in the Region. - type: array - items: - type: string - tags: - - Region - responses: - "200": - description: OK - content: - application/json: - schema: - properties: - region: - $ref: "#/components/schemas/region" - get: - operationId: GetRegions - summary: List Regions - description: Retrieves a list of Regions. - x-authenticated: true - parameters: - - in: query - name: limit - schema: - type: integer - required: false - description: limit the number of regions in response - - in: query - name: offset - schema: - type: integer - required: false - description: Offset of regions in response (used for pagination) - - in: query - name: created_at - schema: - type: object - required: false - description: >- - Date comparison for when resulting region was created, i.e. less - than, greater than etc. - - in: query - name: updated_at - schema: - type: object - required: false - description: >- - Date comparison for when resulting region was updated, i.e. less - than, greater than etc. - - in: query - name: deleted_at - schema: - type: object - required: false - description: >- - Date comparison for when resulting region was deleted, i.e. less - than, greater than etc. - tags: - - Region - responses: - "200": - description: OK - content: - application/json: - schema: - properties: - regions: - type: array - items: - $ref: "#/components/schemas/region" - "/regions/{id}/metadata/{key}": - delete: - operationId: DeleteRegionsRegionMetadataKey - summary: Delete Metadata - description: Deletes a metadata key. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The id of the Region. - schema: - type: string - - in: path - name: key - required: true - description: The metadata key. - schema: - type: string - tags: - - Region - responses: - "200": - description: OK - content: - application/json: - schema: - properties: - region: - $ref: "#/components/schemas/region" - "/regions/{id}": - delete: - operationId: DeleteRegionsRegion - summary: Delete a Region - description: Deletes a Region. - x-authenticated: true - 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: - id: - type: string - description: The id of the deleted Region. - object: - type: string - description: The type of the object that was deleted. - deleted: - type: boolean - get: - operationId: GetRegionsRegion - summary: Retrieve a Region - description: Retrieves a Region. - x-authenticated: true - 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" - post: - operationId: PostRegionsRegion - summary: Update a Region - description: Updates a Region - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The id of the Region. - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - name: - description: The name of the Region - type: string - currency_code: - description: The 3 character ISO currency code to use for the Region. - type: string - automatic_taxes: - description: >- - If true Medusa will automatically calculate taxes for carts - in this region. If false you have to manually call POST - /carts/:id/taxes. - type: boolean - gift_cards_taxable: - description: >- - Whether gift cards in this region should be applied sales - tax when purchasing a gift card - type: boolean - tax_provider_id: - description: >- - The id of the tax provider to use; if null the system tax - provider is used - type: string - tax_code: - description: An optional tax code the Region. - type: string - tax_rate: - description: The tax rate to use on Orders in the Region. - type: number - payment_providers: - description: >- - A list of Payment Providers that should be enabled for the - Region - type: array - items: - type: string - fulfillment_providers: - description: >- - A list of Fulfillment Providers that should be enabled for - the Region - type: array - items: - type: string - countries: - description: A list of countries that should be included in the Region. - type: array - items: - type: string - tags: - - Region - responses: - "200": - description: OK - content: - application/json: - schema: - properties: - region: - $ref: "#/components/schemas/region" - "/regions/{id}/fulfillment-options": - get: - operationId: GetRegionsRegionFulfillmentOptions - summary: List Fulfillment Options available in the Region - description: Gathers all the fulfillment options available to in the Region. - x-authenticated: true - 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: - fulfillment_options: - type: array - items: - type: object - "/regions/{id}/countries/{country_code}": - delete: - operationId: PostRegionsRegionCountriesCountry - summary: Remove Country - x-authenticated: true - description: Removes a Country from the list of Countries in a Region - parameters: - - in: path - name: id - required: true - description: The id of the Region. - schema: - type: string - - in: path - name: country_code - required: true - description: The 2 character ISO code for the Country. - schema: - type: string - tags: - - Region - responses: - "200": - description: OK - content: - application/json: - schema: - properties: - region: - $ref: "#/components/schemas/region" - "/regions/{id}/fulfillment-providers/{provider_id}": - delete: - operationId: PostRegionsRegionFulfillmentProvidersProvider - summary: Remove Fulfillment Provider - description: Removes a Fulfillment Provider. - x-authenticated: true - parameters: - - in: path - name: id - required: true - description: The id of the Region. - schema: - type: string - - in: path - name: provider_id - required: true - description: The id of the Fulfillment Provider. - schema: - type: string - tags: - - Region - responses: - "200": - description: OK - content: - application/json: - schema: - properties: - region: - $ref: "#/components/schemas/region" - "/regions/{id}/payment-providers/{provider_id}": - delete: - operationId: PostRegionsRegionPaymentProvidersProvider - summary: Remove Payment Provider - description: Removes a Payment Provider. - x-authenticated: true - parameters: - - in: path - name: region_id - required: true - description: The id of the Region. - schema: - type: string - - in: path - name: provider_id - required: true - description: The id of the Payment Provider. - schema: - type: string - tags: - - Region - responses: - "200": - description: OK - content: - application/json: - schema: - properties: - region: - $ref: "#/components/schemas/region" - "/regions/{id}/metadata": - post: - operationId: PostRegionsRegionMetadata - summary: Set the metadata of a Region - description: Sets the metadata of a Region - x-authenticated: true - 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" - requestBody: - content: - application/json: - schema: - type: object - required: - - key - - value - properties: - key: - type: string - description: Key for the metadata value. - value: - type: string - description: The value that the key relates to. - "/products/{id}/options": + $ref: '#/components/schemas/product_tag' + '/products/{id}/options': post: operationId: PostProductsProductOptions summary: Add an Option @@ -4139,14 +3658,14 @@ paths: tags: - Product responses: - "200": + '200': description: OK content: application/json: schema: properties: product: - $ref: "#/components/schemas/product" + $ref: '#/components/schemas/product' /products: post: operationId: PostProducts @@ -4156,13 +3675,11 @@ paths: requestBody: content: application/json: - required: - - title - - subtitle - - description schema: required: - title + - subtitle + - description properties: title: description: The title of the Product @@ -4214,7 +3731,7 @@ paths: description: The id of an existing Tag. type: string value: - description: "The value of the Tag, these will be upserted." + description: 'The value of the Tag, these will be upserted.' type: string options: description: >- @@ -4350,14 +3867,14 @@ paths: tags: - Product responses: - "200": + '200': description: OK content: application/json: schema: properties: product: - $ref: "#/components/schemas/product" + $ref: '#/components/schemas/product' get: operationId: GetProducts summary: List Product @@ -4376,19 +3893,31 @@ paths: type: string - in: query name: status - description: Status to search for. + style: form + explode: false + description: Status to search for schema: type: array + items: + type: string - in: query name: collection_id + style: form + explode: false description: Collection ids to search for. schema: type: array + items: + type: string - in: query name: tags - description: Tags to search for. + style: form + explode: false + description: Tags to search for schema: type: array + items: + type: string - in: query name: title description: to search for. @@ -4467,7 +3996,7 @@ paths: tags: - Product responses: - "200": + '200': description: OK content: application/json: @@ -4485,8 +4014,8 @@ paths: products: type: array items: - $ref: "#/components/schemas/product" - "/products/{id}/variants": + $ref: '#/components/schemas/product' + '/products/{id}/variants': post: operationId: PostProductsProductVariants summary: Create a Product Variant @@ -4600,14 +4129,14 @@ paths: tags: - Product responses: - "200": + '200': description: OK content: application/json: schema: properties: product: - $ref: "#/components/schemas/product" + $ref: '#/components/schemas/product' get: operationId: GetProductsProductVariants summary: List a Product's Product Variants @@ -4623,7 +4152,7 @@ paths: tags: - Product responses: - "200": + '200': description: OK content: application/json: @@ -4632,8 +4161,8 @@ paths: variants: type: array items: - $ref: "#/components/schemas/product_variant" - "/products/{id}/options/{option_id}": + $ref: '#/components/schemas/product_variant' + '/products/{id}/options/{option_id}': delete: operationId: DeleteProductsProductOptionsOption summary: Delete a Product Option @@ -4659,7 +4188,7 @@ paths: tags: - Product responses: - "200": + '200': description: OK content: application/json: @@ -4674,7 +4203,7 @@ paths: deleted: type: boolean product: - $ref: "#/components/schemas/product" + $ref: '#/components/schemas/product' post: operationId: PostProductsProductOptionsOption summary: Update a Product Option. @@ -4696,9 +4225,9 @@ paths: requestBody: content: application/json: - required: - - title schema: + required: + - title properties: title: description: The title of the Product Option @@ -4706,15 +4235,15 @@ paths: tags: - Product responses: - "200": + '200': description: OK content: application/json: schema: properties: product: - $ref: "#/components/schemas/product" - "/products/{id}": + $ref: '#/components/schemas/product' + '/products/{id}': delete: operationId: DeleteProductsProduct summary: Delete a Product @@ -4730,7 +4259,7 @@ paths: tags: - Product responses: - "200": + '200': description: OK content: application/json: @@ -4759,14 +4288,14 @@ paths: tags: - Product responses: - "200": + '200': description: OK content: application/json: schema: properties: product: - $ref: "#/components/schemas/product" + $ref: '#/components/schemas/product' post: operationId: PostProductsProduct summary: Update a Product @@ -4834,7 +4363,7 @@ paths: description: The id of an existing Tag. type: string value: - description: "The value of the Tag, these will be upserted." + description: 'The value of the Tag, these will be upserted.' type: string options: description: >- @@ -4970,15 +4499,15 @@ paths: tags: - Product responses: - "200": + '200': description: OK content: application/json: schema: properties: product: - $ref: "#/components/schemas/product" - "/products/{id}/variants/{variant_id}": + $ref: '#/components/schemas/product' + '/products/{id}/variants/{variant_id}': delete: operationId: DeleteProductsProductVariantsVariant summary: Delete a Product Variant @@ -5000,7 +4529,7 @@ paths: tags: - Product responses: - "200": + '200': description: OK content: application/json: @@ -5127,14 +4656,14 @@ paths: tags: - Product responses: - "200": + '200': description: OK content: application/json: schema: properties: product: - $ref: "#/components/schemas/product" + $ref: '#/components/schemas/product' /products/types: get: operationId: GetProductsTypes @@ -5144,7 +4673,7 @@ paths: tags: - Product responses: - "200": + '200': description: OK content: application/json: @@ -5153,8 +4682,8 @@ paths: types: type: array items: - $ref: "#/components/schemas/product_type" - "/products/{id}/metadata": + $ref: '#/components/schemas/product_type' + '/products/{id}/metadata': post: operationId: PostProductsProductMetadata summary: Set Product metadata @@ -5184,14 +4713,547 @@ paths: tags: - Product responses: - "200": + '200': description: OK content: application/json: schema: properties: product: - $ref: "#/components/schemas/product" + $ref: '#/components/schemas/product' + '/regions/{id}/countries': + post: + operationId: PostRegionsRegionCountries + summary: Add Country + description: Adds a Country to the list of Countries in a Region + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The id of the Region. + schema: + type: string + requestBody: + content: + application/json: + schema: + required: + - country_code + properties: + country_code: + description: The 2 character ISO code for the Country. + type: string + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + region: + $ref: '#/components/schemas/region' + '/regions/{id}/fulfillment-providers': + post: + operationId: PostRegionsRegionFulfillmentProviders + summary: Add Fulfillment Provider + description: Adds a Fulfillment Provider to a Region + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The id of the Region. + schema: + type: string + requestBody: + content: + application/json: + schema: + required: + - provider_id + properties: + provider_id: + description: The id of the Fulfillment Provider to add. + type: string + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + region: + $ref: '#/components/schemas/region' + '/regions/{id}/payment-providers': + post: + operationId: PostRegionsRegionPaymentProviders + summary: Add Payment Provider + description: Adds a Payment Provider to a Region + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The id of the Region. + schema: + type: string + requestBody: + content: + application/json: + schema: + required: + - provider_id + properties: + provider_id: + description: The id of the Payment Provider to add. + type: string + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + region: + $ref: '#/components/schemas/region' + /regions: + post: + operationId: PostRegions + summary: Create a Region + description: Creates a Region + x-authenticated: true + requestBody: + content: + application/json: + schema: + required: + - name + - currency_code + - tax_rate + properties: + name: + description: The name of the Region + type: string + currency_code: + description: The 3 character ISO currency code to use for the Region. + type: string + tax_code: + description: An optional tax code the Region. + type: string + tax_rate: + description: The tax rate to use on Orders in the Region. + type: number + payment_providers: + description: >- + A list of Payment Providers that should be enabled for the + Region + type: array + items: + type: string + fulfillment_providers: + description: >- + A list of Fulfillment Providers that should be enabled for + the Region + type: array + items: + type: string + countries: + description: A list of countries that should be included in the Region. + type: array + items: + type: string + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + region: + $ref: '#/components/schemas/region' + get: + operationId: GetRegions + summary: List Regions + description: Retrieves a list of Regions. + x-authenticated: true + parameters: + - in: query + name: limit + schema: + type: integer + required: false + description: limit the number of regions in response + - in: query + name: offset + schema: + type: integer + required: false + description: Offset of regions in response (used for pagination) + - in: query + name: created_at + schema: + type: object + required: false + description: >- + Date comparison for when resulting region was created, i.e. less + than, greater than etc. + - in: query + name: updated_at + schema: + type: object + required: false + description: >- + Date comparison for when resulting region was updated, i.e. less + than, greater than etc. + - in: query + name: deleted_at + schema: + type: object + required: false + description: >- + Date comparison for when resulting region was deleted, i.e. less + than, greater than etc. + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + regions: + type: array + items: + $ref: '#/components/schemas/region' + '/regions/{id}/metadata/{key}': + delete: + operationId: DeleteRegionsRegionMetadataKey + summary: Delete Metadata + description: Deletes a metadata key. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The id of the Region. + schema: + type: string + - in: path + name: key + required: true + description: The metadata key. + schema: + type: string + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + region: + $ref: '#/components/schemas/region' + '/regions/{id}': + delete: + operationId: DeleteRegionsRegion + summary: Delete a Region + description: Deletes a Region. + x-authenticated: true + 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: + id: + type: string + description: The id of the deleted Region. + object: + type: string + description: The type of the object that was deleted. + deleted: + type: boolean + get: + operationId: GetRegionsRegion + summary: Retrieve a Region + description: Retrieves a Region. + x-authenticated: true + 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' + post: + operationId: PostRegionsRegion + summary: Update a Region + description: Updates a Region + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The id of the Region. + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + name: + description: The name of the Region + type: string + currency_code: + description: The 3 character ISO currency code to use for the Region. + type: string + automatic_taxes: + description: >- + If true Medusa will automatically calculate taxes for carts + in this region. If false you have to manually call POST + /carts/:id/taxes. + type: boolean + gift_cards_taxable: + description: >- + Whether gift cards in this region should be applied sales + tax when purchasing a gift card + type: boolean + tax_provider_id: + description: >- + The id of the tax provider to use; if null the system tax + provider is used + type: string + tax_code: + description: An optional tax code the Region. + type: string + tax_rate: + description: The tax rate to use on Orders in the Region. + type: number + payment_providers: + description: >- + A list of Payment Providers that should be enabled for the + Region + type: array + items: + type: string + fulfillment_providers: + description: >- + A list of Fulfillment Providers that should be enabled for + the Region + type: array + items: + type: string + countries: + description: A list of countries that should be included in the Region. + type: array + items: + type: string + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + region: + $ref: '#/components/schemas/region' + '/regions/{id}/fulfillment-options': + get: + operationId: GetRegionsRegionFulfillmentOptions + summary: List Fulfillment Options available in the Region + description: Gathers all the fulfillment options available to in the Region. + x-authenticated: true + 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: + fulfillment_options: + type: array + items: + properties: + provider_id: + type: string + description: id of the fulfillment provider + options: + type: object + description: fulfillment provider options + '/regions/{id}/countries/{country_code}': + delete: + operationId: PostRegionsRegionCountriesCountry + summary: Remove Country + x-authenticated: true + description: Removes a Country from the list of Countries in a Region + parameters: + - in: path + name: id + required: true + description: The id of the Region. + schema: + type: string + - in: path + name: country_code + required: true + description: The 2 character ISO code for the Country. + schema: + type: string + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + region: + $ref: '#/components/schemas/region' + '/regions/{id}/fulfillment-providers/{provider_id}': + delete: + operationId: PostRegionsRegionFulfillmentProvidersProvider + summary: Remove Fulfillment Provider + description: Removes a Fulfillment Provider. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The id of the Region. + schema: + type: string + - in: path + name: provider_id + required: true + description: The id of the Fulfillment Provider. + schema: + type: string + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + region: + $ref: '#/components/schemas/region' + '/regions/{id}/payment-providers/{provider_id}': + delete: + operationId: PostRegionsRegionPaymentProvidersProvider + summary: Remove Payment Provider + description: Removes a Payment Provider. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The id of the Region. + schema: + type: string + - in: path + name: provider_id + required: true + description: The id of the Payment Provider. + schema: + type: string + tags: + - Region + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + region: + $ref: '#/components/schemas/region' + '/regions/{id}/metadata': + post: + operationId: PostRegionsRegionMetadata + summary: Set the metadata of a Region + description: Sets the metadata of a Region + x-authenticated: true + 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' + requestBody: + content: + application/json: + schema: + type: object + required: + - key + - value + properties: + key: + type: string + description: Key for the metadata value. + value: + type: string + description: The value that the key relates to. /return-reasons: post: operationId: PostReturnReasons @@ -5228,14 +5290,14 @@ paths: tags: - Return Reason responses: - "200": + '200': description: OK content: application/json: schema: properties: return_reason: - $ref: "#/components/schemas/return_reason" + $ref: '#/components/schemas/return_reason' get: operationId: GetReturnReasons summary: List Return Reasons @@ -5244,7 +5306,7 @@ paths: tags: - Return Reason responses: - "200": + '200': description: OK content: application/json: @@ -5253,8 +5315,8 @@ paths: return_reasons: type: array items: - $ref: "#/components/schemas/return_reason" - "/return-reasons/{id}": + $ref: '#/components/schemas/return_reason' + '/return-reasons/{id}': delete: operationId: DeleteReturnReason summary: Delete a return reason @@ -5270,7 +5332,7 @@ paths: tags: - Return Reason responses: - "200": + '200': description: OK content: application/json: @@ -5299,14 +5361,14 @@ paths: tags: - Return Reason responses: - "200": + '200': description: OK content: application/json: schema: properties: return_reason: - $ref: "#/components/schemas/return_reason" + $ref: '#/components/schemas/return_reason' post: operationId: PostReturnReasonsReason summary: Update a Return Reason @@ -5338,15 +5400,15 @@ paths: tags: - Return Reason responses: - "200": + '200': description: OK content: application/json: schema: properties: return_reason: - $ref: "#/components/schemas/return_reason" - "/returns/{id}/cancel": + $ref: '#/components/schemas/return_reason' + '/returns/{id}/cancel': post: operationId: PostReturnsReturnCancel summary: Cancel a Return @@ -5361,14 +5423,14 @@ paths: tags: - Return responses: - "200": + '200': description: OK content: application/json: schema: properties: return: - $ref: "#/components/schemas/order" + $ref: '#/components/schemas/order' /returns: get: operationId: GetReturns @@ -5390,7 +5452,7 @@ paths: tags: - Return responses: - "200": + '200': description: OK content: application/json: @@ -5399,8 +5461,8 @@ paths: returns: type: array items: - $ref: "#/components/schemas/return" - "/returns/{id}/receive": + $ref: '#/components/schemas/return' + '/returns/{id}/receive': post: operationId: PostReturnsReturnReceive summary: Receive a Return @@ -5438,14 +5500,14 @@ paths: tags: - Return responses: - "200": + '200': description: OK content: application/json: schema: properties: return: - $ref: "#/components/schemas/return" + $ref: '#/components/schemas/return' /shipping-options: post: operationId: PostShippingOptions @@ -5509,7 +5571,7 @@ paths: description: Whether the Shipping Option defines a return shipment. type: boolean admin_only: - description: "If true, the option can be used for draft orders" + description: 'If true, the option can be used for draft orders' type: boolean metadata: description: >- @@ -5519,42 +5581,39 @@ paths: tags: - Shipping Option responses: - "200": + '200': description: OK content: application/json: schema: properties: shipping_option: - $ref: "#/components/schemas/shipping_option" + $ref: '#/components/schemas/shipping_option' get: operationId: GetShippingOptions summary: List Shipping Options description: Retrieves a list of Shipping Options. x-authenticated: true parameters: - - in: path + - in: query name: region_id schema: type: string - required: false description: Region to fetch options from - - in: path + - in: query name: is_return schema: type: boolean - required: false description: Flag for fetching return options - - in: path + - in: query name: admin_only schema: type: boolean - required: false description: Flag for fetching admin specific options tags: - Shipping Option responses: - "200": + '200': description: OK content: application/json: @@ -5563,8 +5622,8 @@ paths: shipping_options: type: array items: - $ref: "#/components/schemas/shipping_option" - "/shipping-options/{id}": + $ref: '#/components/schemas/shipping_option' + '/shipping-options/{id}': delete: operationId: DeleteShippingOptionsOption summary: Delete a Shipping Option @@ -5580,7 +5639,7 @@ paths: tags: - Shipping Option responses: - "200": + '200': description: OK content: application/json: @@ -5609,14 +5668,14 @@ paths: tags: - Shipping Option responses: - "200": + '200': description: OK content: application/json: schema: properties: shipping_option: - $ref: "#/components/schemas/shipping_option" + $ref: '#/components/schemas/shipping_option' post: operationId: PostShippingOptionsOption summary: Update Shipping Option @@ -5641,7 +5700,7 @@ paths: description: The amount to charge for the Shipping Option. type: integer admin_only: - description: "If true, the option can be used for draft orders" + description: 'If true, the option can be used for draft orders' type: boolean metadata: description: >- @@ -5667,14 +5726,14 @@ paths: tags: - Shipping Option responses: - "200": + '200': description: OK content: application/json: schema: properties: shipping_option: - $ref: "#/components/schemas/shipping_option" + $ref: '#/components/schemas/shipping_option' /shipping-profiles: post: operationId: PostShippingProfiles @@ -5694,14 +5753,14 @@ paths: tags: - Shipping Profile responses: - "200": + '200': description: OK content: application/json: schema: properties: shipping_profile: - $ref: "#/components/schemas/shipping_profile" + $ref: '#/components/schemas/shipping_profile' get: operationId: GetShippingProfiles summary: List Shipping Profiles @@ -5710,7 +5769,7 @@ paths: tags: - Shipping Profile responses: - "200": + '200': description: OK content: application/json: @@ -5719,8 +5778,8 @@ paths: shipping_profiles: type: array items: - $ref: "#/components/schemas/shipping_profile" - "/shipping-profiles/{id}": + $ref: '#/components/schemas/shipping_profile' + '/shipping-profiles/{id}': delete: operationId: DeleteShippingProfilesProfile summary: Delete a Shipping Profile @@ -5736,7 +5795,7 @@ paths: tags: - Shipping Profile responses: - "200": + '200': description: OK content: application/json: @@ -5765,14 +5824,14 @@ paths: tags: - Shipping Profile responses: - "200": + '200': description: OK content: application/json: schema: properties: shipping_profile: - $ref: "#/components/schemas/shipping_profile" + $ref: '#/components/schemas/shipping_profile' post: operationId: PostShippingProfilesProfile summary: Update a Shipping Profiles @@ -5795,15 +5854,15 @@ paths: tags: - Shipping Profile responses: - "200": + '200': description: OK content: application/json: schema: properties: shipping_profiles: - $ref: "#/components/schemas/shipping_profile" - "/store/currencies/{code}": + $ref: '#/components/schemas/shipping_profile' + '/store/currencies/{code}': post: operationId: PostStoreCurrenciesCode summary: Add a Currency Code @@ -5819,14 +5878,14 @@ paths: tags: - Store responses: - "200": + '200': description: OK content: application/json: schema: properties: store: - $ref: "#/components/schemas/store" + $ref: '#/components/schemas/store' delete: operationId: DeleteStoreCurrenciesCode summary: Remove a Currency Code @@ -5842,14 +5901,14 @@ paths: tags: - Store responses: - "200": + '200': description: OK content: application/json: schema: properties: store: - $ref: "#/components/schemas/store" + $ref: '#/components/schemas/store' /store: get: operationId: GetStore @@ -5859,14 +5918,14 @@ paths: tags: - Store responses: - "200": + '200': description: OK content: application/json: schema: properties: store: - $ref: "#/components/schemas/store" + $ref: '#/components/schemas/store' post: operationId: PostStore summary: Update Store details. @@ -5901,14 +5960,14 @@ paths: tags: - Store responses: - "200": + '200': description: OK content: application/json: schema: properties: store: - $ref: "#/components/schemas/store" + $ref: '#/components/schemas/store' /store/payment-providers: get: operationId: GetStorePaymentProviders @@ -5918,7 +5977,7 @@ paths: tags: - Store responses: - "200": + '200': description: OK content: application/json: @@ -5927,7 +5986,7 @@ paths: payment_providers: type: array items: - $ref: "#/components/schemas/store" + $ref: '#/components/schemas/store' /store/tax-providers: get: operationId: GetStoreTaxProviders @@ -5937,7 +5996,7 @@ paths: tags: - Store responses: - "200": + '200': description: OK content: application/json: @@ -5946,8 +6005,8 @@ paths: tax_providers: type: array items: - $ref: "#/components/schemas/store" - "/swaps/{id}": + $ref: '#/components/schemas/store' + '/swaps/{id}': get: operationId: GetSwapsSwap summary: Retrieve a Swap @@ -5963,14 +6022,14 @@ paths: tags: - Swap responses: - "200": + '200': description: OK content: application/json: schema: properties: swap: - $ref: "#/components/schemas/swap" + $ref: '#/components/schemas/swap' /swaps: get: operationId: GetSwaps @@ -5980,7 +6039,7 @@ paths: tags: - Swap responses: - "200": + '200': description: OK content: application/json: @@ -5989,8 +6048,8 @@ paths: swaps: type: array items: - $ref: "#/components/schemas/swap" - "/tax-rates/:id/product-types/batch": + $ref: '#/components/schemas/swap' + '/tax-rates/:id/product-types/batch': post: operationId: PostTaxRatesTaxRateProductTypes summary: Add Tax Rate to Product Types @@ -5999,7 +6058,7 @@ paths: tags: - Tax Rates responses: - "200": + '200': description: OK content: application/json: @@ -6008,7 +6067,7 @@ paths: tax_rate: type: array items: - $ref: "#/components/schemas/tax_rate" + $ref: '#/components/schemas/tax_rate' delete: operationId: DeleteTaxRatesTaxRateProductTypes summary: Remove Tax Rate from Product Types @@ -6017,7 +6076,7 @@ paths: tags: - Tax Rates responses: - "200": + '200': description: OK content: application/json: @@ -6026,8 +6085,8 @@ paths: tax_rate: type: array items: - $ref: "#/components/schemas/tax_rate" - "/tax-rates/:id/products/batch": + $ref: '#/components/schemas/tax_rate' + '/tax-rates/:id/products/batch': post: operationId: PostTaxRatesTaxRateProducts summary: Add Tax Rate to Products @@ -6036,7 +6095,7 @@ paths: tags: - Tax Rates responses: - "200": + '200': description: OK content: application/json: @@ -6045,7 +6104,7 @@ paths: tax_rate: type: array items: - $ref: "#/components/schemas/tax_rate" + $ref: '#/components/schemas/tax_rate' delete: operationId: DeleteTaxRatesTaxRateProducts summary: Removes Tax Rate from Products @@ -6054,7 +6113,7 @@ paths: tags: - Tax Rates responses: - "200": + '200': description: OK content: application/json: @@ -6063,8 +6122,8 @@ paths: tax_rate: type: array items: - $ref: "#/components/schemas/tax_rate" - "/tax-rates/:id/shipping-options/batch": + $ref: '#/components/schemas/tax_rate' + '/tax-rates/:id/shipping-options/batch': post: operationId: PostTaxRatesTaxRateShippingOptions summary: Add Tax Rate to Product Types @@ -6073,7 +6132,7 @@ paths: tags: - Tax Rates responses: - "200": + '200': description: OK content: application/json: @@ -6082,7 +6141,7 @@ paths: tax_rate: type: array items: - $ref: "#/components/schemas/tax_rate" + $ref: '#/components/schemas/tax_rate' delete: operationId: DeleteTaxRatesTaxRateShippingOptions summary: Removes a Tax Rate from Product Types @@ -6091,7 +6150,7 @@ paths: tags: - Tax Rates responses: - "200": + '200': description: OK content: application/json: @@ -6100,7 +6159,7 @@ paths: tax_rate: type: array items: - $ref: "#/components/schemas/tax_rate" + $ref: '#/components/schemas/tax_rate' /tax-rates: post: operationId: PostTaxRates @@ -6110,7 +6169,7 @@ paths: tags: - Tax Rates responses: - "200": + '200': description: OK content: application/json: @@ -6119,7 +6178,7 @@ paths: tax_rate: type: array items: - $ref: "#/components/schemas/tax_rate" + $ref: '#/components/schemas/tax_rate' get: operationId: GetTaxRates summary: List Tax Rates @@ -6185,7 +6244,7 @@ paths: tags: - Order responses: - "200": + '200': description: OK content: application/json: @@ -6194,8 +6253,8 @@ paths: orders: type: array items: - $ref: "#/components/schemas/order" - "/tax-rates/{id}": + $ref: '#/components/schemas/order' + '/tax-rates/{id}': delete: operationId: DeleteTaxRatesTaxRate summary: Delete a Tax Rate @@ -6211,7 +6270,7 @@ paths: tags: - Tax Rates responses: - "200": + '200': description: OK content: application/json: @@ -6225,7 +6284,7 @@ paths: description: The type of the object that was deleted. deleted: type: boolean - "/tax-rates/:id": + '/tax-rates/:id': get: operationId: GetTaxRatesTaxRate summary: Get Tax Rate @@ -6234,7 +6293,7 @@ paths: tags: - Tax Rates responses: - "200": + '200': description: OK content: application/json: @@ -6243,7 +6302,7 @@ paths: tax_rate: type: array items: - $ref: "#/components/schemas/tax_rate" + $ref: '#/components/schemas/tax_rate' post: operationId: PostTaxRatesTaxRate summary: Update a Tax Rate @@ -6252,7 +6311,7 @@ paths: tags: - Tax Rates responses: - "200": + '200': description: OK content: application/json: @@ -6261,7 +6320,7 @@ paths: tax_rate: type: array items: - $ref: "#/components/schemas/tax_rate" + $ref: '#/components/schemas/tax_rate' /: post: operationId: PostUploads @@ -6272,48 +6331,28 @@ paths: x-authenticated: true tags: - Uploads + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + files: + type: array + items: + type: string + format: binary responses: - "200": - description: OK - content: - application/json: - schema: - properties: uploads - /variants: - get: - operationId: GetVariants - summary: List Product Variants. - description: Retrieves a list of Product Variants - x-authenticated: true - parameters: - - in: query - name: q - description: Query used for searching variants. - schema: - type: string - - in: query - name: offset - description: How many variants to skip in the result. - schema: - type: string - - in: query - name: limit - description: Limit the number of variants returned. - schema: - type: string - tags: - - Product Variant - responses: - "200": + '200': description: OK content: application/json: schema: properties: - variants: + uploads: type: array items: - $ref: "#/components/schemas/product_variant" + type: string /users: post: operationId: PostUsers @@ -6346,14 +6385,14 @@ paths: tags: - Users responses: - "200": + '200': description: OK content: application/json: schema: properties: user: - $ref: "#/components/schemas/user" + $ref: '#/components/schemas/user' get: operationId: GetUsers summary: Retrieve all users @@ -6362,7 +6401,7 @@ paths: tags: - Users responses: - "200": + '200': description: OK content: application/json: @@ -6371,8 +6410,8 @@ paths: users: type: array items: - $ref: "#/components/schemas/user" - "/users/{user_id}": + $ref: '#/components/schemas/user' + '/users/{user_id}': delete: operationId: DeleteUsersUser summary: Delete a User @@ -6388,7 +6427,7 @@ paths: tags: - Users responses: - "200": + '200': description: OK content: application/json: @@ -6417,19 +6456,24 @@ paths: tags: - Users responses: - "200": + '200': description: OK content: application/json: schema: properties: user: - $ref: "#/components/schemas/user" + $ref: '#/components/schemas/user' requestBody: content: application/json: schema: type: object + required: + - first_name + - last_name + - role + - api_token properties: first_name: type: string @@ -6439,11 +6483,11 @@ paths: description: The name of the User. role: type: string - description: "The role of the User(admin, member, developer)." + description: 'The role of the User(admin, member, developer).' api_token: type: string description: The api_token of the User. - "/users/{id}": + '/users/{id}': get: operationId: GetUsersUser summary: Retrieve a User @@ -6459,14 +6503,14 @@ paths: tags: - Users responses: - "200": + '200': description: OK content: application/json: schema: properties: user: - $ref: "#/components/schemas/user" + $ref: '#/components/schemas/user' /users/password-token: post: operationId: PostUsersUserPassword @@ -6494,14 +6538,49 @@ paths: tags: - Users responses: - "200": + '200': description: OK content: application/json: schema: properties: user: - $ref: "#/components/schemas/user" + $ref: '#/components/schemas/user' + /variants: + get: + operationId: GetVariants + summary: List Product Variants. + description: Retrieves a list of Product Variants + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching variants. + schema: + type: string + - in: query + name: offset + description: How many variants to skip in the result. + schema: + type: string + - in: query + name: limit + description: Limit the number of variants returned. + schema: + type: string + tags: + - Product Variant + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + variants: + type: array + items: + $ref: '#/components/schemas/product_variant' components: schemas: address: @@ -6528,7 +6607,7 @@ components: country_code: type: string country: - $ref: "#/components/schemas/country" + $ref: '#/components/schemas/country' cart: title: Cart description: Represents a user cart @@ -6541,43 +6620,43 @@ components: billing_address_id: type: string billing_address: - $ref: "#/components/schemas/address" + $ref: '#/components/schemas/address' shipping_address_id: type: string shipping_address: - $ref: "#/components/schemas/address" + $ref: '#/components/schemas/address' items: type: array items: - $ref: "#/components/schemas/line_item" + $ref: '#/components/schemas/line_item' region_id: type: string region: - $ref: "#/components/schemas/region" + $ref: '#/components/schemas/region' discounts: type: array items: - $ref: "#/components/schemas/region" + $ref: '#/components/schemas/region' gift_cards: type: array items: - $ref: "#/components/schemas/gift_card" + $ref: '#/components/schemas/gift_card' customer_id: type: string customer: - $ref: "#/components/schemas/customer" + $ref: '#/components/schemas/customer' payment_session: - $ref: "#/components/schemas/payment_session" + $ref: '#/components/schemas/payment_session' payment_sessions: type: array items: - $ref: "#/components/schemas/payment_session" + $ref: '#/components/schemas/payment_session' payment: - $ref: "#/components/schemas/payment" + $ref: '#/components/schemas/payment' shipping_methods: type: array items: - $ref: "#/components/schemas/shipping_method" + $ref: '#/components/schemas/shipping_method' type: type: string enum: @@ -6644,19 +6723,19 @@ components: images: type: array items: - $ref: "#/components/schemas/claim_image" + $ref: '#/components/schemas/claim_image' claim_order_id: type: string item_id: type: string item: description: The Line Item that the claim refers to - $ref: "#/components/schemas/line_item" + $ref: '#/components/schemas/line_item' variant_id: type: string variant: description: The Product Variant that is claimed. - $ref: "#/components/schemas/product_variant" + $ref: '#/components/schemas/product_variant' reason: description: The reason for the claim type: string @@ -6666,7 +6745,7 @@ components: - production_failure - other note: - description: "An optional note about the claim, for additional information" + description: 'An optional note about the claim, for additional information' type: string quantity: description: >- @@ -6677,7 +6756,7 @@ components: description: User defined tags for easy filtering and grouping. type: array items: - $ref: "#/components/schemas/claim_tag" + $ref: '#/components/schemas/claim_tag' created_at: type: string format: date-time @@ -6726,36 +6805,36 @@ components: description: The items that have been claimed type: array items: - $ref: "#/components/schemas/claim_item" + $ref: '#/components/schemas/claim_item' additional_items: description: >- Refers to the new items to be shipped when the claim order has the type `replace` type: array items: - $ref: "#/components/schemas/line_item" + $ref: '#/components/schemas/line_item' order_id: description: The id of the order that the claim comes from. type: string return_order: description: Holds information about the return if the claim is to be returned - $ref: "#/components/schemas/return" + $ref: '#/components/schemas/return' shipping_address_id: description: The id of the address that the new items should be shipped to type: string shipping_address: description: The address that the new items should be shipped to - $ref: "#/components/schemas/address" + $ref: '#/components/schemas/address' shipping_methods: description: The shipping methods that the claim order will be shipped with. type: array items: - $ref: "#/components/schemas/shipping_method" + $ref: '#/components/schemas/shipping_method' fulfillments: description: The fulfillments of the new items to be shipped type: array items: - $ref: "#/components/schemas/fulfillment" + $ref: '#/components/schemas/fulfillment' refund_amount: description: The amount that will be refunded in conjunction with the claim type: integer @@ -6870,11 +6949,11 @@ components: The id of the Shipping Option that the custom shipping option overrides anyOf: - - $ref: "#/components/schemas/shipping_option" + - $ref: '#/components/schemas/shipping_option' cart_id: description: The id of the Cart that the custom shipping option is attached to anyOf: - - $ref: "#/components/schemas/cart" + - $ref: '#/components/schemas/cart' created_at: description: The date with timezone at which the resource was created. type: string @@ -6902,7 +6981,7 @@ components: customers: type: array items: - type: object + $ref: '#/components/schemas/customer' created_at: type: string format: date-time @@ -6928,11 +7007,11 @@ components: billing_address: description: The Customer's billing address. anyOf: - - $ref: "#/components/schemas/address" + - $ref: '#/components/schemas/address' shipping_addresses: type: array items: - $ref: "#/components/schemas/address" + $ref: '#/components/schemas/address' first_name: type: string last_name: @@ -6990,7 +7069,7 @@ components: description: A set of Products that the discount can be used for. type: array items: - $ref: "#/components/schemas/product" + $ref: '#/components/schemas/product' created_at: description: The date with timezone at which the resource was created. type: string @@ -7029,7 +7108,7 @@ components: rule: description: The Discount Rule that governs the behaviour of the Discount anyOf: - - $ref: "#/components/schemas/discount_rule" + - $ref: '#/components/schemas/discount_rule' is_disabled: description: >- Whether the Discount has been disabled. Disabled discounts cannot be @@ -7052,7 +7131,7 @@ components: description: The Regions in which the Discount can be used type: array items: - $ref: "#/components/schemas/region" + $ref: '#/components/schemas/region' usage_limit: description: The maximum number of times that a discount can be used. type: integer @@ -7092,12 +7171,12 @@ components: type: string cart: anyOf: - - $ref: "#/components/schemas/cart" + - $ref: '#/components/schemas/cart' order_id: type: string order: anyOf: - - $ref: "#/components/schemas/order" + - $ref: '#/components/schemas/order' canceled_at: type: string format: date-time @@ -7135,7 +7214,7 @@ components: item: description: The Line Item that the Fulfillment Item references. anyOf: - - $ref: "#/components/schemas/line_item" + - $ref: '#/components/schemas/line_item' quantity: description: The quantity of the Line Item that is included in the Fulfillment. type: integer @@ -7190,7 +7269,7 @@ components: about how many of each Line Item has been fulfilled. type: array items: - $ref: "#/components/schemas/fulfillment_item" + $ref: '#/components/schemas/fulfillment_item' tracking_links: description: >- The Tracking Links that can be used to track the status of the @@ -7198,7 +7277,7 @@ components: Provider. type: array items: - $ref: "#/components/schemas/tracking_link" + $ref: '#/components/schemas/tracking_link' tracking_numbers: deprecated: true description: >- @@ -7249,7 +7328,7 @@ components: gift_card: description: The Gift Card that was used in the transaction. anyOf: - - $ref: "#/components/schemas/gift_card" + - $ref: '#/components/schemas/gift_card' order_id: description: The id of the Order that the Gift Card was used to pay for. type: string @@ -7287,7 +7366,7 @@ components: region: description: The Region in which the Gift Card is available. anyOf: - - $ref: "#/components/schemas/region" + - $ref: '#/components/schemas/region' order_id: description: The id of the Order that the Gift Card was purchased in. type: string @@ -7435,7 +7514,7 @@ components: variant: description: The Product Variant contained in the Line Item. anyOf: - - $ref: "#/components/schemas/product_variant" + - $ref: '#/components/schemas/product_variant' quantity: description: The quantity of the content in the Line Item. type: integer @@ -7500,7 +7579,7 @@ components: region: description: The Region that the Money Amount is defined for. anyOf: - - $ref: "#/components/schemas/region" + - $ref: '#/components/schemas/region' created_at: description: The date with timezone at which the resource was created. type: string @@ -7536,7 +7615,7 @@ components: author: description: The author of the note. anyOf: - - $ref: "#/components/schemas/user" + - $ref: '#/components/schemas/user' created_at: description: The date with timezone at which the resource was created. type: string @@ -7595,7 +7674,7 @@ components: customer: description: The Customer that the Notification was sent to. anyOf: - - $ref: "#/components/schemas/customer" + - $ref: '#/components/schemas/customer' to: description: >- The address that the Notification was sent to. This will usually be @@ -7616,7 +7695,7 @@ components: Notification. type: array items: - $ref: "#/components/schemas/notification_resend" + $ref: '#/components/schemas/notification_resend' provider_id: description: The id of the Notification Provider that handles the Notification. type: string @@ -7735,76 +7814,76 @@ components: discounts: type: array items: - $ref: "#/components/schemas/discount" + $ref: '#/components/schemas/discount' email: type: string billing_address_id: type: string billing_address: anyOf: - - $ref: "#/components/schemas/address" + - $ref: '#/components/schemas/address' shipping_address_id: type: string shipping_address: anyOf: - - $ref: "#/components/schemas/address" + - $ref: '#/components/schemas/address' items: type: array items: - $ref: "#/components/schemas/line_item" + $ref: '#/components/schemas/line_item' region_id: type: string region: anyOf: - - $ref: "#/components/schemas/region" + - $ref: '#/components/schemas/region' gift_cards: type: array items: - $ref: "#/components/schemas/gift_card" + $ref: '#/components/schemas/gift_card' customer_id: type: string customer: anyOf: - - $ref: "#/components/schemas/customer" + - $ref: '#/components/schemas/customer' payment_session: anyOf: - - $ref: "#/components/schemas/payment_session" + - $ref: '#/components/schemas/payment_session' payment_sessions: type: array items: - $ref: "#/components/schemas/payment_session" + $ref: '#/components/schemas/payment_session' payments: type: array items: - $ref: "#/components/schemas/payment" + $ref: '#/components/schemas/payment' shipping_methods: type: array items: - $ref: "#/components/schemas/shipping_method" + $ref: '#/components/schemas/shipping_method' fulfillments: type: array items: - $ref: "#/components/schemas/fulfillment" + $ref: '#/components/schemas/fulfillment' returns: type: array items: - $ref: "#/components/schemas/return" + $ref: '#/components/schemas/return' claims: type: array items: - $ref: "#/components/schemas/claim_order" + $ref: '#/components/schemas/claim_order' refunds: type: array items: - $ref: "#/components/schemas/refund" + $ref: '#/components/schemas/refund' swaps: type: array items: - $ref: "#/components/schemas/refund" + $ref: '#/components/schemas/refund' gift_card_transactions: type: array items: - $ref: "#/components/schemas/gift_card_transaction" + $ref: '#/components/schemas/gift_card_transaction' canceled_at: type: string format: date-time @@ -7990,7 +8069,7 @@ components: description: The Products contained in the Product Collection. type: array items: - type: object + $ref: '#/components/schemas/product' created_at: description: The date with timezone at which the resource was created. type: string @@ -8070,7 +8149,7 @@ components: description: The Product Option Values that are defined for the Product Option. type: array items: - $ref: "#/components/schemas/product_option_value" + $ref: '#/components/schemas/product_option_value' product_id: description: The id of the Product that the Product Option is defined for. type: string @@ -8230,7 +8309,7 @@ components: Region. type: array items: - $ref: "#/components/schemas/money_amount" + $ref: '#/components/schemas/money_amount' sku: description: >- The unique stock keeping unit used to identify the Product Variant. @@ -8311,7 +8390,7 @@ components: description: The Product Option Values specified for the Product Variant. type: array items: - $ref: "#/components/schemas/product_option_value" + $ref: '#/components/schemas/product_option_value' created_at: description: The date with timezone at which the resource was created. type: string @@ -8369,7 +8448,7 @@ components: description: Images of the Product type: array items: - $ref: "#/components/schemas/image" + $ref: '#/components/schemas/image' thumbnail: description: A URL to an image file that can be used to identify the Product. type: string @@ -8380,14 +8459,14 @@ components: Option Values. type: array items: - $ref: "#/components/schemas/product_option" + $ref: '#/components/schemas/product_option' variants: description: >- The Product Variants that belong to the Product. Each will have a unique combination of Product Option Values. type: array items: - $ref: "#/components/schemas/product_variant" + $ref: '#/components/schemas/product_variant' profile_id: description: >- The id of the Shipping Profile that the Product belongs to. Shipping @@ -8441,16 +8520,16 @@ components: type: description: The Product Type of the Product (e.g. "Clothing") anyOf: - - $ref: "#/components/schemas/product_type" + - $ref: '#/components/schemas/product_type' collection: description: The Product Collection that the Product belongs to (e.g. "SS20") anyOf: - - $ref: "#/components/schemas/product_collection" + - $ref: '#/components/schemas/product_collection' tags: description: The Product Tags assigned to the Product. type: array items: - $ref: "#/components/schemas/product_tag" + $ref: '#/components/schemas/product_tag' created_at: description: The date with timezone at which the resource was created. type: string @@ -8542,21 +8621,21 @@ components: description: The countries that are included in the Region. type: array items: - $ref: "#/components/schemas/country" + $ref: '#/components/schemas/country' payment_providers: description: >- The Payment Providers that can be used to process Payments in the Region. type: array items: - $ref: "#/components/schemas/payment_provider" + $ref: '#/components/schemas/payment_provider' fulfillment_providers: description: >- The Fulfillment Providers that can be used to fulfill orders in the Region. type: array items: - $ref: "#/components/schemas/fulfillment_provider" + $ref: '#/components/schemas/fulfillment_provider' created_at: description: The date with timezone at which the resource was created. type: string @@ -8588,7 +8667,7 @@ components: item: description: The Line Item that the Return Item references. anyOf: - - $ref: "#/components/schemas/line_item" + - $ref: '#/components/schemas/line_item' quantity: description: The quantity of the Line Item that is included in the Return. type: integer @@ -8606,7 +8685,7 @@ components: reason: description: The reason for returning the item. anyOf: - - $ref: "#/components/schemas/return_reason" + - $ref: '#/components/schemas/return_reason' note: description: An optional note with additional details about the Return. type: string @@ -8668,7 +8747,7 @@ components: items: description: >- The Return Items that will be shipped back to the warehouse. type: - array items: $ref: + array items: $ref: swap_id: description: The id of the Swap that the Return is a part of. type: string @@ -8683,7 +8762,7 @@ components: The Shipping Method that will be used to send the Return back. Can be null if the Customer facilitates the return shipment themselves. anyOf: - - $ref: "#/components/schemas/shipping_method" + - $ref: '#/components/schemas/shipping_method' shipping_data: description: >- Data about the return shipment as provided by the Fulfilment @@ -8734,7 +8813,7 @@ components: shipping_option: description: The Shipping Option that the Shipping Method is built from. anyOf: - - $ref: "#/components/schemas/shipping_option" + - $ref: '#/components/schemas/shipping_option' order_id: description: The id of the Order that the Shipping Method is used on. type: string @@ -8820,7 +8899,7 @@ components: region: description: The id of the Region that the Shipping Option belongs to. anyOf: - - $ref: "#/components/schemas/region" + - $ref: '#/components/schemas/region' profile_id: description: >- The id of the Shipping Profile that the Shipping Option belongs to. @@ -8858,7 +8937,7 @@ components: be available for a Cart. type: array items: - $ref: "#/components/schemas/shipping_option_requirement" + $ref: '#/components/schemas/shipping_option_requirement' data: description: >- The data needed for the Fulfillment Provider to identify the @@ -8909,7 +8988,7 @@ components: description: The Products that the Shipping Profile defines Shipping Options for. type: array items: - $ref: "#/components/schemas/product" + $ref: '#/components/schemas/product' shipping_options: description: >- The Shipping Options that can be used to fulfill the Products in the @@ -8917,7 +8996,7 @@ components: type: array items: anyOf: - - $ref: "#/components/schemas/shipping_option" + - $ref: '#/components/schemas/shipping_option' created_at: description: The date with timezone at which the resource was created. type: string @@ -8963,7 +9042,7 @@ components: type: object store: title: Store - description: "Holds settings for the Store, such as name, currencies, etc." + description: 'Holds settings for the Store, such as name, currencies, etc.' x-resourceId: store properties: id: @@ -8981,7 +9060,7 @@ components: description: The currencies that are enabled for the Store. type: array items: - $ref: "#/components/schemas/currency" + $ref: '#/components/schemas/currency' swap_link_template: description: >- A template to generate Swap links from use {{cart_id}} to include @@ -9047,22 +9126,22 @@ components: description: The new Line Items to ship to the Customer. type: array items: - $ref: "#/components/schemas/line_item" + $ref: '#/components/schemas/line_item' return_order: description: The Return that is issued for the return part of the Swap. anyOf: - - $ref: "#/components/schemas/return" + - $ref: '#/components/schemas/return' fulfillments: description: The Fulfillments used to send the new Line Items. type: array items: - $ref: "#/components/schemas/fulfillment" + $ref: '#/components/schemas/fulfillment' payment: description: >- The Payment authorized when the Swap requires an additional amount to be charged from the Customer. anyOf: - - $ref: "#/components/schemas/payment" + - $ref: '#/components/schemas/payment' difference_due: description: >- The difference that is paid or refunded as a result of the Swap. May @@ -9074,17 +9153,17 @@ components: The Address to send the new Line Items to - in most cases this will be the same as the shipping address on the Order. anyOf: - - $ref: "#/components/schemas/address" + - $ref: '#/components/schemas/address' shipping_methods: description: The Shipping Methods used to fulfill the addtional items purchased. type: array items: - $ref: "#/components/schemas/shipping_method" + $ref: '#/components/schemas/shipping_method' cart_id: description: The id of the Cart that the Customer will use to confirm the Swap. type: string allow_backorder: - description: "If true, swaps can be completed with items out of stock" + description: 'If true, swaps can be completed with items out of stock' type: boolean confirmed_at: description: >- @@ -9105,7 +9184,7 @@ components: type: string format: date-time no_notification: - description: "If set to true, no notification will be sent related to this swap" + 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. @@ -9243,7 +9322,7 @@ components: last_name: description: The Customer's billing address. anyOf: - - $ref: "#/components/schemas/address" + - $ref: '#/components/schemas/address' created_at: type: string format: date-time diff --git a/docs/api/store-spec3.json b/docs/api/store-spec3.json index 1e8028adf1..6cc525b2ab 100644 --- a/docs/api/store-spec3.json +++ b/docs/api/store-spec3.json @@ -75,89 +75,6 @@ } ], "paths": { - "/collections/{id}": { - "get": { - "operationId": "GetCollectionsCollection", - "summary": "Retrieve a Product Collection", - "description": "Retrieves a Product Collection.", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Product Collection", - "schema": { - "type": "string" - } - } - ], - "tags": [ - "Collection" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "collection": { - "$ref": "#/components/schemas/product_collection" - } - } - } - } - } - } - } - } - }, - "/collections": { - "get": { - "operationId": "GetCollections", - "summary": "List Product Collections", - "description": "Retrieve a list of Product Collection.", - "parameters": [ - { - "in": "query", - "name": "offset", - "description": "The number of collections to skip before starting to collect the collections set", - "schema": { - "type": "integer", - "default": 0 - } - }, - { - "in": "query", - "name": "limit", - "description": "The number of collections to return", - "schema": { - "type": "integer", - "default": 10 - } - } - ], - "tags": [ - "Collection" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "collection": { - "$ref": "#/components/schemas/product_collection" - } - } - } - } - } - } - } - } - }, "/auth": { "post": { "operationId": "PostAuth", @@ -283,137 +200,24 @@ } } }, - "/customers/me/addresses": { - "post": { - "operationId": "PostCustomersCustomerAddresses", - "summary": "Add a Shipping Address", - "description": "Adds a Shipping Address to a Customer's saved addresses.", - "x-authenticated": true, - "requestBody": { - "content": { - "application/json": { - "schema": { - "required": [ - "address" - ], - "properties": { - "address": { - "description": "The Address to add to the Customer.", - "anyOf": [ - { - "$ref": "#/components/schemas/address" - } - ] - } - } - } - } - } - }, - "tags": [ - "Customer" - ], - "responses": { - "200": { - "description": "A successful response", - "content": { - "application/json": { - "schema": { - "properties": { - "customer": { - "$ref": "#/components/schemas/customer" - } - } - } - } - } - } - } - } - }, - "/customers": { - "post": { - "operationId": "PostCustomers", - "summary": "Create a Customer", - "description": "Creates a Customer account.", - "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", - "password" - ], - "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." - }, - "password": { - "type": "string", - "description": "The Customer's password for login." - }, - "phone": { - "type": "string", - "description": "The Customer's phone number." - } - } - } - } - } - } - } - }, - "/customers/me/addresses/{address_id}": { - "delete": { - "operationId": "DeleteCustomersCustomerAddressesAddress", - "summary": "Delete an Address", - "description": "Removes an Address from the Customer's saved addresse.", - "x-authenticated": true, + "/collections/{id}": { + "get": { + "operationId": "GetCollectionsCollection", + "summary": "Retrieve a Product Collection", + "description": "Retrieves a Product Collection.", "parameters": [ { "in": "path", - "name": "address_id", + "name": "id", "required": true, - "description": "The id of the Address to remove.", + "description": "The id of the Product Collection", "schema": { "type": "string" } } ], "tags": [ - "Customer" + "Collection" ], "responses": { "200": { @@ -422,8 +226,8 @@ "application/json": { "schema": { "properties": { - "customer": { - "$ref": "#/components/schemas/customer" + "collection": { + "$ref": "#/components/schemas/product_collection" } } } @@ -431,237 +235,35 @@ } } } - }, - "post": { - "operationId": "PostCustomersCustomerAddressesAddress", - "summary": "Update a Shipping Address", - "description": "Updates a Customer's saved Shipping Address.", - "x-authenticated": true, + } + }, + "/collections": { + "get": { + "operationId": "GetCollections", + "summary": "List Product Collections", + "description": "Retrieve a list of Product Collection.", "parameters": [ - { - "in": "path", - "name": "address_id", - "required": true, - "description": "The id of the Address to update.", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "address": { - "description": "The updated Address.", - "anyOf": [ - { - "$ref": "#/components/schemas/address" - } - ] - } - } - } - } - } - }, - "tags": [ - "Customer" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "customer": { - "$ref": "#/components/schemas/customer" - } - } - } - } - } - } - } - } - }, - "/customers/me": { - "get": { - "operationId": "GetCustomersCustomer", - "summary": "Retrieves a Customer", - "description": "Retrieves a Customer - the Customer must be logged in to retrieve their details.", - "x-authenticated": true, - "tags": [ - "Customer" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "customer": { - "$ref": "#/components/schemas/customer" - } - } - } - } - } - } - } - }, - "post": { - "operationId": "PostCustomersCustomer", - "summary": "Update Customer details", - "description": "Updates a Customer's saved details.", - "x-authenticated": true, - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "first_name": { - "description": "The Customer's first name.", - "type": "string" - }, - "last_name": { - "description": "The Customer's last name.", - "type": "string" - }, - "billing_address": { - "description": "The Address to be used for billing purposes.", - "anyOf": [ - { - "$ref": "#/components/schemas/address" - } - ] - }, - "password": { - "description": "The Customer's password.", - "type": "string" - }, - "phone": { - "description": "The Customer's phone number.", - "type": "string" - }, - "email": { - "description": "The email of the customer.", - "type": "string" - }, - "metadata": { - "description": "Metadata about the customer.", - "type": "object" - } - } - } - } - } - }, - "tags": [ - "Customer" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "customer": { - "$ref": "#/components/schemas/customer" - } - } - } - } - } - } - } - } - }, - "/customers/me/payment-methods": { - "get": { - "operationId": "GetCustomersCustomerPaymentMethods", - "summary": "Retrieve saved payment methods", - "description": "Retrieves a list of a Customer's saved payment methods. Payment methods are saved with Payment Providers and it is their responsibility to fetch saved methods.", - "x-authenticated": true, - "tags": [ - "Customer" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "payment_methods": { - "type": "array", - "items": { - "properties": { - "provider_id": { - "type": "string", - "description": "The id of the Payment Provider where the payment method is saved." - }, - "data": { - "type": "object", - "description": "The data needed for the Payment Provider to use the saved payment method." - } - } - } - } - } - } - } - } - } - } - } - }, - "/customers/me/orders": { - "get": { - "operationId": "GetCustomersCustomerOrders", - "summary": "Retrieve Customer Orders", - "description": "Retrieves a list of a Customer's Orders.", - "x-authenticated": true, - "parameters": [ - { - "in": "query", - "name": "limit", - "description": "How many addresses to return.", - "schema": { - "type": "integer" - } - }, { "in": "query", "name": "offset", - "description": "The offset in the resulting addresses.", + "description": "The number of collections to skip before starting to collect the collections set", "schema": { - "type": "integer" + "type": "integer", + "default": 0 } }, { "in": "query", - "name": "fields", - "description": "(Comma separated string) Which fields should be included in the resulting addresses.", + "name": "limit", + "description": "The number of collections to return", "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "expand", - "description": "(Comma separated string) Which relations should be expanded in the resulting addresses.", - "schema": { - "type": "string" + "type": "integer", + "default": 10 } } ], "tags": [ - "Customer" + "Collection" ], "responses": { "200": { @@ -670,23 +272,8 @@ "application/json": { "schema": { "properties": { - "count": { - "description": "The total number of Orders.", - "type": "integer" - }, - "offset": { - "description": "The offset for pagination.", - "type": "integer" - }, - "limit": { - "description": "The maxmimum number of Orders to return,", - "type": "integer" - }, - "orders": { - "type": "array", - "items": { - "$ref": "#/components/schemas/order" - } + "collection": { + "$ref": "#/components/schemas/product_collection" } } } @@ -696,95 +283,6 @@ } } }, - "/customers/password-token": { - "post": { - "operationId": "PostCustomersCustomerPasswordToken", - "summary": "Creates a reset password token", - "description": "Creates a reset password token to be used in a subsequent /reset-password request. The password token should be sent out of band e.g. via email and will not be returned.", - "parameters": [], - "tags": [ - "Customer" - ], - "responses": { - "204": { - "description": "OK" - } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "email" - ], - "properties": { - "email": { - "type": "string", - "description": "Email of the user whose password should be reset." - } - } - } - } - } - } - } - }, - "/customers/reset-password": { - "post": { - "operationId": "PostCustomersResetPassword", - "summary": "Resets Customer password", - "description": "Resets a Customer's password using a password token created by a previous /password-token request.", - "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", - "token", - "password" - ], - "properties": { - "email": { - "type": "string", - "description": "The Customer's email." - }, - "token": { - "type": "string", - "description": "The password token created by a /password-token request." - }, - "password": { - "type": "string", - "description": "The new password to set for the Customer." - } - } - } - } - } - } - } - }, "/carts/{id}/shipping-methods": { "post": { "operationId": "PostCartsCartShippingMethod", @@ -1512,7 +1010,7 @@ "/store/carts/{id}": { "post": { "operationId": "PostCartsCartPaymentMethodUpdate", - "summary": "Update a Cart", + "summary": "Update a Cart\"", "description": "Updates a Cart.", "parameters": [ { @@ -1616,34 +1114,45 @@ } } }, - "/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" + "/customers/me/addresses": { + "post": { + "operationId": "PostCustomersCustomerAddresses", + "summary": "Add a Shipping Address", + "description": "Adds a Shipping Address to a Customer's saved addresses.", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "address" + ], + "properties": { + "address": { + "description": "The Address to add to the Customer.", + "anyOf": [ + { + "$ref": "#/components/schemas/address" + } + ] + } + } + } } } - ], + }, "tags": [ - "Product" + "Customer" ], "responses": { "200": { - "description": "OK", + "description": "A successful response", "content": { "application/json": { "schema": { "properties": { - "product": { - "$ref": "#/components/schemas/product" + "customer": { + "$ref": "#/components/schemas/customer" } } } @@ -1653,127 +1162,337 @@ } } }, - "/products": { - "get": { - "operationId": "GetProducts", - "summary": "List Products", - "description": "Retrieves a list of Products.", + "/customers": { + "post": { + "operationId": "PostCustomers", + "summary": "Create a Customer", + "description": "Creates a Customer account.", + "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", + "password" + ], + "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." + }, + "password": { + "type": "string", + "description": "The Customer's password for login." + }, + "phone": { + "type": "string", + "description": "The Customer's phone number." + } + } + } + } + } + } + } + }, + "/customers/me/addresses/{address_id}": { + "delete": { + "operationId": "DeleteCustomersCustomerAddressesAddress", + "summary": "Delete an Address", + "description": "Removes an Address from the Customer's saved addresse.", + "x-authenticated": true, "parameters": [ { - "in": "query", - "name": "q", - "description": "Query used for searching products.", - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "id", - "description": "Id of the product to search for.", - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "collection_id", - "description": "Collection ids to search for.", - "schema": { - "type": "array" - } - }, - { - "in": "query", - "name": "tags", - "description": "Tags to search for.", - "schema": { - "type": "array" - } - }, - { - "in": "query", - "name": "title", - "description": "to search for.", - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "description", - "description": "to search for.", - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "handle", - "description": "to search for.", - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "is_giftcard", - "description": "Search for giftcards using is_giftcard=true.", - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "type", - "description": "to search for.", - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "created_at", - "description": "Date comparison for when resulting products was created, i.e. less than, greater than etc.", - "schema": { - "type": "object" - } - }, - { - "in": "query", - "name": "updated_at", - "description": "Date comparison for when resulting products was updated, i.e. less than, greater than etc.", - "schema": { - "type": "object" - } - }, - { - "in": "query", - "name": "deleted_at", - "description": "Date comparison for when resulting products was deleted, i.e. less than, greater than etc.", - "schema": { - "type": "object" - } - }, - { - "in": "query", - "name": "offset", - "description": "How many products to skip in the result.", - "schema": { - "type": "string" - } - }, - { - "in": "query", - "name": "limit", - "description": "Limit the number of products returned.", + "in": "path", + "name": "address_id", + "required": true, + "description": "The id of the Address to remove.", "schema": { "type": "string" } } ], "tags": [ - "Product" + "Customer" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "customer": { + "$ref": "#/components/schemas/customer" + } + } + } + } + } + } + } + }, + "post": { + "operationId": "PostCustomersCustomerAddressesAddress", + "summary": "Update a Shipping Address", + "description": "Updates a Customer's saved Shipping Address.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "address_id", + "required": true, + "description": "The id of the Address to update.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "address": { + "description": "The updated Address.", + "anyOf": [ + { + "$ref": "#/components/schemas/address" + } + ] + } + } + } + } + } + }, + "tags": [ + "Customer" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "customer": { + "$ref": "#/components/schemas/customer" + } + } + } + } + } + } + } + } + }, + "/customers/me": { + "get": { + "operationId": "GetCustomersCustomer", + "summary": "Retrieves a Customer", + "description": "Retrieves a Customer - the Customer must be logged in to retrieve their details.", + "x-authenticated": true, + "tags": [ + "Customer" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "customer": { + "$ref": "#/components/schemas/customer" + } + } + } + } + } + } + } + }, + "post": { + "operationId": "PostCustomersCustomer", + "summary": "Update Customer details", + "description": "Updates a Customer's saved details.", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "first_name": { + "description": "The Customer's first name.", + "type": "string" + }, + "last_name": { + "description": "The Customer's last name.", + "type": "string" + }, + "billing_address": { + "description": "The Address to be used for billing purposes.", + "anyOf": [ + { + "$ref": "#/components/schemas/address" + } + ] + }, + "password": { + "description": "The Customer's password.", + "type": "string" + }, + "phone": { + "description": "The Customer's phone number.", + "type": "string" + }, + "email": { + "description": "The email of the customer.", + "type": "string" + }, + "metadata": { + "description": "Metadata about the customer.", + "type": "object" + } + } + } + } + } + }, + "tags": [ + "Customer" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "customer": { + "$ref": "#/components/schemas/customer" + } + } + } + } + } + } + } + } + }, + "/customers/me/payment-methods": { + "get": { + "operationId": "GetCustomersCustomerPaymentMethods", + "summary": "Retrieve saved payment methods", + "description": "Retrieves a list of a Customer's saved payment methods. Payment methods are saved with Payment Providers and it is their responsibility to fetch saved methods.", + "x-authenticated": true, + "tags": [ + "Customer" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "payment_methods": { + "type": "array", + "items": { + "properties": { + "provider_id": { + "type": "string", + "description": "The id of the Payment Provider where the payment method is saved." + }, + "data": { + "type": "object", + "description": "The data needed for the Payment Provider to use the saved payment method." + } + } + } + } + } + } + } + } + } + } + } + }, + "/customers/me/orders": { + "get": { + "operationId": "GetCustomersCustomerOrders", + "summary": "Retrieve Customer Orders", + "description": "Retrieves a list of a Customer's Orders.", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "limit", + "description": "How many addresses to return.", + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "offset", + "description": "The offset in the resulting addresses.", + "schema": { + "type": "integer" + } + }, + { + "in": "query", + "name": "fields", + "description": "(Comma separated string) Which fields should be included in the resulting addresses.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated string) Which relations should be expanded in the resulting addresses.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Customer" ], "responses": { "200": { @@ -1783,7 +1502,7 @@ "schema": { "properties": { "count": { - "description": "The total number of Products.", + "description": "The total number of Orders.", "type": "integer" }, "offset": { @@ -1791,13 +1510,13 @@ "type": "integer" }, "limit": { - "description": "The maxmimum number of Products to return,", + "description": "The maxmimum number of Orders to return,", "type": "integer" }, - "products": { + "orders": { "type": "array", "items": { - "$ref": "#/components/schemas/product" + "$ref": "#/components/schemas/order" } } } @@ -1808,6 +1527,95 @@ } } }, + "/customers/password-token": { + "post": { + "operationId": "PostCustomersCustomerPasswordToken", + "summary": "Creates a reset password token", + "description": "Creates a reset password token to be used in a subsequent /reset-password request. The password token should be sent out of band e.g. via email and will not be returned.", + "parameters": [], + "tags": [ + "Customer" + ], + "responses": { + "204": { + "description": "OK" + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "email" + ], + "properties": { + "email": { + "type": "string", + "description": "Email of the user whose password should be reset." + } + } + } + } + } + } + } + }, + "/customers/reset-password": { + "post": { + "operationId": "PostCustomersResetPassword", + "summary": "Resets Customer password", + "description": "Resets a Customer's password using a password token created by a previous /password-token request.", + "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", + "token", + "password" + ], + "properties": { + "email": { + "type": "string", + "description": "The Customer's email." + }, + "token": { + "type": "string", + "description": "The password token created by a /password-token request." + }, + "password": { + "type": "string", + "description": "The new password to set for the Customer." + } + } + } + } + } + } + } + }, "/orders/cart/{cart_id}": { "get": { "operationId": "GetOrdersOrderCartId", @@ -1928,6 +1736,208 @@ } } }, + "/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.", + "parameters": [ + { + "in": "query", + "name": "q", + "description": "Query used for searching products.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "id", + "description": "Id of the product to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "collection_id", + "style": "form", + "explode": false, + "description": "Collection ids to search for", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "tags", + "style": "form", + "explode": false, + "description": "Tags to search for", + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "title", + "description": "to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "description", + "description": "to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "handle", + "description": "to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "is_giftcard", + "description": "Search for giftcards using is_giftcard=true.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "type", + "description": "to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "created_at", + "description": "Date comparison for when resulting products was created, i.e. less than, greater than etc.", + "schema": { + "type": "object" + } + }, + { + "in": "query", + "name": "updated_at", + "description": "Date comparison for when resulting products was updated, i.e. less than, greater than etc.", + "schema": { + "type": "object" + } + }, + { + "in": "query", + "name": "deleted_at", + "description": "Date comparison for when resulting products was deleted, i.e. less than, greater than etc.", + "schema": { + "type": "object" + } + }, + { + "in": "query", + "name": "offset", + "description": "How many products to skip in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of products returned.", + "schema": { + "type": "string" + } + } + ], + "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", @@ -3002,7 +3012,7 @@ "customers": { "type": "array", "items": { - "type": "object" + "$ref": "#/components/schemas/customer" } }, "created_at": { @@ -4328,7 +4338,7 @@ "description": "The Products contained in the Product Collection.", "type": "array", "items": { - "type": "object" + "$ref": "#/components/schemas/product" } }, "created_at": { diff --git a/docs/api/store-spec3.yaml b/docs/api/store-spec3.yaml index fd11e6d96c..915364c7fd 100644 --- a/docs/api/store-spec3.yaml +++ b/docs/api/store-spec3.yaml @@ -122,7 +122,651 @@ paths: properties: exists: type: boolean - "/collections/{id}": + '/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}/taxes': + post: + summary: Calculate Cart Taxes + operationId: PostCartsCartTaxes + description: >- + Calculates taxes for a cart. Depending on the cart's region this may + involve making 3rd party API calls to a Tax Provider service. + parameters: + - in: path + name: id + required: true + description: The Cart id. + schema: + type: string + tags: + - Cart + responses: + '200': + description: A cart object with the tax_total field populated + content: + application/json: + schema: + oneOf: + - type: object + properties: + cart: + $ref: '#/components/schemas/cart' + '/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' + - type: object + properties: + cart: + $ref: '#/components/schemas/swap' + /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: + - data + properties: + 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-sessions/{provider_id}/refresh': + 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}/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: PostCartsCartPaymentMethodUpdate + 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: + required: + - provider_id + properties: + provider_id: + type: string + description: The id of the Payment Provider. + data: + type: object + description: '' + tags: + - Cart + responses: + "200": + description: OK + content: + application/json: + schema: + properties: + cart: + $ref: '#/components/schemas/cart' + '/gift-cards/{code}': + get: + operationId: GetGiftCardsCode + summary: Retrieve Gift Card by Code + description: Retrieves a Gift Card by its associated unqiue code. + parameters: + - in: path + name: code + required: true + description: The unique Gift Card code. + schema: + type: string + tags: + - Gift Card + responses: + '200': + description: OK + content: + 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' + '/orders/cart/{cart_id}': + 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. + parameters: + - in: path + name: cart_id + required: true + description: The id of Cart. + schema: + type: string + tags: + - Order + responses: + "200": + description: OK + content: + 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' + '/collections/{id}': get: operationId: GetCollectionsCollection summary: Retrieve a Product Collection @@ -137,14 +781,14 @@ paths: tags: - Collection responses: - "200": + '200': description: OK content: application/json: schema: properties: collection: - $ref: "#/components/schemas/product_collection" + $ref: '#/components/schemas/product_collection' /collections: get: operationId: GetCollections @@ -168,14 +812,14 @@ paths: tags: - Collection responses: - "200": + '200': description: OK content: application/json: schema: properties: collection: - $ref: "#/components/schemas/product_collection" + $ref: '#/components/schemas/product_collection' /customers/me/addresses: post: operationId: PostCustomersCustomerAddresses @@ -192,18 +836,18 @@ paths: address: description: The Address to add to the Customer. anyOf: - - $ref: "#/components/schemas/address" + - $ref: '#/components/schemas/address' tags: - Customer responses: - "200": + '200': description: A successful response content: application/json: schema: properties: customer: - $ref: "#/components/schemas/customer" + $ref: '#/components/schemas/customer' /customers: post: operationId: PostCustomers @@ -220,7 +864,7 @@ paths: schema: properties: customer: - $ref: "#/components/schemas/customer" + $ref: '#/components/schemas/customer' requestBody: content: application/json: @@ -247,7 +891,7 @@ paths: phone: type: string description: The Customer's phone number. - "/customers/me/addresses/{address_id}": + '/customers/me/addresses/{address_id}': delete: operationId: DeleteCustomersCustomerAddressesAddress summary: Delete an Address @@ -270,7 +914,7 @@ paths: schema: properties: customer: - $ref: "#/components/schemas/customer" + $ref: '#/components/schemas/customer' post: operationId: PostCustomersCustomerAddressesAddress summary: Update a Shipping Address @@ -291,7 +935,7 @@ paths: address: description: The updated Address. anyOf: - - $ref: "#/components/schemas/address" + - $ref: '#/components/schemas/address' tags: - Customer responses: @@ -302,7 +946,7 @@ paths: schema: properties: customer: - $ref: "#/components/schemas/customer" + $ref: '#/components/schemas/customer' /customers/me: get: operationId: GetCustomersCustomer @@ -314,14 +958,14 @@ paths: tags: - Customer responses: - "200": + '200': description: OK content: application/json: schema: properties: customer: - $ref: "#/components/schemas/customer" + $ref: '#/components/schemas/customer' post: operationId: PostCustomersCustomer summary: Update Customer details @@ -341,7 +985,7 @@ paths: billing_address: description: The Address to be used for billing purposes. anyOf: - - $ref: "#/components/schemas/address" + - $ref: '#/components/schemas/address' password: description: The Customer's password. type: string @@ -364,7 +1008,7 @@ paths: schema: properties: customer: - $ref: "#/components/schemas/customer" + $ref: '#/components/schemas/customer' /customers/me/payment-methods: get: operationId: GetCustomersCustomerPaymentMethods @@ -377,7 +1021,7 @@ paths: tags: - Customer responses: - "200": + '200': description: OK content: application/json: @@ -444,12 +1088,12 @@ paths: description: The offset for pagination. type: integer limit: - description: "The maxmimum number of Orders to return," + description: 'The maxmimum number of Orders to return,' type: integer orders: type: array items: - $ref: "#/components/schemas/order" + $ref: '#/components/schemas/order' /customers/password-token: post: operationId: PostCustomersCustomerPasswordToken @@ -462,7 +1106,7 @@ paths: tags: - Customer responses: - "204": + '204': description: OK requestBody: content: @@ -493,7 +1137,7 @@ paths: schema: properties: customer: - $ref: "#/components/schemas/customer" + $ref: '#/components/schemas/customer' requestBody: content: application/json: @@ -513,20 +1157,20 @@ paths: password: type: string description: The new password to set for the Customer. - "/gift-cards/{code}": + '/regions/{id}': get: - operationId: GetGiftCardsCode - summary: Retrieve Gift Card by Code - description: Retrieves a Gift Card by its associated unqiue code. + operationId: GetRegionsRegion + summary: Retrieves a Region + description: Retrieves a Region. parameters: - in: path - name: code + name: id required: true - description: The unique Gift Card code. + description: The id of the Region. schema: type: string tags: - - Gift Card + - Region responses: "200": description: OK @@ -534,435 +1178,15 @@ paths: 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" - "/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}/taxes": - post: - summary: Calculate Cart Taxes - operationId: PostCartsCartTaxes - description: >- - Calculates taxes for a cart. Depending on the cart's region this may - involve making 3rd party API calls to a Tax Provider service. - parameters: - - in: path - name: id - required: true - description: The Cart id. - schema: - type: string - tags: - - Cart - responses: - "200": - description: A cart object with the tax_total field populated - content: - application/json: - schema: - oneOf: - - type: object - properties: - cart: - $ref: "#/components/schemas/cart" - "/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" - - type: object - properties: - cart: - $ref: "#/components/schemas/swap" - /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: - - data - properties: - data: - type: object - description: The data to update the payment session with. - "/carts/{id}": + $ref: '#/components/schemas/region' + /regions: 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 + operationId: GetRegions + summary: List Regions + description: Retrieves a list of Regions. tags: - - Cart + - Region responses: "200": description: OK @@ -970,194 +1194,20 @@ paths: application/json: schema: properties: - cart: - $ref: "#/components/schemas/cart" - "/carts/{id}/payment-sessions/{provider_id}/refresh": - 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}/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: PostCartsCartPaymentMethodUpdate - 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: - required: - - provider_id - properties: - provider_id: - type: string - description: The id of the Payment Provider. - data: - type: object - description: "" - tags: - - Cart - responses: - "200": - description: OK - content: - application/json: - schema: - properties: - cart: - $ref: "#/components/schemas/cart" - "/orders/cart/{cart_id}": - 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. - parameters: - - in: path - name: cart_id - required: true - description: The id of Cart. - schema: - type: string - tags: - - Order - responses: - "200": - description: OK - content: - 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" - "/products/{id}": + 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' + '/products/{id}': get: operationId: GetProductsProduct summary: Retrieves a Product @@ -1198,14 +1248,22 @@ paths: type: string - in: query name: collection_id - description: Collection ids to search for. + style: form + explode: false + description: Collection ids to search for schema: type: array + items: + type: string - in: query name: tags - description: Tags to search for. + style: form + explode: false + description: Tags to search for schema: type: array + items: + type: string - in: query name: title description: to search for. @@ -1283,58 +1341,8 @@ paths: 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" - "/return-reasons/{id}": + $ref: '#/components/schemas/product' + '/return-reasons/{id}': get: operationId: GetReturnReasonsReason summary: Retrieve a Return Reason @@ -2044,7 +2052,7 @@ components: customers: type: array items: - type: object + $ref: '#/components/schemas/customer' created_at: type: string format: date-time @@ -3132,7 +3140,7 @@ components: description: The Products contained in the Product Collection. type: array items: - type: object + $ref: '#/components/schemas/product' created_at: description: The date with timezone at which the resource was created. type: string diff --git a/docs/api/store/endpoints/products.yaml b/docs/api/store/endpoints/products.yaml index ea09aa34eb..29251734b6 100644 --- a/docs/api/store/endpoints/products.yaml +++ b/docs/api/store/endpoints/products.yaml @@ -7,7 +7,7 @@ routes: path: /products/:id route: /products description: > - A product represents the object, that is to be sold on the website. A product can have variants, that differ by e.g. size and color. + A product represents the object, that are to be sold on the website. A product can have variants, that differ by e.g. size and color. endpoints: - path: /:id method: GET diff --git a/www/reference/gatsby-node.js b/www/reference/gatsby-node.js index 403d5bb90e..a37eeedcbe 100644 --- a/www/reference/gatsby-node.js +++ b/www/reference/gatsby-node.js @@ -20,8 +20,9 @@ const createCustomNode = ({ name, node, createNode }) => { let requestBodyValues = undefined if (values.requestBody && values.requestBody.content) { - requestBodyValues = - values.requestBody.content["application/json"].schema + requestBodyValues = values.requestBody.content.hasOwnProperty("application/json") ? + values.requestBody.content["application/json"].schema : + values.requestBody.content["multipart/form-data"].schema } return { diff --git a/www/reference/src/components/ColorModeToggler/index.js b/www/reference/src/components/ColorModeToggler/index.js index 67aa6fd83e..016da032c2 100644 --- a/www/reference/src/components/ColorModeToggler/index.js +++ b/www/reference/src/components/ColorModeToggler/index.js @@ -6,11 +6,16 @@ import React from 'react' import { ThemeToggler } from 'gatsby-plugin-dark-mode' import { useColorMode } from 'theme-ui' +const isBrowser = typeof window !== "undefined" + export default function ColorModeToggler () { const [, setColorMode] = useColorMode() function checkLocalStorage (currentTheme, toggleTheme) { //check that theme local storage values are set correctly + if (!isBrowser) { + return currentTheme; + } let themeUiColorMode = window.localStorage.getItem('theme-ui-color-mode'); let theme = window.localStorage.getItem('theme') if (!themeUiColorMode) {