diff --git a/docs/api/admin-spec3.json b/docs/api/admin-spec3.json index af5df7beb5..782008c052 100644 --- a/docs/api/admin-spec3.json +++ b/docs/api/admin-spec3.json @@ -154,25 +154,177 @@ } } }, - "/customer-groups": { + "/auth": { "post": { - "operationId": "PostCustomerGroups", - "summary": "Create a CustomerGroup", - "description": "Creates a CustomerGroup.", + "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" + } + } + } + } + } + } + } + } + }, + "/batch-jobs/{id}/cancel": { + "post": { + "operationId": "PostBatchJobsBatchJobCancel", + "summary": "Marks a batch job as canceled", + "description": "Marks a batch job as canceled", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the batch job.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Batch Job" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "batch_job": { + "$ref": "#/components/schemas/batch_job" + } + } + } + } + } + } + } + } + }, + "/batch-jobs/{id}/confirm": { + "post": { + "operationId": "PostBatchJobsBatchJobConfirmProcessing", + "summary": "Confirm a batch job", + "description": "Confirms that a previously requested batch job should be executed.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the batch job.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Batch Job" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "batch_job": { + "$ref": "#/components/schemas/batch_job" + } + } + } + } + } + } + } + } + }, + "/batch-jobs": { + "post": { + "operationId": "PostBatchJobs", + "summary": "Create a Batch Job", + "description": "Creates a Batch Job.", "x-authenticated": true, "parameters": [], "tags": [ - "CustomerGroup" + "Batch Job" ], "responses": { - "200": { + "201": { "description": "OK", "content": { "application/json": { "schema": { "properties": { - "customer_group": { - "$ref": "#/components/schemas/customer_group" + "batch_job": { + "$ref": "#/components/schemas/batch_job" } } } @@ -186,428 +338,22 @@ "schema": { "type": "object", "required": [ - "name" + "type", + "context", + "dry_run" ], "properties": { - "name": { + "type": { "type": "string", - "description": "Name of the customer group" + "description": "The type of batch job to start." }, - "metadata": { - "type": "object", - "description": "Metadata for the customer." - } - } - } - } - } - } - } - }, - "/customer-groups/{id}": { - "delete": { - "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 Customer Group", - "schema": { - "type": "string" - } - } - ], - "tags": [ - "CustomerGroup" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "string", - "description": "The id of the deleted customer group." - }, - "object": { - "type": "string", - "description": "The type of the object that was deleted." - }, - "deleted": { - "type": "boolean" - } - } - } - } - } - } - } - }, - "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 customer group.", - "schema": { - "type": "string" - } - } - ], - "tags": [ - "CustomerGroup" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "customer_group": { - "$ref": "#/components/schemas/customer_group" - } - } - } - } - } - } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { + "context": { "type": "string", - "description": "Name of the customer group" + "description": "Additional infomration regarding the batch to be used for processing." }, - "metadata": { - "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": [ - "CustomerGroup" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "customer_group": { - "$ref": "#/components/schemas/customer_group" - } - } - } - } - } - } - } - } - }, - "/discounts/{id}/regions/{region_id}": { - "post": { - "operationId": "PostDiscountsDiscountRegionsRegion", - "summary": "Adds Region availability", - "description": "Adds a Region to the list of Regions that a Discount can be used in.", - "x-authenticated": true, - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Discount.", - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "region_id", - "required": true, - "description": "The id of the Region.", - "schema": { - "type": "string" - } - } - ], - "tags": [ - "Discount" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "discount": { - "$ref": "#/components/schemas/discount" - } - } - } - } - } - } - } - }, - "delete": { - "operationId": "DeleteDiscountsDiscountRegionsRegion", - "summary": "Remove Region availability", - "x-authenticated": true, - "description": "Removes a Region from the list of Regions that a Discount can be used in.", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Discount.", - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "region_id", - "required": true, - "description": "The id of the Region.", - "schema": { - "type": "string" - } - } - ], - "tags": [ - "Discount" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "discount": { - "$ref": "#/components/schemas/discount" - } - } - } - } - } - } - } - } - }, - "/discounts/{id}/products/{product_id}": { - "post": { - "operationId": "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", - "name": "id", - "required": true, - "description": "The id of the Discount.", - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "product_id", - "required": true, - "description": "The id of the Product.", - "schema": { - "type": "string" - } - } - ], - "tags": [ - "Discount" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "discount": { - "$ref": "#/components/schemas/discount" - } - } - } - } - } - } - } - } - }, - "/discounts": { - "post": { - "operationId": "PostDiscounts", - "summary": "Creates a Discount", - "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", - "description": "A unique code that will be used to redeem the Discount" - }, - "is_dynamic": { - "type": "string", - "description": "Whether the Discount should have multiple instances of itself, each with a different code. This can be useful for automatically generated codes that all have to follow a common set of rules." - }, - "rule": { - "description": "The Discount Rule that defines how Discounts are calculated", - "oneOf": [ - { - "$ref": "#/components/schemas/discount_rule" - } - ] - }, - "is_disabled": { + "dry_run": { "type": "boolean", - "description": "Whether the Discount code is disabled on creation. You will have to enable it later to make it available to Customers." - }, - "starts_at": { - "type": "string", - "format": "date-time", - "description": "The time at which the Discount should be available." - }, - "ends_at": { - "type": "string", - "format": "date-time", - "description": "The time at which the Discount should no longer be available." - }, - "regions": { - "description": "A list of Region ids representing the Regions in which the Discount can be used.", - "type": "array", - "items": { - "type": "string" - } - }, - "usage_limit": { - "type": "number", - "description": "Maximum times the discount can be used" - }, - "metadata": { - "description": "An optional set of key-value pairs to hold additional information.", - "type": "object" - } - } - } - } - } - }, - "tags": [ - "Discount" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "discount": { - "$ref": "#/components/schemas/discount" - } + "description": "Set a batch job in dry_run mode to get some information on what will be done without applying any modifications." } } } @@ -616,338 +362,139 @@ } }, "get": { - "operationId": "GetDiscounts", - "summary": "List Discounts", + "operationId": "GetBatchJobs", + "summary": "List Batch Jobs", + "description": "Retrieve a list of Batch Jobs.", "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", + "description": "The number of collections to return.", "schema": { - "type": "number" + "type": "string" } }, { "in": "query", "name": "offset", - "description": "The offset of items in response", + "description": "The offset of collections to return.", "schema": { - "type": "number" + "type": "string" } }, { "in": "query", - "name": "expand", - "description": "Comma separated list of relations to include in the results.", + "name": "type", + "style": "form", + "explode": false, + "description": "Filter by the batch type", "schema": { - "type": "string" - } - } - ], - "tags": [ - "Discount" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "discount": { - "$ref": "#/components/schemas/discount" - } - } - } + "type": "array", + "items": { + "type": "string" } } - } - } - } - }, - "/discounts/{id}/dynamic-codes": { - "post": { - "operationId": "PostDiscountsDiscountDynamicCodes", - "summary": "Create a dynamic Discount code", - "description": "Creates a unique code that can map to a parent Discount. This is useful if you want to automatically generate codes with the same behaviour.", - "x-authenticated": true, - "parameters": [ + }, { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Discount to create the dynamic code from.\"", + "in": "query", + "name": "confirmed_at", + "style": "form", + "explode": false, + "description": "Date comparison for when resulting collections was confirmed, i.e. less than, greater than etc.", "schema": { - "type": "string" + "type": "object", + "nullable": true } - } - ], - "tags": [ - "Discount" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "discount": { - "$ref": "#/components/schemas/discount" - } - } - } - } - } - } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "code" - ], - "properties": { - "code": { - "type": "string", - "description": "The unique code that will be used to redeem the Discount." - }, - "metadata": { - "type": "object", - "description": "An optional set of key-value paris to hold additional information." - } - } - } - } - } - } - } - }, - "/discounts/{id}": { - "delete": { - "operationId": "DeleteDiscountsDiscount", - "summary": "Delete a Discount", - "description": "Deletes a Discount.", - "x-authenticated": true, - "parameters": [ + }, { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Discount", + "in": "query", + "name": "pre_processed_at", + "style": "form", + "explode": false, + "description": "Date comparison for when resulting collections was pre processed, i.e. less than, greater than etc.", "schema": { - "type": "string" + "type": "object", + "nullable": true } - } - ], - "tags": [ - "Discount" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "id": { - "type": "string", - "description": "The id of the deleted Discount" - }, - "object": { - "type": "string", - "description": "The type of the object that was deleted." - }, - "deleted": { - "type": "boolean" - } - } - } - } - } - } - } - }, - "get": { - "operationId": "GetDiscountsDiscount", - "summary": "Retrieve a Discount", - "description": "Retrieves a Discount", - "x-authenticated": true, - "parameters": [ + }, { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Discount", + "in": "query", + "name": "completed_at", + "style": "form", + "explode": false, + "description": "Date comparison for when resulting collections was completed, i.e. less than, greater than etc.", "schema": { - "type": "string" + "type": "object", + "nullable": true } - } - ], - "tags": [ - "Discount" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "discount": { - "$ref": "#/components/schemas/discount" - } - } - } - } - } - } - } - }, - "post": { - "operationId": "PostDiscountsDiscount", - "summary": "Update a Discount", - "description": "Updates a Discount with a given set of rules that define how the Discount behaves.", - "x-authenticated": true, - "parameters": [ + }, { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Discount.", + "in": "query", + "name": "failed_at", + "style": "form", + "explode": false, + "description": "Date comparison for when resulting collections was failed, i.e. less than, greater than etc.", "schema": { - "type": "string" + "type": "object", + "nullable": true } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "code": { - "type": "string", - "description": "A unique code that will be used to redeem the Discount" - }, - "is_dynamic": { - "type": "string", - "description": "Whether the Discount should have multiple instances of itself, each with a different code. This can be useful for automatically generated codes that all have to follow a common set of rules." - }, - "rule": { - "description": "The Discount Rule that defines how Discounts are calculated", - "oneOf": [ - { - "$ref": "#/components/schemas/discount_rule" - } - ] - }, - "is_disabled": { - "type": "boolean", - "description": "Whether the Discount code is disabled on creation. You will have to enable it later to make it available to Customers." - }, - "starts_at": { - "type": "string", - "format": "date-time", - "description": "The time at which the Discount should be available." - }, - "ends_at": { - "type": "string", - "format": "date-time", - "description": "The time at which the Discount should no longer be available." - }, - "regions": { - "description": "A list of Region ids representing the Regions in which the Discount can be used.", - "type": "array", - "items": { - "type": "string" - } - }, - "metadata": { - "description": "An object containing metadata of the discount", - "type": "object" - } - } - } - } - } - }, - "tags": [ - "Discount" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "discount": { - "$ref": "#/components/schemas/discount" - } - } - } - } - } - } - } - } - }, - "/discounts/{id}/dynamic-codes/{code}": { - "delete": { - "operationId": "DeleteDiscountsDiscountDynamicCodesCode", - "summary": "Delete a dynamic code", - "description": "Deletes a dynamic code from a Discount.", - "x-authenticated": true, - "parameters": [ + }, { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Discount", + "in": "query", + "name": "canceled_at", + "style": "form", + "explode": false, + "description": "Date comparison for when resulting collections was canceled, i.e. less than, greater than etc.", + "schema": { + "type": "object", + "nullable": true + } + }, + { + "in": "query", + "name": "order", + "description": "Order used when retrieving batch jobs", "schema": { "type": "string" } }, { - "in": "path", - "name": "code", - "required": true, - "description": "The id of the Discount", + "in": "query", + "name": "deleted_at", + "style": "form", + "explode": false, + "description": "Date comparison for when resulting collections was deleted, i.e. less than, greater than etc.", "schema": { - "type": "string" + "type": "object", + "nullable": true + } + }, + { + "in": "query", + "name": "created_at", + "style": "form", + "explode": false, + "description": "Date comparison for when resulting collections was created, i.e. less than, greater than etc.", + "schema": { + "type": "object", + "nullable": true + } + }, + { + "in": "query", + "name": "updated_at", + "style": "form", + "explode": false, + "description": "Date comparison for when resulting collections was updated, i.e. less than, greater than etc.", + "schema": { + "type": "object", + "nullable": true } } ], "tags": [ - "Discount" + "Batch Job" ], "responses": { "200": { @@ -956,8 +503,8 @@ "application/json": { "schema": { "properties": { - "discount": { - "$ref": "#/components/schemas/discount" + "batch_job": { + "$ref": "#/components/schemas/batch_job" } } } @@ -967,25 +514,25 @@ } } }, - "/discounts/code/{code}": { + "/batch-jobs/{id}": { "get": { - "operationId": "GetDiscountsDiscountCode", - "summary": "Retrieve a Discount by code", - "description": "Retrieves a Discount by its discount code", + "operationId": "GetBatchJobsBatchJob", + "summary": "Retrieve a Batch Job", + "description": "Retrieves a Batch Job.", "x-authenticated": true, "parameters": [ { "in": "path", - "name": "code", + "name": "id", "required": true, - "description": "The code of the Discount", + "description": "The id of the Batch Job", "schema": { "type": "string" } } ], "tags": [ - "Discount" + "Batch Job" ], "responses": { "200": { @@ -994,8 +541,8 @@ "application/json": { "schema": { "properties": { - "discount": { - "$ref": "#/components/schemas/discount" + "batch_job": { + "$ref": "#/components/schemas/batch_job" } } } @@ -1376,15 +923,15 @@ } } }, - "/auth": { + "/customers": { "post": { - "operationId": "PostAuth", - "summary": "Authenticate a User", - "x-authenticated": false, - "description": "Logs a User in and authorizes them to manage Store settings.", + "operationId": "PostCustomers", + "summary": "Create a Customer", + "description": "Creates a Customer.", + "x-authenticated": true, "parameters": [], "tags": [ - "Auth" + "Customer" ], "responses": { "200": { @@ -1393,8 +940,8 @@ "application/json": { "schema": { "properties": { - "user": { - "$ref": "#/components/schemas/user" + "customer": { + "$ref": "#/components/schemas/customer" } } } @@ -1409,16 +956,29 @@ "type": "object", "required": [ "email", - "password" + "first_name", + "last_name" ], "properties": { "email": { "type": "string", - "description": "The User's email." + "description": "The Customer's email address." }, - "password": { + "first_name": { "type": "string", - "description": "The User's password." + "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." } } } @@ -1427,12 +987,12 @@ } }, "get": { - "operationId": "GetAuth", - "summary": "Get Session", + "operationId": "GetCustomers", + "summary": "List Customers", + "description": "Retrieves a list of Customers.", "x-authenticated": true, - "description": "Gets the currently logged in User.", "tags": [ - "Auth" + "Customer" ], "responses": { "200": { @@ -1441,8 +1001,1471 @@ "application/json": { "schema": { "properties": { - "user": { - "$ref": "#/components/schemas/user" + "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" + } + } + } + } + } + } + } + } + }, + "/discounts/{id}/regions/{region_id}": { + "post": { + "operationId": "PostDiscountsDiscountRegionsRegion", + "summary": "Adds Region availability", + "description": "Adds a Region to the list of Regions that a Discount can be used in.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Discount.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "region_id", + "required": true, + "description": "The id of the Region.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Discount" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "discount": { + "$ref": "#/components/schemas/discount" + } + } + } + } + } + } + } + }, + "delete": { + "operationId": "DeleteDiscountsDiscountRegionsRegion", + "summary": "Remove Region availability", + "x-authenticated": true, + "description": "Removes a Region from the list of Regions that a Discount can be used in.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Discount.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "region_id", + "required": true, + "description": "The id of the Region.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Discount" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "discount": { + "$ref": "#/components/schemas/discount" + } + } + } + } + } + } + } + } + }, + "/discounts/{discount_id}/conditions": { + "post": { + "operationId": "PostDiscountsDiscountConditions", + "summary": "Creates a DiscountCondition", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "discount_id", + "required": true, + "description": "The id of the Product.", + "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" + } + } + ], + "description": "Creates a DiscountCondition", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "operator": { + "description": "Operator of the condition", + "type": "string" + }, + "items": { + "properties": { + "products": { + "type": "array", + "description": "list of products" + }, + "product_types": { + "type": "array", + "description": "list of product types" + }, + "product_collections": { + "type": "array", + "description": "list of product collections" + }, + "product_tags": { + "type": "array", + "description": "list of product tags" + }, + "customer_groups": { + "type": "array", + "description": "list of customer_groups" + } + } + } + } + } + } + } + }, + "tags": [ + "Discount" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "discount": { + "$ref": "#/components/schemas/discount" + } + } + } + } + } + } + } + } + }, + "/discounts": { + "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", + "description": "A unique code that will be used to redeem the Discount" + }, + "is_dynamic": { + "type": "string", + "description": "Whether the Discount should have multiple instances of itself, each with a different code. This can be useful for automatically generated codes that all have to follow a common set of rules." + }, + "rule": { + "description": "The Discount Rule that defines how Discounts are calculated", + "oneOf": [ + { + "$ref": "#/components/schemas/discount_rule" + } + ] + }, + "is_disabled": { + "type": "boolean", + "description": "Whether the Discount code is disabled on creation. You will have to enable it later to make it available to Customers." + }, + "starts_at": { + "type": "string", + "format": "date-time", + "description": "The time at which the Discount should be available." + }, + "ends_at": { + "type": "string", + "format": "date-time", + "description": "The time at which the Discount should no longer be available." + }, + "regions": { + "description": "A list of Region ids representing the Regions in which the Discount can be used.", + "type": "array", + "items": { + "type": "string" + } + }, + "usage_limit": { + "type": "number", + "description": "Maximum times the discount can be used" + }, + "metadata": { + "description": "An optional set of key-value pairs to hold additional information.", + "type": "object" + } + } + } + } + } + }, + "tags": [ + "Discount" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "discount": { + "$ref": "#/components/schemas/discount" + } + } + } + } + } + } + } + }, + "get": { + "operationId": "GetDiscounts", + "summary": "List Discounts", + "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" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "discount": { + "$ref": "#/components/schemas/discount" + } + } + } + } + } + } + } + } + }, + "/discounts/{id}/dynamic-codes": { + "post": { + "operationId": "PostDiscountsDiscountDynamicCodes", + "summary": "Create a dynamic Discount code", + "description": "Creates a unique code that can map to a parent Discount. This is useful if you want to automatically generate codes with the same behaviour.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Discount to create the dynamic code from.\"", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Discount" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "discount": { + "$ref": "#/components/schemas/discount" + } + } + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "code", + "usage_limit" + ], + "properties": { + "code": { + "type": "string", + "description": "The unique code that will be used to redeem the Discount." + }, + "usage_limit": { + "type": "number", + "description": "amount of times the discount can be applied" + }, + "metadata": { + "type": "object", + "description": "An optional set of key-value paris to hold additional information." + } + } + } + } + } + } + } + }, + "/discounts/{discount_id}/conditions/{condition_id}": { + "delete": { + "operationId": "DeleteDiscountsDiscountConditionsCondition", + "summary": "Delete a DiscountCondition", + "description": "Deletes a DiscountCondition", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Discount", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "condition_id", + "required": true, + "description": "The id of the DiscountCondition", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Discount" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "id": { + "type": "string", + "description": "The id of the deleted DiscountCondition" + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted." + }, + "deleted": { + "type": "boolean" + }, + "discount": { + "type": "object", + "description": "The Discount to which the condition used to belong" + } + } + } + } + } + } + } + }, + "get": { + "operationId": "GetDiscountsDiscountConditionsCondition", + "summary": "Gets a DiscountCondition", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "discount_id", + "required": true, + "description": "The id of the Discount.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "condition_id", + "required": true, + "description": "The id of the DiscountCondition.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the results.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the results.", + "schema": { + "type": "string" + } + } + ], + "description": "Gets a DiscountCondition", + "tags": [ + "DiscountCondition" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "discount_condition": { + "$ref": "#/components/schemas/discount_condition" + } + } + } + } + } + } + } + }, + "post": { + "operationId": "PostDiscountsDiscountConditionsCondition", + "summary": "Updates a DiscountCondition", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "discount_id", + "required": true, + "description": "The id of the Product.", + "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" + } + } + ], + "description": "Updates a DiscountCondition", + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "id" + ], + "properties": { + "items": { + "properties": { + "products": { + "type": "array", + "description": "list of products" + }, + "product_types": { + "type": "array", + "description": "list of product types" + }, + "product_collections": { + "type": "array", + "description": "list of product collections" + }, + "product_tags": { + "type": "array", + "description": "list of product tags" + }, + "customer_groups": { + "type": "array", + "description": "list of customer_groups" + } + } + } + } + } + } + } + }, + "tags": [ + "Discount" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "discount": { + "$ref": "#/components/schemas/discount" + } + } + } + } + } + } + } + } + }, + "/discounts/{id}": { + "delete": { + "operationId": "DeleteDiscountsDiscount", + "summary": "Delete a Discount", + "description": "Deletes a Discount.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Discount", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Discount" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "id": { + "type": "string", + "description": "The id of the deleted Discount" + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted." + }, + "deleted": { + "type": "boolean" + } + } + } + } + } + } + } + }, + "get": { + "operationId": "GetDiscountsDiscount", + "summary": "Retrieve a Discount", + "description": "Retrieves a Discount", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Discount", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated list of relations to include in the results.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated list of fields to include in the results.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Discount" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "discount": { + "$ref": "#/components/schemas/discount" + } + } + } + } + } + } + } + }, + "post": { + "operationId": "PostDiscountsDiscount", + "summary": "Update a Discount", + "description": "Updates a Discount with a given set of rules that define how the Discount behaves.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Discount.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "code": { + "type": "string", + "description": "A unique code that will be used to redeem the Discount" + }, + "rule": { + "description": "The Discount Rule that defines how Discounts are calculated", + "oneOf": [ + { + "$ref": "#/components/schemas/discount_rule" + } + ] + }, + "is_disabled": { + "type": "boolean", + "description": "Whether the Discount code is disabled on creation. You will have to enable it later to make it available to Customers." + }, + "starts_at": { + "type": "string", + "format": "date-time", + "description": "The time at which the Discount should be available." + }, + "ends_at": { + "type": "string", + "format": "date-time", + "description": "The time at which the Discount should no longer be available." + }, + "regions": { + "description": "A list of Region ids representing the Regions in which the Discount can be used.", + "type": "array", + "items": { + "type": "string" + } + }, + "metadata": { + "description": "An object containing metadata of the discount", + "type": "object" + } + } + } + } + } + }, + "tags": [ + "Discount" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "discount": { + "$ref": "#/components/schemas/discount" + } + } + } + } + } + } + } + } + }, + "/discounts/{id}/dynamic-codes/{code}": { + "delete": { + "operationId": "DeleteDiscountsDiscountDynamicCodesCode", + "summary": "Delete a dynamic code", + "description": "Deletes a dynamic code from a Discount.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Discount", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "code", + "required": true, + "description": "The id of the Discount", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Discount" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "discount": { + "$ref": "#/components/schemas/discount" + } + } + } + } + } + } + } + } + }, + "/discounts/code/{code}": { + "get": { + "operationId": "GetDiscountsDiscountCode", + "summary": "Retrieve a Discount by code", + "description": "Retrieves a Discount by its discount code", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "code", + "required": true, + "description": "The code of the Discount", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Discount" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "discount": { + "$ref": "#/components/schemas/discount" + } + } + } + } + } + } + } + } + }, + "/customer-groups/{id}/customers/batch": { + "post": { + "operationId": "PostCustomerGroupsGroupCustomersBatch", + "summary": "Add a list of customers to a customer group ", + "description": "Adds a list of customers, represented by id's, to a customer group.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the customer group.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "customers": { + "description": "The ids of the customers to add", + "type": "array", + "items": { + "required": [ + "id" + ], + "properties": { + "id": { + "description": "Id of the customer", + "type": "string" + } + } + } + } + } + } + } + } + }, + "tags": [ + "CustomerGroup" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "customerGroup": { + "$ref": "#/components/schemas/customer_group" + } + } + } + } + } + } + } + }, + "delete": { + "operationId": "DeleteCustomerGroupsGroupCustomerBatch", + "summary": "Remove a list of customers from a customer group ", + "description": "Removes a list of customers, represented by id's, from a customer group.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the customer group.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "customers": { + "description": "The ids of the customers to remove", + "type": "array", + "items": { + "required": [ + "id" + ], + "properties": { + "id": { + "description": "Id of the customer", + "type": "string" + } + } + } + } + } + } + } + } + }, + "tags": [ + "CustomerGroup" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "customerGroup": { + "$ref": "#/components/schemas/customer_group" + } + } + } + } + } + } + } + } + }, + "/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" + } + } + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the customer group" + }, + "metadata": { + "type": "object", + "description": "Metadata for the customer." + } + } + } + } + } + } + }, + "get": { + "operationId": "GetCustomerGroups", + "summary": "Retrieve a list of customer groups", + "description": "Retrieve a list of customer groups.", + "x-authenticated": true, + "parameters": [ + { + "in": "query", + "name": "q", + "description": "Query used for searching user group names.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "offset", + "description": "How many groups to skip in the result.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "id", + "description": "Ids of the groups to search for.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "order", + "description": "to retrieve customer groups in.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "created_at", + "description": "Date comparison for when resulting customer group was created, i.e. less than, greater than etc.", + "schema": { + "type": "object" + } + }, + { + "in": "query", + "name": "updated_at", + "description": "Date comparison for when resulting ustomer group was updated, i.e. less than, greater than etc.", + "schema": { + "type": "object" + } + }, + { + "in": "query", + "name": "limit", + "description": "Limit the number of customer groups returned.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "(Comma separated) Which fields should be expanded in each customer groups of the result.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "CustomerGroup" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "customerGroup": { + "$ref": "#/components/schemas/customer_group" + } + } + } + } + } + } + } + } + }, + "/customer-groups/{id}": { + "delete": { + "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 Customer Group", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "CustomerGroup" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "id": { + "type": "string", + "description": "The id of the deleted customer group." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted." + }, + "deleted": { + "type": "boolean" + } + } + } + } + } + } + } + }, + "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": [ + "CustomerGroup" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "customer_group": { + "$ref": "#/components/schemas/customer_group" + } + } + } + } + } + } + } + }, + "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 customer group.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "CustomerGroup" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "customer_group": { + "$ref": "#/components/schemas/customer_group" + } + } + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "type": "string", + "description": "Name of the customer group" + }, + "metadata": { + "type": "object", + "description": "Metadata for the customer." + } + } + } + } + } + } + } + }, + "/customer-groups/{id}/customers": { + "get": { + "operationId": "GetCustomerGroupsGroupCustomers", + "summary": "List Customers", + "description": "Retrieves a list of Customers.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the customer group.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Customer" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "customer": { + "$ref": "#/components/schemas/customer" } } } @@ -2021,230 +3044,6 @@ } } }, - "/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", @@ -3057,83 +3856,6 @@ } } }, - "/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", @@ -5227,6 +5949,915 @@ } } }, + "/price-lists/{id}/prices/batch": { + "post": { + "operationId": "PostPriceListsPriceListPricesBatch", + "summary": "Batch update prices for a Price List", + "description": "Batch update prices for a Price List", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Price List to update prices for.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "prices": { + "description": "The prices to update or add.", + "type": "array", + "items": { + "properties": { + "id": { + "description": "The id of the price.", + "type": "string" + }, + "status": { + "description": "The status of the Price List.", + "type": "string", + "enum": [ + "active", + "draft" + ] + }, + "region_id": { + "description": "The id of the Region for which the price is used.", + "type": "string" + }, + "currency_code": { + "description": "The 3 character ISO currency code for which the price will be used.", + "type": "string" + }, + "amount": { + "description": "The amount of the price.", + "type": "number" + }, + "min_quantity": { + "description": "The minimum quantity for which the price will be used.", + "type": "number" + }, + "max_quantity": { + "description": "The maximum quantity for which the price will be used.", + "type": "number" + } + } + } + }, + "override": { + "description": "If true the prices will replace all existing prices associated with the Price List.", + "type": "boolean" + } + } + } + } + } + }, + "tags": [ + "Price List" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "id": { + "type": "string", + "description": "The id of the deleted Price List." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted." + }, + "deleted": { + "type": "boolean" + } + } + } + } + } + } + } + }, + "delete": { + "operationId": "DeletePriceListsPriceListPricesBatch", + "summary": "Batch delete prices that belongs to a Price List", + "description": "Batch delete prices that belongs to a Price List", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Price List that the Money Amounts that will be deleted belongs to.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "price_ids": { + "description": "The price id's of the Money Amounts to delete.", + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + }, + "tags": [ + "Price List" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "ids": { + "type": "array", + "items": { + "type": "string", + "description": "The id of the deleted Money Amount." + } + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted." + }, + "deleted": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "/price_lists": { + "post": { + "operationId": "PostPriceListsPriceList", + "summary": "Creates a Price List", + "description": "Creates a Price List", + "x-authenticated": true, + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "name": { + "description": "The name of the Price List", + "type": "string" + }, + "description": { + "description": "A description of the Price List.", + "type": "string" + }, + "type": { + "description": "The type of the Price List.", + "type": "string", + "enum": [ + "sale", + "override" + ] + }, + "status": { + "description": "The status of the Price List.", + "type": "string", + "enum": [ + "active", + "draft" + ] + }, + "prices": { + "description": "The prices of the Price List.", + "type": "array", + "items": { + "properties": { + "region_id": { + "description": "The id of the Region for which the price is used.", + "type": "string" + }, + "currency_code": { + "description": "The 3 character ISO currency code for which the price will be used.", + "type": "string" + }, + "amount": { + "description": "The amount to charge for the Product Variant.", + "type": "integer" + }, + "min_quantity": { + "description": "The minimum quantity for which the price will be used.", + "type": "integer" + }, + "max_quantity": { + "description": "The maximum quantity for which the price will be used.", + "type": "integer" + } + } + } + }, + "customer_groups": { + "type": "array", + "description": "A list of customer groups that the Price List applies to.", + "items": { + "required": [ + "id" + ], + "properties": { + "id": { + "description": "The id of a customer group", + "type": "string" + } + } + } + } + } + } + } + } + }, + "tags": [ + "Price List" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "product": { + "$ref": "#/components/schemas/price_list" + } + } + } + } + } + } + } + } + }, + "/price-lists/{id}": { + "delete": { + "operationId": "DeletePriceListsPriceList", + "summary": "Delete a Price List", + "description": "Deletes a Price List", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Price List to delete.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Price List" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "id": { + "type": "string", + "description": "The id of the deleted Price List." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted." + }, + "deleted": { + "type": "boolean" + } + } + } + } + } + } + } + }, + "get": { + "operationId": "GetPriceListsPriceList", + "summary": "Retrieve a Price List", + "description": "Retrieves a Price List.", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Price List.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Price List" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "price_list": { + "$ref": "#/components/schemas/price_list" + } + } + } + } + } + } + } + } + }, + "/price-lists/{id}/products/{product_id}/prices": { + "delete": { + "operationId": "DeletePriceListsPriceListProductsProductPrices", + "summary": "Delete all the prices related to a specific product in a price list", + "description": "Delete all the prices related to a specific product in a price list", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Price List that the Money Amounts that will be deleted belongs to.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "product_id", + "required": true, + "description": "The id of the product from which the money amount will be deleted.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Price List" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "ids": { + "type": "number", + "description": "The price ids that have been deleted." + }, + "count": { + "type": "number", + "description": "The number of prices that have been deleted." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted." + }, + "deleted": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "/price-lists/{id}/variants/{variant_id}/prices": { + "delete": { + "operationId": "DeletePriceListsPriceListVariantsVariantPrices", + "summary": "Delete all the prices related to a specific variant in a price list", + "description": "Delete all the prices related to a specific variant in a price list", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Price List that the Money Amounts that will be deleted belongs to.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "variant_id", + "required": true, + "description": "The id of the variant from which the money amount will be deleted.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Price List" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "ids": { + "type": "number", + "description": "The price ids that have been deleted." + }, + "count": { + "type": "number", + "description": "The number of prices that have been deleted." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted." + }, + "deleted": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "/price-lists/:id/products": { + "get": { + "operationId": "GetPriceListsPriceListProducts", + "summary": "List Product in a Price List", + "description": "Retrieves a list of Product that are part of a Price List", + "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", + "description": "Status to search for", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "collection_id", + "description": "Collection ids to search for", + "style": "form", + "explode": false, + "schema": { + "type": "array", + "items": { + "type": "string" + } + } + }, + { + "in": "query", + "name": "tags", + "description": "Tags to search for", + "style": "form", + "explode": false, + "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": "string" + } + }, + { + "in": "query", + "name": "created_at", + "description": "Date comparison for when resulting products was created, i.e. less than, greater than etc.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "updated_at", + "description": "Date comparison for when resulting products was updated, i.e. less than, greater than etc.", + "schema": { + "type": "string" + } + }, + { + "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" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "count": { + "description": "The number of Products.", + "type": "integer" + }, + "offset": { + "description": "The offset of the Product query.", + "type": "integer" + }, + "limit": { + "description": "The limit of the Product query.", + "type": "integer" + }, + "products": { + "type": "array", + "items": { + "$ref": "#/components/schemas/product" + } + } + } + } + } + } + } + } + } + }, + "/price-lists": { + "get": { + "operationId": "GetPriceLists", + "summary": "List Price Lists", + "description": "Retrieves a list of Price Lists.", + "x-authenticated": true, + "tags": [ + "Price List" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "price_lists": { + "type": "array", + "items": { + "$ref": "#/components/schemas/price_list" + } + }, + "count": { + "description": "The number of Price Lists.", + "type": "integer" + }, + "offset": { + "description": "The offset of the Price List query.", + "type": "integer" + }, + "limit": { + "description": "The limit of the Price List query.", + "type": "integer" + } + } + } + } + } + } + } + } + }, + "/price_lists/{id}": { + "post": { + "operationId": "PostPriceListsPriceListPriceList", + "summary": "Update a Price List", + "description": "Updates a Price List", + "x-authenticated": true, + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Price List.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "name": { + "description": "The name of the Price List", + "type": "string" + }, + "description": { + "description": "A description of the Price List.", + "type": "string" + }, + "type": { + "description": "The type of the Price List.", + "type": "string", + "enum": [ + "sale", + "override" + ] + }, + "status": { + "description": "The status of the Price List.", + "type": "string", + "enum": [ + "active", + "draft" + ] + }, + "prices": { + "description": "The prices of the Price List.", + "type": "array", + "items": { + "properties": { + "id": { + "description": "The id of the price.", + "type": "string" + }, + "region_id": { + "description": "The id of the Region for which the price is used.", + "type": "string" + }, + "currency_code": { + "description": "The 3 character ISO currency code for which the price will be used.", + "type": "string" + }, + "amount": { + "description": "The amount to charge for the Product Variant.", + "type": "integer" + }, + "min_quantity": { + "description": "The minimum quantity for which the price will be used.", + "type": "integer" + }, + "max_quantity": { + "description": "The maximum quantity for which the price will be used.", + "type": "integer" + } + } + } + }, + "customer_groups": { + "type": "array", + "description": "A list of customer groups that the Price List applies to.", + "items": { + "required": [ + "id" + ], + "properties": { + "id": { + "description": "The id of a customer group", + "type": "string" + } + } + } + } + } + } + } + } + }, + "tags": [ + "Price List" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "product": { + "$ref": "#/components/schemas/price_list" + } + } + } + } + } + } + } + } + }, + "/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" + } + } + } + } + } + } + } + } + }, "/product-types": { "get": { "operationId": "GetProductTypes", @@ -5932,8 +7563,12 @@ "description": "The amount to charge for the Product Variant.", "type": "integer" }, - "sale_amount": { - "description": "The sale amount to charge for the Product Variant.", + "min_quantity": { + "description": "The minimum quantity for which the price will be used.", + "type": "integer" + }, + "max_quantity": { + "description": "The maximum quantity for which the price will be used.", "type": "integer" } } @@ -5989,7 +7624,39 @@ "in": "path", "name": "id", "required": true, - "description": "The id of the Product.", + "description": "Id of the product to search for the variants.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "fields", + "description": "Comma separated string of the column to select.", + "schema": { + "type": "string" + } + }, + { + "in": "query", + "name": "expand", + "description": "Comma separated string of the relations to include.", + "schema": { + "type": "string" + } + }, + { + "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" } @@ -6642,6 +8309,10 @@ "type": "array", "items": { "properties": { + "id": { + "description": "The id of the price.", + "type": "string" + }, "region_id": { "description": "The id of the Region for which the price is used.", "type": "string" @@ -6654,8 +8325,12 @@ "description": "The amount to charge for the Product Variant.", "type": "integer" }, - "sale_amount": { - "description": "The sale amount to charge for the Product Variant.", + "min_quantity": { + "description": "The minimum quantity for which the price will be used.", + "type": "integer" + }, + "max_quantity": { + "description": "The maximum quantity for which the price will be used.", "type": "integer" } } @@ -9636,6 +11311,89 @@ } } }, + "batch_job": { + "title": "Batch Job", + "description": "A Batch Job.", + "x-resourceId": "batch_job", + "properties": { + "id": { + "description": "The unique identifier for the batch job.", + "type": "string" + }, + "type": { + "description": "The type of batch job.", + "type": "string", + "enum": [ + "product_import", + "product_export" + ] + }, + "status": { + "description": "The status of the batch job.", + "type": "string", + "enum": [ + "created", + "pre_processed", + "processing", + "completed", + "canceled", + "failed" + ] + }, + "created_by": { + "description": "The unique identifier of the user that created the batch job.", + "type": "string" + }, + "context": { + "description": "The context of the batch job, the type of the batch job determines what the context should contain.", + "type": "object" + }, + "dry_run": { + "description": "Specify if the job must apply the modifications or not.", + "type": "boolean", + "default": false + }, + "result": { + "description": "The result of the batch job.", + "type": "object" + }, + "pre_processed_at": { + "description": "The date from which the job has been pre processed.", + "type": "string", + "format": "date-time" + }, + "confirmed_at": { + "description": "The date when the confirmation has been done.", + "type": "string", + "format": "date-time" + }, + "completed_at": { + "description": "The date of the completion.", + "type": "string", + "format": "date-time" + }, + "canceled_at": { + "description": "The date of the concellation.", + "type": "string", + "format": "date-time" + }, + "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" + } + } + }, "cart": { "title": "Cart", "description": "Represents a user cart", @@ -10198,6 +11956,217 @@ } } }, + "discount_condition_customer_group": { + "title": "Product Tag Discount Condition", + "description": "Associates a discount condition with a customer group", + "x-resourceId": "discount_condition_customer_group", + "properties": { + "customer_group_id": { + "description": "The id of the Product Tag", + "type": "string" + }, + "condition_id": { + "description": "The id of the Discount Condition", + "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" + } + } + }, + "discount_condition_product_collection": { + "title": "Product Collection Discount Condition", + "description": "Associates a discount condition with a product collection", + "x-resourceId": "discount_condition_product_collection", + "properties": { + "product_collection_id": { + "description": "The id of the Product Collection", + "type": "string" + }, + "condition_id": { + "description": "The id of the Discount Condition", + "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" + } + } + }, + "discount_condition_product_tag": { + "title": "Product Tag Discount Condition", + "description": "Associates a discount condition with a product tag", + "x-resourceId": "discount_condition_product_tag", + "properties": { + "product_tag_id": { + "description": "The id of the Product Tag", + "type": "string" + }, + "condition_id": { + "description": "The id of the Discount Condition", + "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" + } + } + }, + "discount_condition_product_type": { + "title": "Product Type Discount Condition", + "description": "Associates a discount condition with a product type", + "x-resourceId": "discount_condition_product", + "properties": { + "product_type_id": { + "description": "The id of the Product Type", + "type": "string" + }, + "condition_id": { + "description": "The id of the Discount Condition", + "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" + } + } + }, + "discount_condition_product": { + "title": "Product Discount Condition", + "description": "Associates a discount condition with a product", + "x-resourceId": "discount_condition_product", + "properties": { + "product_id": { + "description": "The id of the Product", + "type": "string" + }, + "condition_id": { + "description": "The id of the Discount Condition", + "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" + } + } + }, + "discount_condition": { + "title": "Discount Condition", + "description": "Holds rule conditions for when a discount is applicable", + "x-resourceId": "discount_condition", + "properties": { + "id": { + "description": "The id of the Discount Condition. Will be prefixed by `discon_`.", + "type": "string" + }, + "type": { + "description": "The type of the Condition", + "type": "string", + "enum": [ + "products", + "product_types", + "product_collections", + "product_tags", + "customer_groups" + ] + }, + "created_at": { + "description": "The date with timezone at which the resource was created.", + "type": "string", + "format": "date-time" + }, + "update_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" + } + } + }, "discount_rule": { "title": "Discount Rule", "description": "Holds the rules that governs how a Discount is calculated when applied to a Cart.", @@ -10232,11 +12201,11 @@ "item" ] }, - "valid_for": { - "description": "A set of Products that the discount can be used for.", + "conditions": { + "description": "A set of conditions that can be used to limit when the discount can be used", "type": "array", "items": { - "$ref": "#/components/schemas/product" + "$ref": "#/components/schemas/discount_condition" } }, "created_at": { @@ -10828,8 +12797,12 @@ "description": "The amount in the smallest currecny unit (e.g. cents 100 cents to charge $1) that the Product Variant will cost.", "type": "integer" }, - "sale_amount": { - "description": "An optional sale amount that the Product Variant will be available for when defined.", + "min_quantity": { + "description": "The minimum quantity that the Money Amount applies to. If this value is not set, the Money Amount applies to all quantities.", + "type": "integer" + }, + "max_quantity": { + "description": "The maximum quantity that the Money Amount applies to. If this value is not set, the Money Amount applies to all quantities.", "type": "integer" }, "variant_id": { @@ -11426,6 +13399,57 @@ } } }, + "price_list": { + "title": "Price List", + "description": "Price Lists represents a set of prices that overrides the default price for one or more product variants.", + "x-resourceId": "price_list", + "properties": { + "id": { + "description": "The id of the Price List. This value will be prefixed by `pl_`.", + "type": "string" + }, + "type": { + "description": "The type of Price List. This can be one of either `sale` or `override`.", + "type": "string", + "enum": [ + "sale", + "override" + ] + }, + "starts_at": { + "description": "The date with timezone that the Price List starts being valid.", + "type": "string", + "format": "date-time" + }, + "ends_at": { + "description": "The date with timezone that the Price List stops being valid.", + "type": "string", + "format": "date-time" + }, + "customer_groups": { + "description": "The Customer Groups that the Price List applies to.", + "type": "array", + "items": { + "$ref": "#/components/schemas/customer_group" + } + }, + "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" + } + } + }, "product_collection": { "title": "Product Collection", "description": "Product Collections represents a group of Products that are related.", diff --git a/docs/api/admin-spec3.yaml b/docs/api/admin-spec3.yaml index 8c42b10226..d0b8b87f7d 100644 --- a/docs/api/admin-spec3.yaml +++ b/docs/api/admin-spec3.yaml @@ -140,6 +140,240 @@ paths: properties: user: $ref: '#/components/schemas/user' + '/batch-jobs/{id}/cancel': + post: + operationId: PostBatchJobsBatchJobCancel + summary: Marks a batch job as canceled + description: Marks a batch job as canceled + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The id of the batch job. + schema: + type: string + tags: + - Batch Job + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + batch_job: + $ref: '#/components/schemas/batch_job' + '/batch-jobs/{id}/confirm': + post: + operationId: PostBatchJobsBatchJobConfirmProcessing + summary: Confirm a batch job + description: Confirms that a previously requested batch job should be executed. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The id of the batch job. + schema: + type: string + tags: + - Batch Job + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + batch_job: + $ref: '#/components/schemas/batch_job' + /batch-jobs: + post: + operationId: PostBatchJobs + summary: Create a Batch Job + description: Creates a Batch Job. + x-authenticated: true + parameters: [] + tags: + - Batch Job + responses: + '201': + description: OK + content: + application/json: + schema: + properties: + batch_job: + $ref: '#/components/schemas/batch_job' + requestBody: + content: + application/json: + schema: + type: object + required: + - type + - context + - dry_run + properties: + type: + type: string + description: The type of batch job to start. + context: + type: string + description: >- + Additional infomration regarding the batch to be used for + processing. + dry_run: + type: boolean + description: >- + Set a batch job in dry_run mode to get some information on + what will be done without applying any modifications. + get: + operationId: GetBatchJobs + summary: List Batch Jobs + description: Retrieve a list of Batch Jobs. + 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: type + style: form + explode: false + description: Filter by the batch type + schema: + type: array + items: + type: string + - in: query + name: confirmed_at + style: form + explode: false + description: >- + Date comparison for when resulting collections was confirmed, i.e. + less than, greater than etc. + schema: + type: object + nullable: true + - in: query + name: pre_processed_at + style: form + explode: false + description: >- + Date comparison for when resulting collections was pre processed, + i.e. less than, greater than etc. + schema: + type: object + nullable: true + - in: query + name: completed_at + style: form + explode: false + description: >- + Date comparison for when resulting collections was completed, i.e. + less than, greater than etc. + schema: + type: object + nullable: true + - in: query + name: failed_at + style: form + explode: false + description: >- + Date comparison for when resulting collections was failed, i.e. less + than, greater than etc. + schema: + type: object + nullable: true + - in: query + name: canceled_at + style: form + explode: false + description: >- + Date comparison for when resulting collections was canceled, i.e. + less than, greater than etc. + schema: + type: object + nullable: true + - in: query + name: order + description: Order used when retrieving batch jobs + schema: + type: string + - in: query + name: deleted_at + style: form + explode: false + description: >- + Date comparison for when resulting collections was deleted, i.e. + less than, greater than etc. + schema: + type: object + nullable: true + - in: query + name: created_at + style: form + explode: false + description: >- + Date comparison for when resulting collections was created, i.e. + less than, greater than etc. + schema: + type: object + nullable: true + - in: query + name: updated_at + style: form + explode: false + description: >- + Date comparison for when resulting collections was updated, i.e. + less than, greater than etc. + schema: + type: object + nullable: true + tags: + - Batch Job + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + batch_job: + $ref: '#/components/schemas/batch_job' + '/batch-jobs/{id}': + get: + operationId: GetBatchJobsBatchJob + summary: Retrieve a Batch Job + description: Retrieves a Batch Job. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The id of the Batch Job + schema: + type: string + tags: + - Batch Job + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + batch_job: + $ref: '#/components/schemas/batch_job' '/collections/{id}/products/batch': post: operationId: PostProductsToCollection @@ -394,6 +628,83 @@ paths: properties: collection: $ref: '#/components/schemas/product_collection' + '/customer-groups/{id}/customers/batch': + post: + operationId: PostCustomerGroupsGroupCustomersBatch + summary: 'Add a list of customers to a customer group ' + description: 'Adds a list of customers, represented by id''s, to a customer group.' + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The id of the customer group. + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + customers: + description: The ids of the customers to add + type: array + items: + required: + - id + properties: + id: + description: Id of the customer + type: string + tags: + - CustomerGroup + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + customerGroup: + $ref: '#/components/schemas/customer_group' + delete: + operationId: DeleteCustomerGroupsGroupCustomerBatch + summary: 'Remove a list of customers from a customer group ' + description: 'Removes a list of customers, represented by id''s, from a customer group.' + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The id of the customer group. + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + customers: + description: The ids of the customers to remove + type: array + items: + required: + - id + properties: + id: + description: Id of the customer + type: string + tags: + - CustomerGroup + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + customerGroup: + $ref: '#/components/schemas/customer_group' /customer-groups: post: operationId: PostCustomerGroups @@ -426,6 +737,69 @@ paths: metadata: type: object description: Metadata for the customer. + get: + operationId: GetCustomerGroups + summary: Retrieve a list of customer groups + description: Retrieve a list of customer groups. + x-authenticated: true + parameters: + - in: query + name: q + description: Query used for searching user group names. + schema: + type: string + - in: query + name: offset + description: How many groups to skip in the result. + schema: + type: string + - in: query + name: id + description: Ids of the groups to search for. + schema: + type: string + - in: query + name: order + description: to retrieve customer groups in. + schema: + type: string + - in: query + name: created_at + description: >- + Date comparison for when resulting customer group was created, i.e. + less than, greater than etc. + schema: + type: object + - in: query + name: updated_at + description: >- + Date comparison for when resulting ustomer group was updated, i.e. + less than, greater than etc. + schema: + type: object + - in: query + name: limit + description: Limit the number of customer groups returned. + schema: + type: string + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each customer + groups of the result. + schema: + type: string + tags: + - CustomerGroup + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + customerGroup: + $ref: '#/components/schemas/customer_group' '/customer-groups/{id}': delete: operationId: DeleteCustomerGroupsCustomerGroup @@ -456,6 +830,29 @@ paths: description: The type of the object that was deleted. deleted: type: boolean + 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: + - CustomerGroup + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + customer_group: + $ref: '#/components/schemas/customer_group' post: operationId: PostCustomerGroupsGroup summary: Update a CustomerGroup @@ -493,21 +890,21 @@ paths: metadata: type: object description: Metadata for the customer. - '/customer-group/{id}': + '/customer-groups/{id}/customers': get: - operationId: GetCustomerGroupsGroup - summary: Retrieve a CustomerGroup - description: Retrieves a Customer Group. + operationId: GetCustomerGroupsGroupCustomers + summary: List Customers + description: Retrieves a list of Customers. x-authenticated: true parameters: - in: path name: id required: true - description: The id of the Customer Group. + description: The id of the customer group. schema: type: string tags: - - CustomerGroup + - Customer responses: '200': description: OK @@ -515,8 +912,8 @@ paths: application/json: schema: properties: - customer_group: - $ref: '#/components/schemas/customer_group' + customer: + $ref: '#/components/schemas/customer' /customers: post: operationId: PostCustomers @@ -727,56 +1124,58 @@ paths: properties: discount: $ref: '#/components/schemas/discount' - '/discounts/{id}/products/{product_id}': + '/discounts/{discount_id}/conditions': post: - operationId: PostDiscountsDiscountProductsProduct - summary: Adds Product availability - description: Adds a Product to the list of Products that a Discount can be used for. + operationId: PostDiscountsDiscountConditions + summary: Creates a DiscountCondition x-authenticated: true parameters: - in: path - name: id - required: true - description: The id of the Discount. - schema: - type: string - - in: path - name: product_id + name: discount_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 - name: id - required: true - description: The id of the Discount. + - in: query + name: expand + description: >- + (Comma separated) Which fields should be expanded in each product of + the result. schema: type: string - - in: path - name: product_id - required: true - description: The id of the Product. + - in: query + name: fields + description: >- + (Comma separated) Which fields should be included in each product of + the result. schema: type: string + description: Creates a DiscountCondition + requestBody: + content: + application/json: + schema: + properties: + operator: + description: Operator of the condition + type: string + items: + properties: + products: + type: array + description: list of products + product_types: + type: array + description: list of product types + product_collections: + type: array + description: list of product collections + product_tags: + type: array + description: list of product tags + customer_groups: + type: array + description: list of customer_groups tags: - Discount responses: @@ -939,15 +1338,158 @@ paths: type: object required: - code + - usage_limit properties: code: type: string description: The unique code that will be used to redeem the Discount. + usage_limit: + type: number + description: amount of times the discount can be applied metadata: type: object description: >- An optional set of key-value paris to hold additional information. + '/discounts/{discount_id}/conditions/{condition_id}': + delete: + operationId: DeleteDiscountsDiscountConditionsCondition + summary: Delete a DiscountCondition + description: Deletes a DiscountCondition + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The id of the Discount + schema: + type: string + - in: path + name: condition_id + required: true + description: The id of the DiscountCondition + schema: + type: string + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + id: + type: string + description: The id of the deleted DiscountCondition + object: + type: string + description: The type of the object that was deleted. + deleted: + type: boolean + discount: + type: object + description: The Discount to which the condition used to belong + get: + operationId: GetDiscountsDiscountConditionsCondition + summary: Gets a DiscountCondition + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The id of the Discount. + schema: + type: string + - in: path + name: condition_id + required: true + description: The id of the DiscountCondition. + schema: + type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string + description: Gets a DiscountCondition + tags: + - DiscountCondition + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + discount_condition: + $ref: '#/components/schemas/discount_condition' + post: + operationId: PostDiscountsDiscountConditionsCondition + summary: Updates a DiscountCondition + x-authenticated: true + parameters: + - in: path + name: discount_id + required: true + description: The id of the Product. + 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 + description: Updates a DiscountCondition + requestBody: + content: + application/json: + schema: + required: + - id + properties: + items: + properties: + products: + type: array + description: list of products + product_types: + type: array + description: list of product types + product_collections: + type: array + description: list of product collections + product_tags: + type: array + description: list of product tags + customer_groups: + type: array + description: list of customer_groups + tags: + - Discount + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + discount: + $ref: '#/components/schemas/discount' '/discounts/{id}': delete: operationId: DeleteDiscountsDiscount @@ -990,6 +1532,16 @@ paths: description: The id of the Discount schema: type: string + - in: query + name: expand + description: Comma separated list of relations to include in the results. + schema: + type: string + - in: query + name: fields + description: Comma separated list of fields to include in the results. + schema: + type: string tags: - Discount responses: @@ -1023,13 +1575,6 @@ paths: code: type: string description: A unique code that will be used to redeem the Discount - is_dynamic: - type: string - description: >- - Whether the Discount should have multiple instances of - itself, each with a different code. This can be useful for - automatically generated codes that all have to follow a - common set of rules. rule: description: The Discount Rule that defines how Discounts are calculated oneOf: @@ -3526,6 +4071,578 @@ paths: properties: order: $ref: '#/components/schemas/order' + '/price-lists/{id}/prices/batch': + post: + operationId: PostPriceListsPriceListPricesBatch + summary: Batch update prices for a Price List + description: Batch update prices for a Price List + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The id of the Price List to update prices for. + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + prices: + description: The prices to update or add. + type: array + items: + properties: + id: + description: The id of the price. + type: string + status: + description: The status of the Price List. + type: string + enum: + - active + - draft + region_id: + description: The id of the Region for which the price is used. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price + will be used. + type: string + amount: + description: The amount of the price. + type: number + min_quantity: + description: The minimum quantity for which the price will be used. + type: number + max_quantity: + description: The maximum quantity for which the price will be used. + type: number + override: + description: >- + If true the prices will replace all existing prices + associated with the Price List. + type: boolean + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + id: + type: string + description: The id of the deleted Price List. + object: + type: string + description: The type of the object that was deleted. + deleted: + type: boolean + delete: + operationId: DeletePriceListsPriceListPricesBatch + summary: Batch delete prices that belongs to a Price List + description: Batch delete prices that belongs to a Price List + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: >- + The id of the Price List that the Money Amounts that will be deleted + belongs to. + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + price_ids: + description: The price id's of the Money Amounts to delete. + type: array + items: + type: string + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + ids: + type: array + items: + type: string + description: The id of the deleted Money Amount. + object: + type: string + description: The type of the object that was deleted. + deleted: + type: boolean + /price_lists: + post: + operationId: PostPriceListsPriceList + summary: Creates a Price List + description: Creates a Price List + x-authenticated: true + requestBody: + content: + application/json: + schema: + properties: + name: + description: The name of the Price List + type: string + description: + description: A description of the Price List. + type: string + type: + description: The type of the Price List. + type: string + enum: + - sale + - override + status: + description: The status of the Price List. + type: string + enum: + - active + - draft + prices: + description: The prices of the Price List. + type: array + items: + properties: + region_id: + description: The id of the Region for which the price is used. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price + will be used. + type: string + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + customer_groups: + type: array + description: A list of customer groups that the Price List applies to. + items: + required: + - id + properties: + id: + description: The id of a customer group + type: string + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + product: + $ref: '#/components/schemas/price_list' + '/price-lists/{id}': + delete: + operationId: DeletePriceListsPriceList + summary: Delete a Price List + description: Deletes a Price List + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The id of the Price List to delete. + schema: + type: string + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + id: + type: string + description: The id of the deleted Price List. + object: + type: string + description: The type of the object that was deleted. + deleted: + type: boolean + get: + operationId: GetPriceListsPriceList + summary: Retrieve a Price List + description: Retrieves a Price List. + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The id of the Price List. + schema: + type: string + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + price_list: + $ref: '#/components/schemas/price_list' + '/price-lists/{id}/products/{product_id}/prices': + delete: + operationId: DeletePriceListsPriceListProductsProductPrices + summary: Delete all the prices related to a specific product in a price list + description: Delete all the prices related to a specific product in a price list + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: >- + The id of the Price List that the Money Amounts that will be deleted + belongs to. + schema: + type: string + - in: path + name: product_id + required: true + description: The id of the product from which the money amount will be deleted. + schema: + type: string + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + ids: + type: number + description: The price ids that have been deleted. + count: + type: number + description: The number of prices that have been deleted. + object: + type: string + description: The type of the object that was deleted. + deleted: + type: boolean + '/price-lists/{id}/variants/{variant_id}/prices': + delete: + operationId: DeletePriceListsPriceListVariantsVariantPrices + summary: Delete all the prices related to a specific variant in a price list + description: Delete all the prices related to a specific variant in a price list + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: >- + The id of the Price List that the Money Amounts that will be deleted + belongs to. + schema: + type: string + - in: path + name: variant_id + required: true + description: The id of the variant from which the money amount will be deleted. + schema: + type: string + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + ids: + type: number + description: The price ids that have been deleted. + count: + type: number + description: The number of prices that have been deleted. + object: + type: string + description: The type of the object that was deleted. + deleted: + type: boolean + '/price-lists/:id/products': + get: + operationId: GetPriceListsPriceListProducts + summary: List Product in a Price List + description: Retrieves a list of Product that are part of a Price List + 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 + description: Status to search for + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: collection_id + description: Collection ids to search for + style: form + explode: false + schema: + type: array + items: + type: string + - in: query + name: tags + description: Tags to search for + style: form + explode: false + 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: string + - in: query + name: created_at + description: >- + Date comparison for when resulting products was created, i.e. less + than, greater than etc. + schema: + type: string + - in: query + name: updated_at + description: >- + Date comparison for when resulting products was updated, i.e. less + than, greater than etc. + schema: + type: string + - 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 + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + count: + description: The number of Products. + type: integer + offset: + description: The offset of the Product query. + type: integer + limit: + description: The limit of the Product query. + type: integer + products: + type: array + items: + $ref: '#/components/schemas/product' + /price-lists: + get: + operationId: GetPriceLists + summary: List Price Lists + description: Retrieves a list of Price Lists. + x-authenticated: true + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + price_lists: + type: array + items: + $ref: '#/components/schemas/price_list' + count: + description: The number of Price Lists. + type: integer + offset: + description: The offset of the Price List query. + type: integer + limit: + description: The limit of the Price List query. + type: integer + '/price_lists/{id}': + post: + operationId: PostPriceListsPriceListPriceList + summary: Update a Price List + description: Updates a Price List + x-authenticated: true + parameters: + - in: path + name: id + required: true + description: The id of the Price List. + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + name: + description: The name of the Price List + type: string + description: + description: A description of the Price List. + type: string + type: + description: The type of the Price List. + type: string + enum: + - sale + - override + status: + description: The status of the Price List. + type: string + enum: + - active + - draft + prices: + description: The prices of the Price List. + type: array + items: + properties: + id: + description: The id of the price. + type: string + region_id: + description: The id of the Region for which the price is used. + type: string + currency_code: + description: >- + The 3 character ISO currency code for which the price + will be used. + type: string + amount: + description: The amount to charge for the Product Variant. + type: integer + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. + type: integer + customer_groups: + type: array + description: A list of customer groups that the Price List applies to. + items: + required: + - id + properties: + id: + description: The id of a customer group + type: string + tags: + - Price List + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + product: + $ref: '#/components/schemas/price_list' /product-tags: get: operationId: GetProductTags @@ -4113,8 +5230,11 @@ paths: amount: description: The amount to charge for the Product Variant. type: integer - sale_amount: - description: The sale amount to charge for the Product Variant. + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. type: integer options: type: array @@ -4146,7 +5266,27 @@ paths: - in: path name: id required: true - description: The id of the Product. + description: Id of the product to search for the variants. + schema: + type: string + - in: query + name: fields + description: Comma separated string of the column to select. + schema: + type: string + - in: query + name: expand + description: Comma separated string of the relations to include. + schema: + type: string + - 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: @@ -4629,6 +5769,9 @@ paths: type: array items: properties: + id: + description: The id of the price. + type: string region_id: description: The id of the Region for which the price is used. type: string @@ -4640,8 +5783,11 @@ paths: amount: description: The amount to charge for the Product Variant. type: integer - sale_amount: - description: The sale amount to charge for the Product Variant. + min_quantity: + description: The minimum quantity for which the price will be used. + type: integer + max_quantity: + description: The maximum quantity for which the price will be used. type: integer options: type: array @@ -6608,6 +7754,73 @@ components: type: string country: $ref: '#/components/schemas/country' + batch_job: + title: Batch Job + description: A Batch Job. + x-resourceId: batch_job + properties: + id: + description: The unique identifier for the batch job. + type: string + type: + description: The type of batch job. + type: string + enum: + - product_import + - product_export + status: + description: The status of the batch job. + type: string + enum: + - created + - pre_processed + - processing + - completed + - canceled + - failed + created_by: + description: The unique identifier of the user that created the batch job. + type: string + context: + description: >- + The context of the batch job, the type of the batch job determines + what the context should contain. + type: object + dry_run: + description: Specify if the job must apply the modifications or not. + type: boolean + default: false + result: + description: The result of the batch job. + type: object + pre_processed_at: + description: The date from which the job has been pre processed. + type: string + format: date-time + confirmed_at: + description: The date when the confirmation has been done. + type: string + format: date-time + completed_at: + description: The date of the completion. + type: string + format: date-time + canceled_at: + description: The date of the concellation. + type: string + format: date-time + 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 cart: title: Cart description: Represents a user cart @@ -7031,6 +8244,168 @@ components: format: date-time metadata: type: object + discount_condition_customer_group: + title: Product Tag Discount Condition + description: Associates a discount condition with a customer group + x-resourceId: discount_condition_customer_group + properties: + customer_group_id: + description: The id of the Product Tag + type: string + condition_id: + description: The id of the Discount Condition + 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 + discount_condition_product_collection: + title: Product Collection Discount Condition + description: Associates a discount condition with a product collection + x-resourceId: discount_condition_product_collection + properties: + product_collection_id: + description: The id of the Product Collection + type: string + condition_id: + description: The id of the Discount Condition + 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 + discount_condition_product_tag: + title: Product Tag Discount Condition + description: Associates a discount condition with a product tag + x-resourceId: discount_condition_product_tag + properties: + product_tag_id: + description: The id of the Product Tag + type: string + condition_id: + description: The id of the Discount Condition + 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 + discount_condition_product_type: + title: Product Type Discount Condition + description: Associates a discount condition with a product type + x-resourceId: discount_condition_product + properties: + product_type_id: + description: The id of the Product Type + type: string + condition_id: + description: The id of the Discount Condition + 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 + discount_condition_product: + title: Product Discount Condition + description: Associates a discount condition with a product + x-resourceId: discount_condition_product + properties: + product_id: + description: The id of the Product + type: string + condition_id: + description: The id of the Discount Condition + 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 + discount_condition: + title: Discount Condition + description: Holds rule conditions for when a discount is applicable + x-resourceId: discount_condition + properties: + id: + description: The id of the Discount Condition. Will be prefixed by `discon_`. + type: string + type: + description: The type of the Condition + type: string + enum: + - products + - product_types + - product_collections + - product_tags + - customer_groups + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + update_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 discount_rule: title: Discount Rule description: >- @@ -7065,11 +8440,13 @@ components: enum: - total - item - valid_for: - description: A set of Products that the discount can be used for. + conditions: + description: >- + A set of conditions that can be used to limit when the discount can + be used type: array items: - $ref: '#/components/schemas/product' + $ref: '#/components/schemas/discount_condition' created_at: description: The date with timezone at which the resource was created. type: string @@ -7565,10 +8942,15 @@ components: The amount in the smallest currecny unit (e.g. cents 100 cents to charge $1) that the Product Variant will cost. type: integer - sale_amount: + min_quantity: description: >- - An optional sale amount that the Product Variant will be available - for when defined. + The minimum quantity that the Money Amount applies to. If this value + is not set, the Money Amount applies to all quantities. + type: integer + max_quantity: + description: >- + The maximum quantity that the Money Amount applies to. If this value + is not set, the Money Amount applies to all quantities. type: integer variant_id: description: The id of the Product Variant that the Money Amount belongs to. @@ -8047,6 +9429,49 @@ components: metadata: description: An optional key-value map with additional information. type: object + price_list: + title: Price List + description: >- + Price Lists represents a set of prices that overrides the default price + for one or more product variants. + x-resourceId: price_list + properties: + id: + description: The id of the Price List. This value will be prefixed by `pl_`. + type: string + type: + description: >- + The type of Price List. This can be one of either `sale` or + `override`. + type: string + enum: + - sale + - override + starts_at: + description: The date with timezone that the Price List starts being valid. + type: string + format: date-time + ends_at: + description: The date with timezone that the Price List stops being valid. + type: string + format: date-time + customer_groups: + description: The Customer Groups that the Price List applies to. + type: array + items: + $ref: '#/components/schemas/customer_group' + 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 product_collection: title: Product Collection description: Product Collections represents a group of Products that are related. diff --git a/docs/api/store-spec3.json b/docs/api/store-spec3.json index 6cc525b2ab..fc3ac4fc46 100644 --- a/docs/api/store-spec3.json +++ b/docs/api/store-spec3.json @@ -200,89 +200,6 @@ } } }, - "/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" - } - } - } - } - } - } - } - } - }, "/carts/{id}/shipping-methods": { "post": { "operationId": "PostCartsCartShippingMethod", @@ -1009,7 +926,7 @@ }, "/store/carts/{id}": { "post": { - "operationId": "PostCartsCartPaymentMethodUpdate", + "operationId": "PostCartsCart", "summary": "Update a Cart\"", "description": "Updates a Cart.", "parameters": [ @@ -1027,17 +944,72 @@ "content": { "application/json": { "schema": { - "required": [ - "provider_id" - ], "properties": { - "provider_id": { + "region_id": { "type": "string", - "description": "The id of the Payment Provider." + "description": "The id of the Region to create the Cart in." }, - "data": { - "type": "object", - "description": "" + "country_code": { + "type": "string", + "description": "The 2 character ISO country code to create the Cart in." + }, + "email": { + "type": "string", + "description": "An email to be used on the Cart." + }, + "billing_address": { + "description": "The Address to be used for billing purposes.", + "anyOf": [ + { + "$ref": "#/components/schemas/address" + } + ] + }, + "shipping_address": { + "description": "The Address to be used for shipping.", + "anyOf": [ + { + "$ref": "#/components/schemas/address" + } + ] + }, + "gift_cards": { + "description": "An array of Gift Card codes to add to the Cart.", + "type": "array", + "items": { + "required": [ + "code" + ], + "properties": { + "code": { + "description": "The code that a Gift Card is identified by.", + "type": "string" + } + } + } + }, + "discounts": { + "description": "An array of Discount codes to add to the Cart.", + "type": "array", + "items": { + "required": [ + "code" + ], + "properties": { + "code": { + "description": "The code that a Discount is identifed by.", + "type": "string" + } + } + } + }, + "customer_id": { + "description": "The id of the Customer to associate the Cart with.", + "type": "string" + }, + "context": { + "description": "An optional object to provide context to the Cart.", + "type": "object" } } } @@ -1065,6 +1037,89 @@ } } }, + "/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" + } + } + } + } + } + } + } + } + }, "/gift-cards/{code}": { "get": { "operationId": "GetGiftCardsCode", @@ -2527,6 +2582,89 @@ } } }, + "batch_job": { + "title": "Batch Job", + "description": "A Batch Job.", + "x-resourceId": "batch_job", + "properties": { + "id": { + "description": "The unique identifier for the batch job.", + "type": "string" + }, + "type": { + "description": "The type of batch job.", + "type": "string", + "enum": [ + "product_import", + "product_export" + ] + }, + "status": { + "description": "The status of the batch job.", + "type": "string", + "enum": [ + "created", + "pre_processed", + "processing", + "completed", + "canceled", + "failed" + ] + }, + "created_by": { + "description": "The unique identifier of the user that created the batch job.", + "type": "string" + }, + "context": { + "description": "The context of the batch job, the type of the batch job determines what the context should contain.", + "type": "object" + }, + "dry_run": { + "description": "Specify if the job must apply the modifications or not.", + "type": "boolean", + "default": false + }, + "result": { + "description": "The result of the batch job.", + "type": "object" + }, + "pre_processed_at": { + "description": "The date from which the job has been pre processed.", + "type": "string", + "format": "date-time" + }, + "confirmed_at": { + "description": "The date when the confirmation has been done.", + "type": "string", + "format": "date-time" + }, + "completed_at": { + "description": "The date of the completion.", + "type": "string", + "format": "date-time" + }, + "canceled_at": { + "description": "The date of the concellation.", + "type": "string", + "format": "date-time" + }, + "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" + } + } + }, "cart": { "title": "Cart", "description": "Represents a user cart", @@ -3089,6 +3227,217 @@ } } }, + "discount_condition_customer_group": { + "title": "Product Tag Discount Condition", + "description": "Associates a discount condition with a customer group", + "x-resourceId": "discount_condition_customer_group", + "properties": { + "customer_group_id": { + "description": "The id of the Product Tag", + "type": "string" + }, + "condition_id": { + "description": "The id of the Discount Condition", + "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" + } + } + }, + "discount_condition_product_collection": { + "title": "Product Collection Discount Condition", + "description": "Associates a discount condition with a product collection", + "x-resourceId": "discount_condition_product_collection", + "properties": { + "product_collection_id": { + "description": "The id of the Product Collection", + "type": "string" + }, + "condition_id": { + "description": "The id of the Discount Condition", + "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" + } + } + }, + "discount_condition_product_tag": { + "title": "Product Tag Discount Condition", + "description": "Associates a discount condition with a product tag", + "x-resourceId": "discount_condition_product_tag", + "properties": { + "product_tag_id": { + "description": "The id of the Product Tag", + "type": "string" + }, + "condition_id": { + "description": "The id of the Discount Condition", + "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" + } + } + }, + "discount_condition_product_type": { + "title": "Product Type Discount Condition", + "description": "Associates a discount condition with a product type", + "x-resourceId": "discount_condition_product", + "properties": { + "product_type_id": { + "description": "The id of the Product Type", + "type": "string" + }, + "condition_id": { + "description": "The id of the Discount Condition", + "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" + } + } + }, + "discount_condition_product": { + "title": "Product Discount Condition", + "description": "Associates a discount condition with a product", + "x-resourceId": "discount_condition_product", + "properties": { + "product_id": { + "description": "The id of the Product", + "type": "string" + }, + "condition_id": { + "description": "The id of the Discount Condition", + "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" + } + } + }, + "discount_condition": { + "title": "Discount Condition", + "description": "Holds rule conditions for when a discount is applicable", + "x-resourceId": "discount_condition", + "properties": { + "id": { + "description": "The id of the Discount Condition. Will be prefixed by `discon_`.", + "type": "string" + }, + "type": { + "description": "The type of the Condition", + "type": "string", + "enum": [ + "products", + "product_types", + "product_collections", + "product_tags", + "customer_groups" + ] + }, + "created_at": { + "description": "The date with timezone at which the resource was created.", + "type": "string", + "format": "date-time" + }, + "update_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" + } + } + }, "discount_rule": { "title": "Discount Rule", "description": "Holds the rules that governs how a Discount is calculated when applied to a Cart.", @@ -3123,11 +3472,11 @@ "item" ] }, - "valid_for": { - "description": "A set of Products that the discount can be used for.", + "conditions": { + "description": "A set of conditions that can be used to limit when the discount can be used", "type": "array", "items": { - "$ref": "#/components/schemas/product" + "$ref": "#/components/schemas/discount_condition" } }, "created_at": { @@ -3719,8 +4068,12 @@ "description": "The amount in the smallest currecny unit (e.g. cents 100 cents to charge $1) that the Product Variant will cost.", "type": "integer" }, - "sale_amount": { - "description": "An optional sale amount that the Product Variant will be available for when defined.", + "min_quantity": { + "description": "The minimum quantity that the Money Amount applies to. If this value is not set, the Money Amount applies to all quantities.", + "type": "integer" + }, + "max_quantity": { + "description": "The maximum quantity that the Money Amount applies to. If this value is not set, the Money Amount applies to all quantities.", "type": "integer" }, "variant_id": { @@ -4317,6 +4670,57 @@ } } }, + "price_list": { + "title": "Price List", + "description": "Price Lists represents a set of prices that overrides the default price for one or more product variants.", + "x-resourceId": "price_list", + "properties": { + "id": { + "description": "The id of the Price List. This value will be prefixed by `pl_`.", + "type": "string" + }, + "type": { + "description": "The type of Price List. This can be one of either `sale` or `override`.", + "type": "string", + "enum": [ + "sale", + "override" + ] + }, + "starts_at": { + "description": "The date with timezone that the Price List starts being valid.", + "type": "string", + "format": "date-time" + }, + "ends_at": { + "description": "The date with timezone that the Price List stops being valid.", + "type": "string", + "format": "date-time" + }, + "customer_groups": { + "description": "The Customer Groups that the Price List applies to.", + "type": "array", + "items": { + "$ref": "#/components/schemas/customer_group" + } + }, + "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" + } + } + }, "product_collection": { "title": "Product Collection", "description": "Product Collections represents a group of Products that are related.", diff --git a/docs/api/store-spec3.yaml b/docs/api/store-spec3.yaml index 915364c7fd..81da5403dc 100644 --- a/docs/api/store-spec3.yaml +++ b/docs/api/store-spec3.yaml @@ -38,7 +38,7 @@ tags: - name: Product Variant x-resourceId: product_variant servers: - - url: "https://api.medusa-commerce.com/store" + - url: 'https://api.medusa-commerce.com/store' paths: /auth: post: @@ -51,14 +51,14 @@ paths: tags: - Auth responses: - "200": + '200': description: OK content: application/json: schema: properties: customer: - $ref: "#/components/schemas/customer" + $ref: '#/components/schemas/customer' requestBody: content: application/json: @@ -81,7 +81,7 @@ paths: tags: - Auth responses: - "200": + '200': description: OK get: operationId: GetAuth @@ -91,15 +91,15 @@ paths: tags: - Auth responses: - "200": + '200': description: OK content: application/json: schema: properties: customer: - $ref: "#/components/schemas/customer" - "/auth/{email}": + $ref: '#/components/schemas/customer' + '/auth/{email}': get: operationId: GetAuthEmail summary: Check if email has account @@ -114,7 +114,7 @@ paths: tags: - Auth responses: - "200": + '200': description: OK content: application/json: @@ -122,6 +122,693 @@ paths: properties: exists: type: boolean + '/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' + '/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' + /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 + parameters: + - in: path + name: address_id + required: true + description: The id of the Address to remove. + schema: + type: string + tags: + - 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': + description: OK + content: + 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' + /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 + 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}': + 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 + 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' '/carts/{id}/shipping-methods': post: operationId: PostCartsCartShippingMethod @@ -137,7 +824,7 @@ paths: schema: type: string responses: - "200": + '200': description: A successful response content: application/json: @@ -303,7 +990,7 @@ paths: tags: - Cart responses: - "200": + '200': description: OK content: application/json: @@ -350,7 +1037,7 @@ paths: tags: - Cart responses: - "200": + '200': description: OK content: application/json: @@ -379,7 +1066,7 @@ paths: tags: - Cart responses: - "200": + '200': description: OK content: application/json: @@ -443,7 +1130,7 @@ paths: schema: properties: cart: - $ref: "#/components/schemas/cart" + $ref: '#/components/schemas/cart' requestBody: content: application/json: @@ -600,14 +1287,14 @@ paths: tags: - Cart responses: - "200": + '200': description: OK content: application/json: schema: properties: cart: - $ref: "#/components/schemas/cart" + $ref: '#/components/schemas/cart' requestBody: content: application/json: @@ -621,7 +1308,7 @@ paths: description: The id of the Payment Provider. '/store/carts/{id}': post: - operationId: PostCartsCartPaymentMethodUpdate + operationId: PostCartsCart summary: Update a Cart" description: Updates a Cart. parameters: @@ -635,19 +1322,54 @@ paths: content: application/json: schema: - required: - - provider_id properties: - provider_id: + region_id: type: string - description: The id of the Payment Provider. - data: + description: The id of the Region to create the Cart in. + country_code: + type: string + description: The 2 character ISO country code to create the Cart in. + email: + type: string + description: An email to be used on the Cart. + billing_address: + description: The Address to be used for billing purposes. + anyOf: + - $ref: '#/components/schemas/address' + shipping_address: + description: The Address to be used for shipping. + anyOf: + - $ref: '#/components/schemas/address' + gift_cards: + description: An array of Gift Card codes to add to the Cart. + type: array + items: + required: + - code + properties: + code: + description: The code that a Gift Card is identified by. + type: string + discounts: + description: An array of Discount codes to add to the Cart. + type: array + items: + required: + - code + properties: + code: + description: The code that a Discount is identifed by. + type: string + customer_id: + description: The id of the Customer to associate the Cart with. + type: string + context: + description: An optional object to provide context to the Cart. type: object - description: '' tags: - Cart responses: - "200": + '200': description: OK content: application/json: @@ -655,693 +1377,6 @@ paths: 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 - 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' - /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 - parameters: - - in: path - name: address_id - required: true - description: The id of the Address to remove. - schema: - type: string - tags: - - 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": - description: OK - content: - 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' - /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. - '/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' - '/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' '/return-reasons/{id}': get: operationId: GetReturnReasonsReason @@ -1357,14 +1392,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' /return-reasons: get: operationId: GetReturnReasons @@ -1373,7 +1408,7 @@ paths: tags: - Return Reason responses: - "200": + '200': description: OK content: application/json: @@ -1382,7 +1417,7 @@ paths: return_reasons: type: array items: - $ref: "#/components/schemas/return_reason" + $ref: '#/components/schemas/return_reason' /returns: post: operationId: PostReturns @@ -1430,14 +1465,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: get: operationId: GetShippingOptions @@ -1464,7 +1499,7 @@ paths: tags: - Shipping Option responses: - "200": + '200': description: OK content: application/json: @@ -1473,8 +1508,8 @@ paths: shipping_options: type: array items: - $ref: "#/components/schemas/shipping_option" - "/shipping-options/{cart_id}": + $ref: '#/components/schemas/shipping_option' + '/shipping-options/{cart_id}': get: operationId: GetShippingOptionsCartId summary: Retrieve Shipping Options for Cart @@ -1489,7 +1524,7 @@ paths: tags: - Shipping Option responses: - "200": + '200': description: OK content: application/json: @@ -1498,7 +1533,7 @@ paths: shipping_options: type: array items: - $ref: "#/components/schemas/shipping_option" + $ref: '#/components/schemas/shipping_option' /swaps: post: operationId: PostSwaps @@ -1560,15 +1595,15 @@ paths: tags: - Swap responses: - "200": + '200': description: OK content: application/json: schema: properties: swap: - $ref: "#/components/schemas/swap" - "/swaps/{cart_id}": + $ref: '#/components/schemas/swap' + '/swaps/{cart_id}': get: operationId: GetSwapsSwapCartId summary: Retrieve Swap by Cart id @@ -1583,15 +1618,15 @@ paths: tags: - Swap responses: - "200": + '200': description: OK content: application/json: schema: properties: swap: - $ref: "#/components/schemas/swap" - "/variants/{variant_id}": + $ref: '#/components/schemas/swap' + '/variants/{variant_id}': get: operationId: GetVariantsVariant summary: Retrieve a Product Variant @@ -1606,14 +1641,14 @@ paths: tags: - Product Variant responses: - "200": + '200': description: OK content: application/json: schema: properties: variant: - $ref: "#/components/schemas/product_variant" + $ref: '#/components/schemas/product_variant' /variants: get: operationId: GetVariants @@ -1642,7 +1677,7 @@ paths: tags: - Product Variant responses: - "200": + '200': description: OK content: application/json: @@ -1651,7 +1686,7 @@ paths: variants: type: array items: - $ref: "#/components/schemas/product_variant" + $ref: '#/components/schemas/product_variant' components: schemas: address: @@ -1678,7 +1713,74 @@ components: country_code: type: string country: - $ref: "#/components/schemas/country" + $ref: '#/components/schemas/country' + batch_job: + title: Batch Job + description: A Batch Job. + x-resourceId: batch_job + properties: + id: + description: The unique identifier for the batch job. + type: string + type: + description: The type of batch job. + type: string + enum: + - product_import + - product_export + status: + description: The status of the batch job. + type: string + enum: + - created + - pre_processed + - processing + - completed + - canceled + - failed + created_by: + description: The unique identifier of the user that created the batch job. + type: string + context: + description: >- + The context of the batch job, the type of the batch job determines + what the context should contain. + type: object + dry_run: + description: Specify if the job must apply the modifications or not. + type: boolean + default: false + result: + description: The result of the batch job. + type: object + pre_processed_at: + description: The date from which the job has been pre processed. + type: string + format: date-time + confirmed_at: + description: The date when the confirmation has been done. + type: string + format: date-time + completed_at: + description: The date of the completion. + type: string + format: date-time + canceled_at: + description: The date of the concellation. + type: string + format: date-time + 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 cart: title: Cart description: Represents a user cart @@ -1691,43 +1793,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: @@ -1794,19 +1896,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 @@ -1816,7 +1918,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: >- @@ -1827,7 +1929,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 @@ -1876,36 +1978,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 @@ -2020,11 +2122,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 @@ -2078,11 +2180,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: @@ -2102,6 +2204,168 @@ components: format: date-time metadata: type: object + discount_condition_customer_group: + title: Product Tag Discount Condition + description: Associates a discount condition with a customer group + x-resourceId: discount_condition_customer_group + properties: + customer_group_id: + description: The id of the Product Tag + type: string + condition_id: + description: The id of the Discount Condition + 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 + discount_condition_product_collection: + title: Product Collection Discount Condition + description: Associates a discount condition with a product collection + x-resourceId: discount_condition_product_collection + properties: + product_collection_id: + description: The id of the Product Collection + type: string + condition_id: + description: The id of the Discount Condition + 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 + discount_condition_product_tag: + title: Product Tag Discount Condition + description: Associates a discount condition with a product tag + x-resourceId: discount_condition_product_tag + properties: + product_tag_id: + description: The id of the Product Tag + type: string + condition_id: + description: The id of the Discount Condition + 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 + discount_condition_product_type: + title: Product Type Discount Condition + description: Associates a discount condition with a product type + x-resourceId: discount_condition_product + properties: + product_type_id: + description: The id of the Product Type + type: string + condition_id: + description: The id of the Discount Condition + 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 + discount_condition_product: + title: Product Discount Condition + description: Associates a discount condition with a product + x-resourceId: discount_condition_product + properties: + product_id: + description: The id of the Product + type: string + condition_id: + description: The id of the Discount Condition + 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 + discount_condition: + title: Discount Condition + description: Holds rule conditions for when a discount is applicable + x-resourceId: discount_condition + properties: + id: + description: The id of the Discount Condition. Will be prefixed by `discon_`. + type: string + type: + description: The type of the Condition + type: string + enum: + - products + - product_types + - product_collections + - product_tags + - customer_groups + created_at: + description: The date with timezone at which the resource was created. + type: string + format: date-time + update_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 discount_rule: title: Discount Rule description: >- @@ -2136,11 +2400,13 @@ components: enum: - total - item - valid_for: - description: A set of Products that the discount can be used for. + conditions: + description: >- + A set of conditions that can be used to limit when the discount can + be used type: array items: - $ref: "#/components/schemas/product" + $ref: '#/components/schemas/discount_condition' created_at: description: The date with timezone at which the resource was created. type: string @@ -2179,7 +2445,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 @@ -2202,7 +2468,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 @@ -2242,12 +2508,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 @@ -2285,7 +2551,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 @@ -2340,7 +2606,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 @@ -2348,7 +2614,7 @@ components: Provider. type: array items: - $ref: "#/components/schemas/tracking_link" + $ref: '#/components/schemas/tracking_link' tracking_numbers: deprecated: true description: >- @@ -2399,7 +2665,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 @@ -2437,7 +2703,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 @@ -2585,7 +2851,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 @@ -2636,10 +2902,15 @@ components: The amount in the smallest currecny unit (e.g. cents 100 cents to charge $1) that the Product Variant will cost. type: integer - sale_amount: + min_quantity: description: >- - An optional sale amount that the Product Variant will be available - for when defined. + The minimum quantity that the Money Amount applies to. If this value + is not set, the Money Amount applies to all quantities. + type: integer + max_quantity: + description: >- + The maximum quantity that the Money Amount applies to. If this value + is not set, the Money Amount applies to all quantities. type: integer variant_id: description: The id of the Product Variant that the Money Amount belongs to. @@ -2650,7 +2921,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 @@ -2686,7 +2957,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 @@ -2745,7 +3016,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 @@ -2766,7 +3037,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 @@ -2885,76 +3156,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 @@ -3118,6 +3389,49 @@ components: metadata: description: An optional key-value map with additional information. type: object + price_list: + title: Price List + description: >- + Price Lists represents a set of prices that overrides the default price + for one or more product variants. + x-resourceId: price_list + properties: + id: + description: The id of the Price List. This value will be prefixed by `pl_`. + type: string + type: + description: >- + The type of Price List. This can be one of either `sale` or + `override`. + type: string + enum: + - sale + - override + starts_at: + description: The date with timezone that the Price List starts being valid. + type: string + format: date-time + ends_at: + description: The date with timezone that the Price List stops being valid. + type: string + format: date-time + customer_groups: + description: The Customer Groups that the Price List applies to. + type: array + items: + $ref: '#/components/schemas/customer_group' + 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 product_collection: title: Product Collection description: Product Collections represents a group of Products that are related. @@ -3220,7 +3534,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 @@ -3380,7 +3694,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. @@ -3461,7 +3775,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 @@ -3519,7 +3833,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 @@ -3530,14 +3844,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 @@ -3591,16 +3905,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 @@ -3692,21 +4006,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 @@ -3738,7 +4052,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 @@ -3756,7 +4070,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 @@ -3818,7 +4132,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 @@ -3833,7 +4147,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 @@ -3884,7 +4198,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 @@ -3970,7 +4284,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. @@ -4008,7 +4322,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 @@ -4059,7 +4373,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 @@ -4067,7 +4381,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 @@ -4113,7 +4427,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: @@ -4131,7 +4445,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 @@ -4197,22 +4511,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 @@ -4224,17 +4538,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: >- @@ -4255,7 +4569,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. @@ -4393,7 +4707,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