diff --git a/docs/api/admin-spec3.json b/docs/api/admin-spec3.json index 5da7fcc4b6..567c4a7c73 100644 --- a/docs/api/admin-spec3.json +++ b/docs/api/admin-spec3.json @@ -717,6 +717,10 @@ "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" @@ -1038,6 +1042,563 @@ } } }, + "/discounts/code/{code}": { + "get": { + "operationId": "GetDiscountsDiscountCode", + "summary": "Retrieve a Discount by code", + "description": "Retrieves a Discount by its discount code", + "parameters": [ + { + "in": "path", + "name": "code", + "required": true, + "description": "The code of the Discount", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Discount" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "discount": { + "$ref": "#/components/schemas/discount" + } + } + } + } + } + } + } + } + }, + "/draft-orders": { + "post": { + "operationId": "PostDraftOrders", + "summary": "Create a Draft Order", + "description": "Creates a Draft Order", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "status": { + "description": "The status of the draft order", + "type": "string" + }, + "email": { + "description": "The email of the customer of the draft order", + "type": "string" + }, + "billing_address": { + "description": "The Address to be used for billing purposes.", + "anyOf": [ + { + "$ref": "#/components/schemas/address" + } + ] + }, + "shipping_address": { + "description": "The Address to be used for shipping.", + "anyOf": [ + { + "$ref": "#/components/schemas/address" + } + ] + }, + "items": { + "description": "The Line Items that have been received.", + "type": "array", + "items": { + "properties": { + "variant_id": { + "description": "The id of the Product Variant to generate the Line Item from.", + "type": "string" + }, + "unit_price": { + "description": "The potential custom price of the item.", + "type": "integer" + }, + "title": { + "description": "The potential custom title of the item.", + "type": "string" + }, + "quantity": { + "description": "The quantity of the Line Item.", + "type": "integer" + }, + "metadata": { + "description": "The optional key-value map with additional details about the Line Item.", + "type": "object" + } + } + } + }, + "region_id": { + "description": "The id of the region for the draft order", + "type": "string" + }, + "discounts": { + "description": "The discounts to add on the draft order", + "type": "array", + "items": { + "properties": { + "code": { + "description": "The code of the discount to apply", + "type": "string" + } + } + } + }, + "customer_id": { + "description": "The id of the customer to add on the draft order", + "type": "string" + }, + "no_notification_order": { + "description": "An optional flag passed to the resulting order to determine use of notifications.", + "type": "boolean" + }, + "shipping_methods": { + "description": "The shipping methods for the draft order", + "type": "array", + "items": { + "properties": { + "option_id": { + "description": "The id of the shipping option in use", + "type": "string" + }, + "data": { + "description": "The optional additional data needed for the shipping method", + "type": "object" + }, + "price": { + "description": "The potential custom price of the shipping", + "type": "integer" + } + } + } + }, + "metadata": { + "description": "The optional key-value map with additional details about the Draft Order.", + "type": "object" + } + } + } + } + } + }, + "tags": [ + "Draft Order" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "draft_order": { + "$ref": "#/components/schemas/draft-order" + } + } + } + } + } + } + } + }, + "get": { + "operationId": "GetDraftOrders", + "summary": "List Draft Orders", + "description": "Retrieves an list of Draft Orders", + "tags": [ + "Draft Order" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "draft_order": { + "$ref": "#/components/schemas/draft-order" + } + } + } + } + } + } + } + } + }, + "/draft-orders/{id}/line-items": { + "post": { + "operationId": "PostDraftOrdersDraftOrderLineItems", + "summary": "Create a Line Item for Draft Order", + "description": "Creates a Line Item for the Draft Order", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "variant_id": { + "description": "The id of the Product Variant to generate the Line Item from.", + "type": "string" + }, + "unit_price": { + "description": "The potential custom price of the item.", + "type": "integer" + }, + "title": { + "description": "The potential custom title of the item.", + "type": "string" + }, + "quantity": { + "description": "The quantity of the Line Item.", + "type": "integer" + }, + "metadata": { + "description": "The optional key-value map with additional details about the Line Item.", + "type": "object" + } + } + } + } + } + }, + "tags": [ + "Draft Order" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "draft_order": { + "$ref": "#/components/schemas/draft-order" + } + } + } + } + } + } + } + } + }, + "/draft-orders/{id}": { + "delete": { + "operationId": "DeleteDraftOrdersDraftOrder", + "summary": "Delete a Draft Order", + "description": "Deletes a Draft Order", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Draft Order.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Draft Order" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "id": { + "type": "string", + "description": "The id of the deleted Draft Order." + }, + "object": { + "type": "string", + "description": "The type of the object that was deleted." + }, + "deleted": { + "type": "boolean" + } + } + } + } + } + } + } + }, + "get": { + "operationId": "GetDraftOrdersDraftOrder", + "summary": "Retrieve a Draft Order", + "description": "Retrieves a Draft Order.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Draft Order.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Draft Order" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "draft_order": { + "$ref": "#/components/schemas/draft-order" + } + } + } + } + } + } + } + } + }, + "/draft-orders/{id}/line-items/{line_id}": { + "delete": { + "operationId": "DeleteDraftOrdersDraftOrderLineItemsItem", + "summary": "Delete a Line Item", + "description": "Removes a Line Item from a Draft Order.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Draft Order.", + "schema": { + "type": "string" + } + }, + { + "in": "path", + "name": "line_id", + "required": true, + "description": "The id of the Draft Order.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Draft Order" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "draft_order": { + "$ref": "#/components/schemas/draft-order" + } + } + } + } + } + } + } + }, + "post": { + "operationId": "PostDraftOrdersDraftOrderLineItemsItem", + "summary": "Update a Line Item for a Draft Order", + "description": "Updates a Line Item for a Draft Order", + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "unit_price": { + "description": "The potential custom price of the item.", + "type": "integer" + }, + "title": { + "description": "The potential custom title of the item.", + "type": "string" + }, + "quantity": { + "description": "The quantity of the Line Item.", + "type": "integer" + }, + "metadata": { + "description": "The optional key-value map with additional details about the Line Item.", + "type": "object" + } + } + } + } + } + }, + "tags": [ + "Draft Order" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "draft_order": { + "$ref": "#/components/schemas/draft-order" + } + } + } + } + } + } + } + } + }, + "/draft-orders/{id}/register-payment": { + "post": { + "summary": "Registers a payment for a Draft Order", + "operationId": "PostDraftOrdersDraftOrderRegisterPayment", + "description": "Registers a payment for a Draft Order.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The Draft Order id.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Draft Order" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "draft_order": { + "$ref": "#/components/schemas/draft-order" + } + } + } + } + } + } + } + } + }, + "/admin/draft-orders/{id}": { + "post": { + "operationId": "PostDraftOrdersDraftOrder", + "summary": "Update a Draft Order\"", + "description": "Updates a Draft Order.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Draft Order.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "region_id": { + "type": "string", + "description": "The id of the Region to create the Draft Order in." + }, + "email": { + "type": "string", + "description": "An email to be used on the Draft Order." + }, + "billing_address": { + "description": "The Address to be used for billing purposes.", + "anyOf": [ + { + "$ref": "#/components/schemas/address" + } + ] + }, + "shipping_address": { + "description": "The Address to be used for shipping.", + "anyOf": [ + { + "$ref": "#/components/schemas/address" + } + ] + }, + "discounts": { + "description": "An array of Discount codes to add to the Draft Order.", + "type": "array", + "items": { + "properties": { + "code": { + "description": "The code that a Discount is identifed by.", + "type": "string" + } + } + } + }, + "no_notification_order": { + "description": "An optional flag passed to the resulting order to determine use of notifications.", + "type": "boolean" + }, + "customer_id": { + "description": "The id of the Customer to associate the Draft Order with.", + "type": "string" + } + } + } + } + } + }, + "tags": [ + "Draft Order" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "draft_order": { + "$ref": "#/components/schemas/draft-order" + } + } + } + } + } + } + } + } + }, "/gift-cards": { "post": { "operationId": "PostGiftCards", @@ -1668,10 +2229,18 @@ } } }, + "shipping_address": { + "type": "object", + "description": "An optional shipping address to send the claim to. Defaults to the parent order's shipping address" + }, "refund_amount": { "description": "The amount to refund the Customer when the Claim type is `refund`.", "type": "integer" }, + "no_notification": { + "description": "If set to true no notification will be send related to this Claim.", + "type": "boolean" + }, "metadata": { "description": "An optional set of key-value pairs to hold additional information.", "type": "object" @@ -1739,6 +2308,10 @@ } } }, + "no_notification": { + "description": "If set to true no notification will be send related to this Swap.", + "type": "boolean" + }, "metadata": { "description": "An optional set of key-value pairs to hold additional information.", "type": "object" @@ -1800,6 +2373,10 @@ "items": { "type": "string" } + }, + "no_notification": { + "description": "If set to true no notification will be send related to this Shipment.", + "type": "boolean" } } } @@ -1867,6 +2444,10 @@ "items": { "type": "string" } + }, + "no_notification": { + "description": "If set to true no notification will be send related to this Claim.", + "type": "boolean" } } } @@ -1960,6 +2541,10 @@ } } } + }, + "no_notification": { + "description": "If set to true no notification will be send related to this Swap.", + "type": "boolean" } } } @@ -2066,6 +2651,10 @@ "metadata": { "description": "An optional set of key-value pairs to hold additional information.", "type": "object" + }, + "no_notification": { + "description": "If set to true no notification will be send related to this Claim.", + "type": "boolean" } } } @@ -2126,6 +2715,10 @@ "metadata": { "description": "An optional set of key-value pairs to hold additional information.", "type": "object" + }, + "no_notification": { + "description": "If set to true no notification will be send related to this Claim.", + "type": "boolean" } } } @@ -2265,82 +2858,6 @@ } } }, - "/orders/{id}/returns/{return_id}/receive": { - "post": { - "operationId": "PostOrdersOrderReturnsReturnReceive", - "summary": "Receive a Return", - "description": "Registers a Return as received.", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Order.", - "schema": { - "type": "string" - } - }, - { - "in": "path", - "name": "return_id", - "required": true, - "description": "The id of the Return.", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "items": { - "description": "The Line Items that have been received.", - "type": "array", - "items": { - "properties": { - "item_id": { - "description": "The id of the Line Item.", - "type": "string" - }, - "quantity": { - "description": "The quantity of the Line Item.", - "type": "integer" - } - } - } - }, - "refund": { - "description": "The amount to refund.", - "type": "integer" - } - } - } - } - } - }, - "tags": [ - "Order" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "order": { - "$ref": "#/components/schemas/order" - } - } - } - } - } - } - } - } - }, "/orders/{id}/swaps/{swap_id}/receive": { "post": { "operationId": "PostOrdersOrderSwapsSwapReceive", @@ -2449,6 +2966,10 @@ "note": { "description": "A not with additional details about the Refund.", "type": "string" + }, + "no_notification": { + "description": "If set to true no notification will be send related to this Refund.", + "type": "boolean" } } } @@ -2539,6 +3060,10 @@ "description": "A flag to indicate if the Return should be registerd as received immediately.", "type": "boolean" }, + "no_notification": { + "description": "A flag to indicate if no notifications should be emitted related to the requested Return.", + "type": "boolean" + }, "refund": { "description": "The amount to refund.", "type": "integer" @@ -2666,6 +3191,10 @@ } } }, + "no_notification": { + "description": "If set to true no notification will be send related to this Swap.", + "type": "boolean" + }, "metadata": { "description": "An optional set of key-value pairs to hold additional information.", "type": "object" @@ -2773,6 +3302,10 @@ "description": "A flag to indicate if the Product represents a Gift Card. Purchasing Products with this flag set to `true` will result in a Gift Card being created.", "type": "boolean" }, + "discountable": { + "description": "A flag to indicate if discounts can be applied to the LineItems generated from this Product", + "type": "boolean" + }, "images": { "description": "Images of the Product.", "type": "array", @@ -3458,6 +3991,10 @@ "description": "A flag to indicate if the Product represents a Gift Card. Purchasing Products with this flag set to `true` will result in a Gift Card being created.", "type": "boolean" }, + "discountable": { + "description": "A flag to indicate if discounts can be applied to the LineItems generated from this Product", + "type": "boolean" + }, "images": { "description": "Images of the Product.", "type": "array", @@ -4771,6 +5308,73 @@ } } }, + "/returns/{id}receive": { + "post": { + "operationId": "PostReturnsReturnReceive", + "summary": "Receive a Return", + "description": "Registers a Return as received. Updates statuses on Orders and Swaps accordingly.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Return.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "items": { + "description": "The Line Items that have been received.", + "type": "array", + "items": { + "properties": { + "item_id": { + "description": "The id of the Line Item.", + "type": "string" + }, + "quantity": { + "description": "The quantity of the Line Item.", + "type": "integer" + } + } + } + }, + "refund": { + "description": "The amount to refund.", + "type": "integer" + } + } + } + } + } + }, + "tags": [ + "Return" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "return": { + "$ref": "#/components/schemas/return" + } + } + } + } + } + } + } + } + }, "/shipping-options": { "post": { "operationId": "PostShippingOptions", @@ -5412,6 +6016,43 @@ } } }, + "/swaps/{id}": { + "get": { + "operationId": "GetSwapsSwap", + "summary": "Retrieve a Swap", + "description": "Retrieves a Swap.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Swap.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Swap" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "swap": { + "$ref": "#/components/schemas/swap" + } + } + } + } + } + } + } + } + }, "/swaps": { "get": { "operationId": "GetSwaps", @@ -5829,6 +6470,10 @@ "type": "string", "format": "date-time" }, + "no_notification": { + "description": "Flag for describing whether or not notifications related to this should be send.", + "type": "boolean" + }, "metadata": { "type": "object" } @@ -6020,10 +6665,6 @@ "$ref": "#/components/schemas/product" } }, - "usage_limit": { - "description": "The maximum number of times that a discount can be used.", - "type": "integer" - }, "created_at": { "description": "The date with timezone at which the resource was created.", "type": "string", @@ -6095,6 +6736,14 @@ "$ref": "#/components/schemas/region" } }, + "usage_limit": { + "description": "The maximum number of times that a discount can be used.", + "type": "integer" + }, + "usage_count": { + "description": "The number of times a discount has been used.", + "type": "integer" + }, "created_at": { "description": "The date with timezone at which the resource was created.", "type": "string", @@ -6116,6 +6765,75 @@ } } }, + "draft-order": { + "title": "DraftOrder", + "description": "Represents a draft order", + "x-resourceId": "draft-order", + "properties": { + "id": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "open", + "completed" + ] + }, + "display_id": { + "type": "string" + }, + "cart_id": { + "type": "string" + }, + "cart": { + "anyOf": [ + { + "$ref": "#/components/schemas/cart" + } + ] + }, + "order_id": { + "type": "string" + }, + "order": { + "anyOf": [ + { + "$ref": "#/components/schemas/order" + } + ] + }, + "canceled_at": { + "type": "string", + "format": "date-time" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "update_at": { + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "type": "string", + "format": "date-time" + }, + "completed_at": { + "type": "string", + "format": "date-time" + }, + "no_notification_order": { + "type": "boolean" + }, + "metadata": { + "type": "object" + }, + "idempotency_key": { + "type": "string" + } + } + }, "fulfillment_item": { "title": "Fulfillment Item", "description": "Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item.", @@ -6210,6 +6928,10 @@ "type": "string", "format": "date-time" }, + "no_notification": { + "description": "Flag for describing whether or not notifications related to this should be send.", + "type": "boolean" + }, "canceled_at": { "description": "The date with timezone at which the Fulfillment was canceled.", "type": "string", @@ -6869,6 +7591,13 @@ }, "gift_card_total": { "type": "integer" + }, + "paid_total": { + "type": "integer" + }, + "no_notification": { + "description": "Flag for describing whether or not notifications related to this should be send.", + "type": "boolean" } } }, @@ -7343,6 +8072,10 @@ "description": "Whether the Product represents a Gift Card. Products that represent Gift Cards will automatically generate a redeemable Gift Card code once they are purchased.", "type": "boolean" }, + "discountable": { + "description": "Whether the Product can be discounted. Discounts will not apply to Line Items of this Product when this flag is set to `false`.", + "type": "boolean" + }, "images": { "description": "Images of the Product", "type": "array", @@ -7724,6 +8457,10 @@ "type": "string", "format": "date-time" }, + "no_notification": { + "description": "When set to true, no notification will be sent related to this return.", + "type": "boolean" + }, "metadata": { "description": "An optional key-value map with additional information.", "type": "object" @@ -8102,6 +8839,10 @@ "type": "string", "format": "date-time" }, + "no_notification": { + "description": "If set to true, no notification will be sent related to this swap", + "type": "boolean" + }, "metadata": { "description": "An optional key-value map with additional information.", "type": "object" diff --git a/docs/api/admin-spec3.yaml b/docs/api/admin-spec3.yaml index 048de24094..57e69b6cae 100644 --- a/docs/api/admin-spec3.yaml +++ b/docs/api/admin-spec3.yaml @@ -478,6 +478,9 @@ paths: 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 @@ -695,6 +698,421 @@ paths: 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 + 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' + /draft-orders: + post: + operationId: PostDraftOrders + summary: Create a Draft Order + description: Creates a Draft Order + requestBody: + content: + application/json: + schema: + properties: + status: + description: The status of the draft order + type: string + email: + description: The email of the customer of the draft order + type: string + billing_address: + description: The Address to be used for billing purposes. + anyOf: + - $ref: '#/components/schemas/address' + shipping_address: + description: The Address to be used for shipping. + anyOf: + - $ref: '#/components/schemas/address' + items: + description: The Line Items that have been received. + type: array + items: + properties: + variant_id: + description: >- + The id of the Product Variant to generate the Line + Item from. + type: string + unit_price: + description: The potential custom price of the item. + type: integer + title: + description: The potential custom title of the item. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + metadata: + description: >- + The optional key-value map with additional details + about the Line Item. + type: object + region_id: + description: The id of the region for the draft order + type: string + discounts: + description: The discounts to add on the draft order + type: array + items: + properties: + code: + description: The code of the discount to apply + type: string + customer_id: + description: The id of the customer to add on the draft order + type: string + no_notification_order: + description: >- + An optional flag passed to the resulting order to determine + use of notifications. + type: boolean + shipping_methods: + description: The shipping methods for the draft order + type: array + items: + properties: + option_id: + description: The id of the shipping option in use + type: string + data: + description: >- + The optional additional data needed for the shipping + method + type: object + price: + description: The potential custom price of the shipping + type: integer + metadata: + description: >- + The optional key-value map with additional details about the + Draft Order. + type: object + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + draft_order: + $ref: '#/components/schemas/draft-order' + get: + operationId: GetDraftOrders + summary: List Draft Orders + description: Retrieves an list of Draft Orders + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + draft_order: + $ref: '#/components/schemas/draft-order' + '/draft-orders/{id}/line-items': + post: + operationId: PostDraftOrdersDraftOrderLineItems + summary: Create a Line Item for Draft Order + description: Creates a Line Item for the Draft Order + requestBody: + content: + application/json: + schema: + properties: + variant_id: + description: >- + The id of the Product Variant to generate the Line Item + from. + type: string + unit_price: + description: The potential custom price of the item. + type: integer + title: + description: The potential custom title of the item. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + metadata: + description: >- + The optional key-value map with additional details about the + Line Item. + type: object + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + draft_order: + $ref: '#/components/schemas/draft-order' + '/draft-orders/{id}': + delete: + operationId: DeleteDraftOrdersDraftOrder + summary: Delete a Draft Order + description: Deletes a Draft Order + parameters: + - in: path + name: id + required: true + description: The id of the Draft Order. + schema: + type: string + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + id: + type: string + description: The id of the deleted Draft Order. + object: + type: string + description: The type of the object that was deleted. + deleted: + type: boolean + get: + operationId: GetDraftOrdersDraftOrder + summary: Retrieve a Draft Order + description: Retrieves a Draft Order. + parameters: + - in: path + name: id + required: true + description: The id of the Draft Order. + schema: + type: string + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + draft_order: + $ref: '#/components/schemas/draft-order' + '/draft-orders/{id}/line-items/{line_id}': + delete: + operationId: DeleteDraftOrdersDraftOrderLineItemsItem + summary: Delete a Line Item + description: Removes a Line Item from a Draft Order. + parameters: + - in: path + name: id + required: true + description: The id of the Draft Order. + schema: + type: string + - in: path + name: line_id + required: true + description: The id of the Draft Order. + schema: + type: string + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + draft_order: + $ref: '#/components/schemas/draft-order' + post: + operationId: PostDraftOrdersDraftOrderLineItemsItem + summary: Update a Line Item for a Draft Order + description: Updates a Line Item for a Draft Order + requestBody: + content: + application/json: + schema: + properties: + unit_price: + description: The potential custom price of the item. + type: integer + title: + description: The potential custom title of the item. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + metadata: + description: >- + The optional key-value map with additional details about the + Line Item. + type: object + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + draft_order: + $ref: '#/components/schemas/draft-order' + '/draft-orders/{id}/register-payment': + post: + summary: Registers a payment for a Draft Order + operationId: PostDraftOrdersDraftOrderRegisterPayment + description: Registers a payment for a Draft Order. + parameters: + - in: path + name: id + required: true + description: The Draft Order id. + schema: + type: string + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + draft_order: + $ref: '#/components/schemas/draft-order' + '/admin/draft-orders/{id}': + post: + operationId: PostDraftOrdersDraftOrder + summary: Update a Draft Order" + description: Updates a Draft Order. + parameters: + - in: path + name: id + required: true + description: The id of the Draft Order. + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + region_id: + type: string + description: The id of the Region to create the Draft Order in. + email: + type: string + description: An email to be used on the Draft Order. + billing_address: + description: The Address to be used for billing purposes. + anyOf: + - $ref: '#/components/schemas/address' + shipping_address: + description: The Address to be used for shipping. + anyOf: + - $ref: '#/components/schemas/address' + discounts: + description: An array of Discount codes to add to the Draft Order. + type: array + items: + properties: + code: + description: The code that a Discount is identifed by. + type: string + no_notification_order: + description: >- + An optional flag passed to the resulting order to determine + use of notifications. + type: boolean + customer_id: + description: The id of the Customer to associate the Draft Order with. + type: string + tags: + - Draft Order + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + draft_order: + $ref: '#/components/schemas/draft-order' + /notifications: + get: + operationId: GetNotifications + summary: List Notifications + description: Retrieves a list of Notifications. + tags: + - Notification + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + notifications: + type: array + items: + $ref: '#/components/schemas/notification' + '/notifications/{id}/resend': + post: + operationId: PostNotificationsNotificationResend + summary: Resend Notification + description: >- + Resends a previously sent notifications, with the same data but + optionally to a different address + parameters: + - in: path + name: id + required: true + description: The id of the Notification + schema: + type: string + tags: + - Notification + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + notification: + $ref: '#/components/schemas/notification' /gift-cards: post: operationId: PostGiftCards @@ -867,49 +1285,6 @@ paths: properties: gift_card: $ref: '#/components/schemas/gift_card' - /notifications: - get: - operationId: GetNotifications - summary: List Notifications - description: Retrieves a list of Notifications. - tags: - - Notification - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - notifications: - type: array - items: - $ref: '#/components/schemas/notification' - '/notifications/{id}/resend': - post: - operationId: PostNotificationsNotificationResend - summary: Resend Notification - description: >- - Resends a previously sent notifications, with the same data but - optionally to a different address - parameters: - - in: path - name: id - required: true - description: The id of the Notification - schema: - type: string - tags: - - Notification - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - notification: - $ref: '#/components/schemas/notification' '/orders/{id}/shipping-methods': post: operationId: PostOrdersOrderShippingMethods @@ -1158,11 +1533,21 @@ paths: price: description: The price to charge for the Shipping Method type: integer + shipping_address: + type: object + description: >- + An optional shipping address to send the claim to. Defaults + to the parent order's shipping address refund_amount: description: >- The amount to refund the Customer when the Claim type is `refund`. type: integer + no_notification: + description: >- + If set to true no notification will be send related to this + Claim. + type: boolean metadata: description: >- An optional set of key-value pairs to hold additional @@ -1209,6 +1594,11 @@ paths: quantity: description: The quantity of the Line Item to fulfill. type: integer + no_notification: + description: >- + If set to true no notification will be send related to this + Swap. + type: boolean metadata: description: >- An optional set of key-value pairs to hold additional @@ -1250,6 +1640,11 @@ paths: type: array items: type: string + no_notification: + description: >- + If set to true no notification will be send related to this + Shipment. + type: boolean tags: - Order responses: @@ -1292,6 +1687,11 @@ paths: type: array items: type: string + no_notification: + description: >- + If set to true no notification will be send related to this + Claim. + type: boolean tags: - Order responses: @@ -1356,6 +1756,11 @@ paths: quantity: description: The quantity of the Product Variant to ship. type: integer + no_notification: + description: >- + If set to true no notification will be send related to this + Swap. + type: boolean tags: - Order responses: @@ -1424,6 +1829,11 @@ paths: An optional set of key-value pairs to hold additional information. type: object + no_notification: + description: >- + If set to true no notification will be send related to this + Claim. + type: boolean tags: - Order responses: @@ -1463,6 +1873,11 @@ paths: An optional set of key-value pairs to hold additional information. type: object + no_notification: + description: >- + If set to true no notification will be send related to this + Claim. + type: boolean tags: - Order responses: @@ -1547,54 +1962,6 @@ paths: properties: order: $ref: '#/components/schemas/order' - '/orders/{id}/returns/{return_id}/receive': - post: - operationId: PostOrdersOrderReturnsReturnReceive - summary: Receive a Return - description: Registers a Return as received. - parameters: - - in: path - name: id - required: true - description: The id of the Order. - schema: - type: string - - in: path - name: return_id - required: true - description: The id of the Return. - schema: - type: string - requestBody: - content: - application/json: - schema: - properties: - items: - description: The Line Items that have been received. - type: array - items: - properties: - item_id: - description: The id of the Line Item. - type: string - quantity: - description: The quantity of the Line Item. - type: integer - refund: - description: The amount to refund. - type: integer - tags: - - Order - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - order: - $ref: '#/components/schemas/order' '/orders/{id}/swaps/{swap_id}/receive': post: operationId: PostOrdersOrderSwapsSwapReceive @@ -1669,6 +2036,11 @@ paths: note: description: A not with additional details about the Refund. type: string + no_notification: + description: >- + If set to true no notification will be send related to this + Refund. + type: boolean tags: - Order responses: @@ -1735,6 +2107,11 @@ paths: A flag to indicate if the Return should be registerd as received immediately. type: boolean + no_notification: + description: >- + A flag to indicate if no notifications should be emitted + related to the requested Return. + type: boolean refund: description: The amount to refund. type: integer @@ -1826,6 +2203,11 @@ paths: price: description: The price to charge for the Shipping Method type: integer + no_notification: + description: >- + If set to true no notification will be send related to this + Swap. + type: boolean metadata: description: >- An optional set of key-value pairs to hold additional @@ -1900,6 +2282,11 @@ paths: Purchasing Products with this flag set to `true` will result in a Gift Card being created. type: boolean + discountable: + description: >- + A flag to indicate if discounts can be applied to the + LineItems generated from this Product + type: boolean images: description: Images of the Product. type: array @@ -2400,6 +2787,11 @@ paths: Purchasing Products with this flag set to `true` will result in a Gift Card being created. type: boolean + discountable: + description: >- + A flag to indicate if discounts can be applied to the + LineItems generated from this Product + type: boolean images: description: Images of the Product. type: array @@ -3297,6 +3689,50 @@ paths: type: array items: $ref: '#/components/schemas/return' + '/returns/{id}receive': + post: + operationId: PostReturnsReturnReceive + summary: Receive a Return + description: >- + Registers a Return as received. Updates statuses on Orders and Swaps + accordingly. + parameters: + - in: path + name: id + required: true + description: The id of the Return. + schema: + type: string + requestBody: + content: + application/json: + schema: + properties: + items: + description: The Line Items that have been received. + type: array + items: + properties: + item_id: + description: The id of the Line Item. + type: string + quantity: + description: The quantity of the Line Item. + type: integer + refund: + description: The amount to refund. + type: integer + tags: + - Return + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + return: + $ref: '#/components/schemas/return' /shipping-options: post: operationId: PostShippingOptions @@ -3718,6 +4154,29 @@ paths: type: array items: $ref: '#/components/schemas/store' + '/swaps/{id}': + get: + operationId: GetSwapsSwap + summary: Retrieve a Swap + description: Retrieves a Swap. + parameters: + - in: path + name: id + required: true + description: The id of the Swap. + schema: + type: string + tags: + - Swap + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + swap: + $ref: '#/components/schemas/swap' /swaps: get: operationId: GetSwaps @@ -4020,6 +4479,11 @@ components: deleted_at: type: string format: date-time + no_notification: + description: >- + Flag for describing whether or not notifications related to this + should be send. + type: boolean metadata: type: object claim_tag: @@ -4167,9 +4631,6 @@ components: type: array items: $ref: '#/components/schemas/product' - usage_limit: - description: The maximum number of times that a discount can be used. - type: integer created_at: description: The date with timezone at which the resource was created. type: string @@ -4232,6 +4693,12 @@ components: type: array items: $ref: '#/components/schemas/region' + usage_limit: + description: The maximum number of times that a discount can be used. + type: integer + usage_count: + description: The number of times a discount has been used. + type: integer created_at: description: The date with timezone at which the resource was created. type: string @@ -4247,6 +4714,51 @@ components: metadata: description: An optional key-value map with additional information. type: object + draft-order: + title: DraftOrder + description: Represents a draft order + x-resourceId: draft-order + properties: + id: + type: string + status: + type: string + enum: + - open + - completed + display_id: + type: string + cart_id: + type: string + cart: + anyOf: + - $ref: '#/components/schemas/cart' + order_id: + type: string + order: + anyOf: + - $ref: '#/components/schemas/order' + canceled_at: + type: string + format: date-time + created_at: + type: string + format: date-time + update_at: + type: string + format: date-time + deleted_at: + type: string + format: date-time + completed_at: + type: string + format: date-time + no_notification_order: + type: boolean + metadata: + type: object + idempotency_key: + type: string fulfillment_item: title: Fulfillment Item description: >- @@ -4339,6 +4851,11 @@ components: description: The date with timezone at which the Fulfillment was shipped. type: string format: date-time + no_notification: + description: >- + Flag for describing whether or not notifications related to this + should be send. + type: boolean canceled_at: description: The date with timezone at which the Fulfillment was canceled. type: string @@ -4865,6 +5382,13 @@ components: type: integer gift_card_total: type: integer + paid_total: + type: integer + no_notification: + description: >- + Flag for describing whether or not notifications related to this + should be send. + type: boolean payment_provider: title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. @@ -5331,6 +5855,11 @@ components: Gift Cards will automatically generate a redeemable Gift Card code once they are purchased. type: boolean + discountable: + description: >- + Whether the Product can be discounted. Discounts will not apply to + Line Items of this Product when this flag is set to `false`. + type: boolean images: description: Images of the Product type: array @@ -5670,6 +6199,11 @@ components: description: The date with timezone at which the resource was last updated. type: string format: date-time + no_notification: + description: >- + When set to true, no notification will be sent related to this + return. + type: boolean metadata: description: An optional key-value map with additional information. type: object @@ -6030,6 +6564,9 @@ components: description: The date with timezone at which the resource was last updated. type: string format: date-time + no_notification: + description: 'If set to true, no notification will be sent related to this swap' + type: boolean metadata: description: An optional key-value map with additional information. type: object diff --git a/docs/api/store-spec3.json b/docs/api/store-spec3.json index 5727ac1234..b5b3d50c25 100644 --- a/docs/api/store-spec3.json +++ b/docs/api/store-spec3.json @@ -199,6 +199,523 @@ } } }, + "/customers/{id}/addresses": { + "post": { + "operationId": "PostCustomersCustomerAddresses", + "summary": "Add a Shipping Address", + "description": "Adds a Shipping Address to a Customer's saved addresses.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The Customer id.", + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "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/{id}/addresses/{address_id}": { + "delete": { + "operationId": "DeleteCustomersCustomerAddressesAddress", + "summary": "Delete an Address", + "description": "Removes an Address from the Customer's saved addresse.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Customer.", + "schema": { + "type": "string" + } + }, + { + "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.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The Customer id.", + "schema": { + "type": "string" + } + }, + { + "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/{id}": { + "get": { + "operationId": "GetCustomersCustomer", + "summary": "Retrieves a Customer", + "description": "Retrieves a Customer - the Customer must be logged in to retrieve their details.", + "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 Customer details", + "description": "Updates a Customer's saved details.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Customer.", + "schema": { + "type": "string" + } + } + ], + "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" + }, + "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/{id}/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.", + "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": { + "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/{id}/orders": { + "get": { + "operationId": "GetCustomersCustomerOrders", + "summary": "Retrieve Customer Orders", + "description": "Retrieves a list of a Customer's Orders.", + "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": { + "payment_methods": { + "type": "array", + "items": { + "$ref": "#/components/schemas/order" + } + } + } + } + } + } + } + } + } + }, + "/customers/{id}/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": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Customer.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Customer" + ], + "responses": { + "204": { + "description": "OK" + } + } + } + }, + "/customers/{id}/reset-password": { + "post": { + "operationId": "PostCustomersCustomerResetPassword", + "summary": "Resets Customer password", + "description": "Resets a Customer's password using a password token created by a previous /password-token request.", + "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" + } + } + } + } + } + } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "email", + "token", + "password" + ], + "properties": { + "email": { + "type": "string", + "description": "The Customer's email." + }, + "token": { + "type": "string", + "description": "The password token created by a /password-token request." + }, + "password": { + "type": "string", + "description": "The new password to set for the Customer." + } + } + } + } + } + } + } + }, "/carts/{id}/shipping-methods": { "post": { "operationId": "PostCartsCartShippingMethod", @@ -258,7 +775,7 @@ } } }, - "/carts/{id}/complete-cart": { + "/carts/{id}/complete": { "post": { "summary": "Complete a Cart", "operationId": "PostCartsCartComplete", @@ -673,9 +1190,9 @@ } }, "post": { - "operationId": "PostCartsCartPaymentSessionsSession", - "summary": "Refresh a Payment Session", - "description": "Refreshes a Payment Session to ensure that it is in sync with the Cart - this is usually not necessary.", + "operationId": "PostCartsCartPaymentSessionUpdate", + "summary": "Update a Payment Session", + "description": "Updates a Payment Session with additional data.", "parameters": [ { "in": "path", @@ -690,7 +1207,7 @@ "in": "path", "name": "provider_id", "required": true, - "description": "The id of the Payment Provider that created the Payment Session to be refreshed.", + "description": "The id of the payment provider.", "schema": { "type": "string" } @@ -714,6 +1231,29 @@ } } } + }, + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "provider_id", + "data" + ], + "properties": { + "provider_id": { + "type": "string", + "description": "The id of the Payment Provider responsible for the Payment Session to update." + }, + "data": { + "type": "object", + "description": "The data to update the payment session with." + } + } + } + } + } } } }, @@ -916,571 +1456,6 @@ } } }, - "/carts/{id}/payment-session/update": { - "post": { - "operationId": "PostCartsCartPaymentSessionUpdate", - "summary": "Update a Payment Session", - "description": "Updates a Payment Session with additional data.", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Cart.", - "schema": { - "type": "string" - } - } - ], - "tags": [ - "Cart" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "cart": { - "$ref": "#/components/schemas/cart" - } - } - } - } - } - } - }, - "requestBody": { - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "provider_id", - "data" - ], - "properties": { - "provider_id": { - "type": "string", - "description": "The id of the Payment Provider responsible for the Payment Session to update." - }, - "data": { - "type": "object", - "description": "The data to update the payment session with." - } - } - } - } - } - } - } - }, - "/customers/{id}/addresses": { - "post": { - "operationId": "PostCustomersCustomerAddresses", - "summary": "Add a Shipping Address", - "description": "Adds a Shipping Address to a Customer's saved addresses.", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The Customer id.", - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "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/{id}/addresses/{address_id}": { - "delete": { - "operationId": "DeleteCustomersCustomerAddressesAddress", - "summary": "Delete an Address", - "description": "Removes an Address from the Customer's saved addresse.", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Customer.", - "schema": { - "type": "string" - } - }, - { - "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.", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The Customer id.", - "schema": { - "type": "string" - } - }, - { - "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/{id}": { - "get": { - "operationId": "GetCustomersCustomer", - "summary": "Retrieves a Customer", - "description": "Retrieves a Customer - the Customer must be logged in to retrieve their details.", - "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 Customer details", - "description": "Updates a Customer's saved details.", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Customer.", - "schema": { - "type": "string" - } - } - ], - "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" - }, - "password": { - "description": "The Customer's password.", - "type": "string" - }, - "phone": { - "description": "The Customer's phone number.", - "type": "string" - } - } - } - } - } - }, - "tags": [ - "Customer" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "customer": { - "$ref": "#/components/schemas/customer" - } - } - } - } - } - } - } - } - }, - "/customers/{id}/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.", - "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": { - "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/{id}/orders": { - "get": { - "operationId": "GetCustomersCustomerOrders", - "summary": "Retrieve Customer Orders", - "description": "Retrieves a list of a Customer's Orders.", - "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": { - "payment_methods": { - "type": "array", - "items": { - "$ref": "#/components/schemas/order" - } - } - } - } - } - } - } - } - } - }, - "/customers/{id}/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": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Customer.", - "schema": { - "type": "string" - } - } - ], - "tags": [ - "Customer" - ], - "responses": { - "204": { - "description": "OK" - } - } - } - }, - "/customers/{id}/reset-password": { - "post": { - "operationId": "PostCustomersCustomerResetPassword", - "summary": "Resets Customer password", - "description": "Resets a Customer's password using a password token created by a previous /password-token request.", - "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" - } - } - } - } - } - } - }, - "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." - } - } - } - } - } - } - } - }, "/gift-cards/{code}": { "get": { "operationId": "GetGiftCardsCode", @@ -1530,228 +1505,6 @@ } } }, - "/products/{id}": { - "get": { - "operationId": "GetProductsProduct", - "summary": "Retrieves a Product", - "description": "Retrieves a Product.", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Product.", - "schema": { - "type": "string" - } - } - ], - "tags": [ - "Product" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "product": { - "$ref": "#/components/schemas/product" - } - } - } - } - } - } - } - } - }, - "/products": { - "get": { - "operationId": "GetProducts", - "summary": "List Products", - "description": "Retrieves a list of Products.", - "tags": [ - "Product" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "count": { - "description": "The total number of Products.", - "type": "integer" - }, - "offset": { - "description": "The offset for pagination.", - "type": "integer" - }, - "limit": { - "description": "The maxmimum number of Products to return,", - "type": "integer" - }, - "products": { - "type": "array", - "items": { - "$ref": "#/components/schemas/product" - } - } - } - } - } - } - } - } - } - }, - "/return-reasons/{id}": { - "get": { - "operationId": "GetReturnReasonsReason", - "summary": "Retrieve a Return Reason", - "description": "Retrieves a Return Reason.", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Return Reason.", - "schema": { - "type": "string" - } - } - ], - "tags": [ - "Return Reason" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "return_reason": { - "$ref": "#/components/schemas/return_reason" - } - } - } - } - } - } - } - } - }, - "/return-reasons": { - "get": { - "operationId": "GetReturnReasons", - "summary": "List Return Reasons", - "description": "Retrieves a list of Return Reasons.", - "tags": [ - "Return Reason" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "return_reasons": { - "type": "array", - "items": { - "$ref": "#/components/schemas/return_reason" - } - } - } - } - } - } - } - } - } - }, - "/regions/{id}": { - "get": { - "operationId": "GetRegionsRegion", - "summary": "Retrieves a Region", - "description": "Retrieves a Region.", - "parameters": [ - { - "in": "path", - "name": "id", - "required": true, - "description": "The id of the Region.", - "schema": { - "type": "string" - } - } - ], - "tags": [ - "Region" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "region": { - "$ref": "#/components/schemas/region" - } - } - } - } - } - } - } - } - }, - "/regions": { - "get": { - "operationId": "GetRegions", - "summary": "List Regions", - "description": "Retrieves a list of Regions.", - "tags": [ - "Region" - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "properties": { - "count": { - "description": "The total number of regions.", - "type": "integer" - }, - "offset": { - "description": "The offset for pagination.", - "type": "integer" - }, - "limit": { - "description": "The maxmimum number of regions to return,", - "type": "integer" - }, - "regions": { - "type": "array", - "items": { - "$ref": "#/components/schemas/region" - } - } - } - } - } - } - } - } - } - }, "/orders/cart/{cart_id}": { "get": { "operationId": "GetOrdersOrderCartId", @@ -1872,6 +1625,228 @@ } } }, + "/products/{id}": { + "get": { + "operationId": "GetProductsProduct", + "summary": "Retrieves a Product", + "description": "Retrieves a Product.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Product.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Product" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "product": { + "$ref": "#/components/schemas/product" + } + } + } + } + } + } + } + } + }, + "/products": { + "get": { + "operationId": "GetProducts", + "summary": "List Products", + "description": "Retrieves a list of Products.", + "tags": [ + "Product" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "count": { + "description": "The total number of Products.", + "type": "integer" + }, + "offset": { + "description": "The offset for pagination.", + "type": "integer" + }, + "limit": { + "description": "The maxmimum number of Products to return,", + "type": "integer" + }, + "products": { + "type": "array", + "items": { + "$ref": "#/components/schemas/product" + } + } + } + } + } + } + } + } + } + }, + "/regions/{id}": { + "get": { + "operationId": "GetRegionsRegion", + "summary": "Retrieves a Region", + "description": "Retrieves a Region.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Region.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Region" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "region": { + "$ref": "#/components/schemas/region" + } + } + } + } + } + } + } + } + }, + "/regions": { + "get": { + "operationId": "GetRegions", + "summary": "List Regions", + "description": "Retrieves a list of Regions.", + "tags": [ + "Region" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "count": { + "description": "The total number of regions.", + "type": "integer" + }, + "offset": { + "description": "The offset for pagination.", + "type": "integer" + }, + "limit": { + "description": "The maxmimum number of regions to return,", + "type": "integer" + }, + "regions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/region" + } + } + } + } + } + } + } + } + } + }, + "/return-reasons/{id}": { + "get": { + "operationId": "GetReturnReasonsReason", + "summary": "Retrieve a Return Reason", + "description": "Retrieves a Return Reason.", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "description": "The id of the Return Reason.", + "schema": { + "type": "string" + } + } + ], + "tags": [ + "Return Reason" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "return_reason": { + "$ref": "#/components/schemas/return_reason" + } + } + } + } + } + } + } + } + }, + "/return-reasons": { + "get": { + "operationId": "GetReturnReasons", + "summary": "List Return Reasons", + "description": "Retrieves a list of Return Reasons.", + "tags": [ + "Return Reason" + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "properties": { + "return_reasons": { + "type": "array", + "items": { + "$ref": "#/components/schemas/return_reason" + } + } + } + } + } + } + } + } + } + }, "/returns": { "post": { "operationId": "PostReturns", @@ -2505,6 +2480,10 @@ "type": "string", "format": "date-time" }, + "no_notification": { + "description": "Flag for describing whether or not notifications related to this should be send.", + "type": "boolean" + }, "metadata": { "type": "object" } @@ -2696,10 +2675,6 @@ "$ref": "#/components/schemas/product" } }, - "usage_limit": { - "description": "The maximum number of times that a discount can be used.", - "type": "integer" - }, "created_at": { "description": "The date with timezone at which the resource was created.", "type": "string", @@ -2771,6 +2746,14 @@ "$ref": "#/components/schemas/region" } }, + "usage_limit": { + "description": "The maximum number of times that a discount can be used.", + "type": "integer" + }, + "usage_count": { + "description": "The number of times a discount has been used.", + "type": "integer" + }, "created_at": { "description": "The date with timezone at which the resource was created.", "type": "string", @@ -2792,6 +2775,75 @@ } } }, + "draft-order": { + "title": "DraftOrder", + "description": "Represents a draft order", + "x-resourceId": "draft-order", + "properties": { + "id": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "open", + "completed" + ] + }, + "display_id": { + "type": "string" + }, + "cart_id": { + "type": "string" + }, + "cart": { + "anyOf": [ + { + "$ref": "#/components/schemas/cart" + } + ] + }, + "order_id": { + "type": "string" + }, + "order": { + "anyOf": [ + { + "$ref": "#/components/schemas/order" + } + ] + }, + "canceled_at": { + "type": "string", + "format": "date-time" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "update_at": { + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "type": "string", + "format": "date-time" + }, + "completed_at": { + "type": "string", + "format": "date-time" + }, + "no_notification_order": { + "type": "boolean" + }, + "metadata": { + "type": "object" + }, + "idempotency_key": { + "type": "string" + } + } + }, "fulfillment_item": { "title": "Fulfillment Item", "description": "Correlates a Line Item with a Fulfillment, keeping track of the quantity of the Line Item.", @@ -2886,6 +2938,10 @@ "type": "string", "format": "date-time" }, + "no_notification": { + "description": "Flag for describing whether or not notifications related to this should be send.", + "type": "boolean" + }, "canceled_at": { "description": "The date with timezone at which the Fulfillment was canceled.", "type": "string", @@ -3545,6 +3601,13 @@ }, "gift_card_total": { "type": "integer" + }, + "paid_total": { + "type": "integer" + }, + "no_notification": { + "description": "Flag for describing whether or not notifications related to this should be send.", + "type": "boolean" } } }, @@ -4019,6 +4082,10 @@ "description": "Whether the Product represents a Gift Card. Products that represent Gift Cards will automatically generate a redeemable Gift Card code once they are purchased.", "type": "boolean" }, + "discountable": { + "description": "Whether the Product can be discounted. Discounts will not apply to Line Items of this Product when this flag is set to `false`.", + "type": "boolean" + }, "images": { "description": "Images of the Product", "type": "array", @@ -4400,6 +4467,10 @@ "type": "string", "format": "date-time" }, + "no_notification": { + "description": "When set to true, no notification will be sent related to this return.", + "type": "boolean" + }, "metadata": { "description": "An optional key-value map with additional information.", "type": "object" @@ -4778,6 +4849,10 @@ "type": "string", "format": "date-time" }, + "no_notification": { + "description": "If set to true, no notification will be sent related to this swap", + "type": "boolean" + }, "metadata": { "description": "An optional key-value map with additional information.", "type": "object" diff --git a/docs/api/store-spec3.yaml b/docs/api/store-spec3.yaml index 43e7a49d17..f9adc8ff10 100644 --- a/docs/api/store-spec3.yaml +++ b/docs/api/store-spec3.yaml @@ -40,87 +40,6 @@ tags: servers: - url: 'https://api.medusa-commerce.com/store' paths: - /auth: - post: - operationId: PostAuth - summary: Authenticate Customer - description: >- - Logs a Customer in and authorizes them to view their details. Successful - authentication will set a session cookie in the Customer's browser. - parameters: [] - tags: - - Auth - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - customer: - $ref: '#/components/schemas/customer' - requestBody: - content: - application/json: - schema: - type: object - required: - - email - - password - properties: - email: - type: string - description: The Customer's email. - password: - type: string - description: The Customer's password. - delete: - operationId: DeleteAuth - summary: Log out - description: Destroys a Customer's authenticated session. - tags: - - Auth - responses: - '200': - description: OK - get: - operationId: GetAuth - summary: Get Session - description: Gets the currently logged in Customer. - tags: - - Auth - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - customer: - $ref: '#/components/schemas/customer' - '/auth/{email}': - get: - operationId: GetAuthEmail - summary: Check if email has account - description: Checks if a Customer with the given email has signed up. - parameters: - - in: path - name: email - required: true - description: The Customer's email. - schema: - type: string - tags: - - Auth - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - exists: - type: boolean '/carts/{id}/shipping-methods': post: operationId: PostCartsCartShippingMethod @@ -162,7 +81,7 @@ paths: process the fulfillment of the order. Look at the documentation for your installed fulfillment providers to find out what to send. - '/carts/{id}/complete-cart': + '/carts/{id}/complete': post: summary: Complete a Cart operationId: PostCartsCartComplete @@ -457,11 +376,9 @@ paths: cart: $ref: '#/components/schemas/cart' post: - operationId: PostCartsCartPaymentSessionsSession - summary: Refresh a Payment Session - description: >- - Refreshes a Payment Session to ensure that it is in sync with the Cart - - this is usually not necessary. + operationId: PostCartsCartPaymentSessionUpdate + summary: Update a Payment Session + description: Updates a Payment Session with additional data. parameters: - in: path name: id @@ -472,9 +389,7 @@ paths: - in: path name: provider_id required: true - description: >- - The id of the Payment Provider that created the Payment Session to - be refreshed. + description: The id of the payment provider. schema: type: string tags: @@ -488,6 +403,23 @@ paths: properties: cart: $ref: '#/components/schemas/cart' + requestBody: + content: + application/json: + schema: + type: object + required: + - provider_id + - data + properties: + provider_id: + type: string + description: >- + The id of the Payment Provider responsible for the Payment + Session to update. + data: + type: object + description: The data to update the payment session with. '/carts/{id}': get: operationId: GetCartsCart @@ -614,46 +546,6 @@ paths: properties: cart: $ref: '#/components/schemas/cart' - '/carts/{id}/payment-session/update': - post: - operationId: PostCartsCartPaymentSessionUpdate - summary: Update a Payment Session - description: Updates a Payment Session with additional data. - parameters: - - in: path - name: id - required: true - description: The id of the Cart. - schema: - type: string - tags: - - Cart - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - cart: - $ref: '#/components/schemas/cart' - requestBody: - content: - application/json: - schema: - type: object - required: - - provider_id - - data - properties: - provider_id: - type: string - description: >- - The id of the Payment Provider responsible for the Payment - Session to update. - data: - type: object - description: The data to update the payment session with. '/customers/{id}/addresses': post: operationId: PostCustomersCustomerAddresses @@ -842,12 +734,19 @@ paths: 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 + metadata: + description: Metadata about the customer. + type: object tags: - Customer responses: @@ -986,6 +885,87 @@ paths: password: type: string description: The new password to set for the Customer. + /auth: + post: + operationId: PostAuth + summary: Authenticate Customer + description: >- + Logs a Customer in and authorizes them to view their details. Successful + authentication will set a session cookie in the Customer's browser. + parameters: [] + tags: + - Auth + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + customer: + $ref: '#/components/schemas/customer' + requestBody: + content: + application/json: + schema: + type: object + required: + - email + - password + properties: + email: + type: string + description: The Customer's email. + password: + type: string + description: The Customer's password. + delete: + operationId: DeleteAuth + summary: Log out + description: Destroys a Customer's authenticated session. + tags: + - Auth + responses: + '200': + description: OK + get: + operationId: GetAuth + summary: Get Session + description: Gets the currently logged in Customer. + tags: + - Auth + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + customer: + $ref: '#/components/schemas/customer' + '/auth/{email}': + get: + operationId: GetAuthEmail + summary: Check if email has account + description: Checks if a Customer with the given email has signed up. + parameters: + - in: path + name: email + required: true + description: The Customer's email. + schema: + type: string + tags: + - Auth + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + exists: + type: boolean '/gift-cards/{code}': get: operationId: GetGiftCardsCode @@ -1147,47 +1127,6 @@ paths: type: array items: $ref: '#/components/schemas/product' - '/return-reasons/{id}': - get: - operationId: GetReturnReasonsReason - summary: Retrieve a Return Reason - description: Retrieves a Return Reason. - parameters: - - in: path - name: id - required: true - description: The id of the Return Reason. - schema: - type: string - tags: - - Return Reason - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - return_reason: - $ref: '#/components/schemas/return_reason' - /return-reasons: - get: - operationId: GetReturnReasons - summary: List Return Reasons - description: Retrieves a list of Return Reasons. - tags: - - Return Reason - responses: - '200': - description: OK - content: - application/json: - schema: - properties: - return_reasons: - type: array - items: - $ref: '#/components/schemas/return_reason' '/regions/{id}': get: operationId: GetRegionsRegion @@ -1238,6 +1177,47 @@ paths: type: array items: $ref: '#/components/schemas/region' + '/return-reasons/{id}': + get: + operationId: GetReturnReasonsReason + summary: Retrieve a Return Reason + description: Retrieves a Return Reason. + parameters: + - in: path + name: id + required: true + description: The id of the Return Reason. + schema: + type: string + tags: + - Return Reason + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + return_reason: + $ref: '#/components/schemas/return_reason' + /return-reasons: + get: + operationId: GetReturnReasons + summary: List Return Reasons + description: Retrieves a list of Return Reasons. + tags: + - Return Reason + responses: + '200': + description: OK + content: + application/json: + schema: + properties: + return_reasons: + type: array + items: + $ref: '#/components/schemas/return_reason' /returns: post: operationId: PostReturns @@ -1682,6 +1662,11 @@ components: deleted_at: type: string format: date-time + no_notification: + description: >- + Flag for describing whether or not notifications related to this + should be send. + type: boolean metadata: type: object claim_tag: @@ -1829,9 +1814,6 @@ components: type: array items: $ref: '#/components/schemas/product' - usage_limit: - description: The maximum number of times that a discount can be used. - type: integer created_at: description: The date with timezone at which the resource was created. type: string @@ -1894,6 +1876,12 @@ components: type: array items: $ref: '#/components/schemas/region' + usage_limit: + description: The maximum number of times that a discount can be used. + type: integer + usage_count: + description: The number of times a discount has been used. + type: integer created_at: description: The date with timezone at which the resource was created. type: string @@ -1909,6 +1897,51 @@ components: metadata: description: An optional key-value map with additional information. type: object + draft-order: + title: DraftOrder + description: Represents a draft order + x-resourceId: draft-order + properties: + id: + type: string + status: + type: string + enum: + - open + - completed + display_id: + type: string + cart_id: + type: string + cart: + anyOf: + - $ref: '#/components/schemas/cart' + order_id: + type: string + order: + anyOf: + - $ref: '#/components/schemas/order' + canceled_at: + type: string + format: date-time + created_at: + type: string + format: date-time + update_at: + type: string + format: date-time + deleted_at: + type: string + format: date-time + completed_at: + type: string + format: date-time + no_notification_order: + type: boolean + metadata: + type: object + idempotency_key: + type: string fulfillment_item: title: Fulfillment Item description: >- @@ -2001,6 +2034,11 @@ components: description: The date with timezone at which the Fulfillment was shipped. type: string format: date-time + no_notification: + description: >- + Flag for describing whether or not notifications related to this + should be send. + type: boolean canceled_at: description: The date with timezone at which the Fulfillment was canceled. type: string @@ -2527,6 +2565,13 @@ components: type: integer gift_card_total: type: integer + paid_total: + type: integer + no_notification: + description: >- + Flag for describing whether or not notifications related to this + should be send. + type: boolean payment_provider: title: Payment Provider description: Represents a Payment Provider plugin and holds its installation status. @@ -2993,6 +3038,11 @@ components: Gift Cards will automatically generate a redeemable Gift Card code once they are purchased. type: boolean + discountable: + description: >- + Whether the Product can be discounted. Discounts will not apply to + Line Items of this Product when this flag is set to `false`. + type: boolean images: description: Images of the Product type: array @@ -3332,6 +3382,11 @@ components: description: The date with timezone at which the resource was last updated. type: string format: date-time + no_notification: + description: >- + When set to true, no notification will be sent related to this + return. + type: boolean metadata: description: An optional key-value map with additional information. type: object @@ -3692,6 +3747,9 @@ components: description: The date with timezone at which the resource was last updated. type: string format: date-time + no_notification: + description: 'If set to true, no notification will be sent related to this swap' + type: boolean metadata: description: An optional key-value map with additional information. type: object diff --git a/packages/medusa/src/api/routes/admin/discounts/get-discount-by-code.js b/packages/medusa/src/api/routes/admin/discounts/get-discount-by-code.js index 550dec65f4..83306f7d88 100644 --- a/packages/medusa/src/api/routes/admin/discounts/get-discount-by-code.js +++ b/packages/medusa/src/api/routes/admin/discounts/get-discount-by-code.js @@ -1,7 +1,7 @@ import { defaultFields, defaultRelations } from "./" /** - * @oas [get] /discounts/code/{id} + * @oas [get] /discounts/code/{code} * operationId: "GetDiscountsDiscountCode" * summary: "Retrieve a Discount by code" * description: "Retrieves a Discount by its discount code" diff --git a/packages/medusa/src/models/product.ts b/packages/medusa/src/models/product.ts index 122ff17bd7..506e7ebc8a 100644 --- a/packages/medusa/src/models/product.ts +++ b/packages/medusa/src/models/product.ts @@ -189,7 +189,7 @@ export class Product { * description: "Whether the Product represents a Gift Card. Products that represent Gift Cards will automatically generate a redeemable Gift Card code once they are purchased." * type: boolean * discountable: - * description: "Whether the Product can be discounted. Discounts will not apply to Line Items of this Product when this flag is set to `false`. + * description: "Whether the Product can be discounted. Discounts will not apply to Line Items of this Product when this flag is set to `false`." * type: boolean * images: * description: "Images of the Product" diff --git a/scripts/build-openapi.js b/scripts/build-openapi.js index 6ddcc91e66..734960a40c 100755 --- a/scripts/build-openapi.js +++ b/scripts/build-openapi.js @@ -14,6 +14,7 @@ swaggerInline( const oas = new OAS(gen); oas.validate((err, genObj) => { if (err) { + console.log("Error in store"); console.error(err); return; } @@ -41,6 +42,7 @@ swaggerInline( const oas = new OAS(gen); oas.validate((err, genObj) => { if (err) { + console.log("Error in admin"); console.error(err); return; }