From 7865909891fbd7152941ad4676e9bfa58ac2b72d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 25 Nov 2024 14:33:22 +0000 Subject: [PATCH] chore(docs): Updated API Reference (automated) (#10258) Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com> --- .../redocly/redocly-config.yaml | 6 + .../Shell/admin_orders_{id}/post.sh | 2 - .../Shell/admin_orders_{id}_transfer/post.sh | 6 + .../admin_orders_{id}_transfer_cancel/post.sh | 2 + .../schemas/AdminBatchProductRequest.yaml | 2 +- .../schemas/AdminBatchUpdateProduct.yaml | 159 +++++ .../components/schemas/AdminProductImage.yaml | 5 + .../schemas/AdminTransferOrder.yaml | 20 + .../schemas/BaseCalculatedPriceSet.yaml | 54 ++ .../schemas/BaseCartShippingMethod.yaml | 20 +- .../schemas/BaseLineItemAdjustment.yaml | 16 +- .../schemas/BaseLineItemTaxLine.yaml | 20 +- .../components/schemas/BaseProductImage.yaml | 5 + .../schemas/StoreAcceptOrderTransfer.yaml | 10 + .../StoreDeclineOrderTransferRequest.yaml | 10 + .../components/schemas/StoreProductImage.yaml | 5 + .../schemas/StoreRequestOrderTransfer.yaml | 10 + .../specs/admin/openapi.full.yaml | 513 +++++++++++--- .../api-reference/specs/admin/openapi.yaml | 4 + .../specs/admin/paths/admin_draft-orders.yaml | 2 +- .../specs/admin/paths/admin_orders_{id}.yaml | 60 -- .../paths/admin_orders_{id}_transfer.yaml | 73 ++ .../admin_orders_{id}_transfer_cancel.yaml | 64 ++ .../Shell/store_carts_{id}_customer/post.sh | 2 + .../store_orders_{id}_transfer_accept/post.sh | 6 + .../store_orders_{id}_transfer_cancel/post.sh | 2 + .../post.sh | 6 + .../post.sh | 2 + .../schemas/AdminBatchProductRequest.yaml | 2 +- .../schemas/AdminBatchUpdateProduct.yaml | 159 +++++ .../components/schemas/AdminProductImage.yaml | 5 + .../schemas/AdminTransferOrder.yaml | 20 + .../schemas/BaseCalculatedPriceSet.yaml | 54 ++ .../schemas/BaseCartShippingMethod.yaml | 20 +- .../components/schemas/BaseCollection.yaml | 2 +- .../schemas/BaseLineItemAdjustment.yaml | 16 +- .../schemas/BaseLineItemTaxLine.yaml | 20 +- .../schemas/BaseProductCategory.yaml | 2 +- .../components/schemas/BaseProductImage.yaml | 5 + .../store/components/schemas/Return.yaml | 2 +- .../schemas/StoreAcceptOrderTransfer.yaml | 10 + .../StoreDeclineOrderTransferRequest.yaml | 10 + .../components/schemas/StoreProductImage.yaml | 5 + .../schemas/StoreRequestOrderTransfer.yaml | 10 + .../specs/store/openapi.full.yaml | 638 +++++++++++++++++- .../api-reference/specs/store/openapi.yaml | 10 + .../paths/store_carts_{id}_customer.yaml | 66 ++ .../store_orders_{id}_transfer_accept.yaml | 72 ++ .../store_orders_{id}_transfer_cancel.yaml | 67 ++ .../store_orders_{id}_transfer_decline.yaml | 68 ++ .../store_orders_{id}_transfer_request.yaml | 72 ++ .../admin/post_admin_draft-orders.ts | 2 +- .../admin/post_admin_orders_[id]_transfer.ts | 72 ++ ...post_admin_orders_[id]_transfer_cancel.ts} | 22 +- .../store/post_store_carts_[id]_customer.ts | 62 ++ .../post_store_orders_[id]_transfer_accept.ts | 70 ++ .../post_store_orders_[id]_transfer_cancel.ts | 62 ++ ...post_store_orders_[id]_transfer_decline.ts | 68 ++ ...post_store_orders_[id]_transfer_request.ts | 68 ++ .../schemas/AdminBatchProductRequest.ts | 2 +- .../schemas/AdminBatchUpdateProduct.ts | 162 +++++ .../oas-output/schemas/AdminProductImage.ts | 5 + .../oas-output/schemas/AdminTransferOrder.ts | 23 + .../schemas/BaseCalculatedPriceSet.ts | 54 ++ .../schemas/BaseCartShippingMethod.ts | 20 +- .../schemas/BaseLineItemAdjustment.ts | 16 +- .../oas-output/schemas/BaseLineItemTaxLine.ts | 20 +- .../oas-output/schemas/BaseProductImage.ts | 5 + .../schemas/StoreAcceptOrderTransfer.ts | 15 + .../StoreDeclineOrderTransferRequest.ts | 15 + .../oas-output/schemas/StoreProductImage.ts | 5 + .../schemas/StoreRequestOrderTransfer.ts | 13 + .../docs-generator/src/classes/kinds/oas.ts | 8 + 73 files changed, 2939 insertions(+), 271 deletions(-) delete mode 100644 www/apps/api-reference/specs/admin/code_samples/Shell/admin_orders_{id}/post.sh create mode 100644 www/apps/api-reference/specs/admin/code_samples/Shell/admin_orders_{id}_transfer/post.sh create mode 100644 www/apps/api-reference/specs/admin/code_samples/Shell/admin_orders_{id}_transfer_cancel/post.sh create mode 100644 www/apps/api-reference/specs/admin/components/schemas/AdminBatchUpdateProduct.yaml create mode 100644 www/apps/api-reference/specs/admin/components/schemas/AdminTransferOrder.yaml create mode 100644 www/apps/api-reference/specs/admin/components/schemas/StoreAcceptOrderTransfer.yaml create mode 100644 www/apps/api-reference/specs/admin/components/schemas/StoreDeclineOrderTransferRequest.yaml create mode 100644 www/apps/api-reference/specs/admin/components/schemas/StoreRequestOrderTransfer.yaml create mode 100644 www/apps/api-reference/specs/admin/paths/admin_orders_{id}_transfer.yaml create mode 100644 www/apps/api-reference/specs/admin/paths/admin_orders_{id}_transfer_cancel.yaml create mode 100644 www/apps/api-reference/specs/store/code_samples/Shell/store_carts_{id}_customer/post.sh create mode 100644 www/apps/api-reference/specs/store/code_samples/Shell/store_orders_{id}_transfer_accept/post.sh create mode 100644 www/apps/api-reference/specs/store/code_samples/Shell/store_orders_{id}_transfer_cancel/post.sh create mode 100644 www/apps/api-reference/specs/store/code_samples/Shell/store_orders_{id}_transfer_decline/post.sh create mode 100644 www/apps/api-reference/specs/store/code_samples/Shell/store_orders_{id}_transfer_request/post.sh create mode 100644 www/apps/api-reference/specs/store/components/schemas/AdminBatchUpdateProduct.yaml create mode 100644 www/apps/api-reference/specs/store/components/schemas/AdminTransferOrder.yaml create mode 100644 www/apps/api-reference/specs/store/components/schemas/StoreAcceptOrderTransfer.yaml create mode 100644 www/apps/api-reference/specs/store/components/schemas/StoreDeclineOrderTransferRequest.yaml create mode 100644 www/apps/api-reference/specs/store/components/schemas/StoreRequestOrderTransfer.yaml create mode 100644 www/apps/api-reference/specs/store/paths/store_carts_{id}_customer.yaml create mode 100644 www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_accept.yaml create mode 100644 www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_cancel.yaml create mode 100644 www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_decline.yaml create mode 100644 www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_request.yaml create mode 100644 www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_transfer.ts rename www/utils/generated/oas-output/operations/admin/{post_admin_orders_[id].ts => post_admin_orders_[id]_transfer_cancel.ts} (62%) create mode 100644 www/utils/generated/oas-output/operations/store/post_store_carts_[id]_customer.ts create mode 100644 www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_accept.ts create mode 100644 www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_cancel.ts create mode 100644 www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_decline.ts create mode 100644 www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_request.ts create mode 100644 www/utils/generated/oas-output/schemas/AdminBatchUpdateProduct.ts create mode 100644 www/utils/generated/oas-output/schemas/AdminTransferOrder.ts create mode 100644 www/utils/generated/oas-output/schemas/StoreAcceptOrderTransfer.ts create mode 100644 www/utils/generated/oas-output/schemas/StoreDeclineOrderTransferRequest.ts create mode 100644 www/utils/generated/oas-output/schemas/StoreRequestOrderTransfer.ts diff --git a/packages/cli/oas/medusa-oas-cli/redocly/redocly-config.yaml b/packages/cli/oas/medusa-oas-cli/redocly/redocly-config.yaml index 5a0bb47d67f21..9c04723cfbec6 100644 --- a/packages/cli/oas/medusa-oas-cli/redocly/redocly-config.yaml +++ b/packages/cli/oas/medusa-oas-cli/redocly/redocly-config.yaml @@ -131,6 +131,12 @@ decorators: - AdminPaymentCollection StoreProductVariant: - StoreProduct + BaseCollection: + - BaseProduct + BaseProductCategory: + - AdminProduct + Return: + - OrderExchange theme: openapi: theme: diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_orders_{id}/post.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_orders_{id}/post.sh deleted file mode 100644 index d3c39b10fd2c5..0000000000000 --- a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_orders_{id}/post.sh +++ /dev/null @@ -1,2 +0,0 @@ -curl -X POST '{backend_url}/admin/orders/{id}' \ --H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_orders_{id}_transfer/post.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_orders_{id}_transfer/post.sh new file mode 100644 index 0000000000000..47679d1a792b1 --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_orders_{id}_transfer/post.sh @@ -0,0 +1,6 @@ +curl -X POST '{backend_url}/admin/orders/{id}/transfer' \ +-H 'Authorization: Bearer {access_token}' \ +-H 'Content-Type: application/json' \ +--data-raw '{ + "customer_id": "cus_123" +}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/code_samples/Shell/admin_orders_{id}_transfer_cancel/post.sh b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_orders_{id}_transfer_cancel/post.sh new file mode 100644 index 0000000000000..d24dfa8096b7b --- /dev/null +++ b/www/apps/api-reference/specs/admin/code_samples/Shell/admin_orders_{id}_transfer_cancel/post.sh @@ -0,0 +1,2 @@ +curl -X POST '{backend_url}/admin/orders/{id}/transfer/cancel' \ +-H 'Authorization: Bearer {access_token}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminBatchProductRequest.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminBatchProductRequest.yaml index 5f35aa599fcad..46abcccd8a61f 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/AdminBatchProductRequest.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminBatchProductRequest.yaml @@ -11,7 +11,7 @@ properties: type: array description: The products to update. items: - $ref: ./AdminUpdateProduct.yaml + $ref: ./AdminBatchUpdateProduct.yaml delete: type: array description: The products to delete. diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminBatchUpdateProduct.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminBatchUpdateProduct.yaml new file mode 100644 index 0000000000000..fcbe73708b8c3 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminBatchUpdateProduct.yaml @@ -0,0 +1,159 @@ +type: object +description: The product's details. +x-schemaName: AdminBatchUpdateProduct +properties: + title: + type: string + title: title + description: The product's title. + subtitle: + type: string + title: subtitle + description: The product's subtitle. + description: + type: string + title: description + description: The product's description. + is_giftcard: + type: boolean + title: is_giftcard + description: Whether the product is a gift card. + discountable: + type: boolean + title: discountable + description: Whether discounts can be applied on the product. + images: + type: array + description: The product's images. + items: + type: object + description: The image's details. + required: + - url + properties: + url: + type: string + title: url + description: The image's URL. + thumbnail: + type: string + title: thumbnail + description: The product's thumbnail URL. + handle: + type: string + title: handle + description: The product's unique handle. + status: + type: string + description: The product's status. + enum: + - draft + - proposed + - published + - rejected + type_id: + type: string + title: type_id + description: The ID of the product's type. + collection_id: + type: string + title: collection_id + description: The ID of the product's collection. + categories: + type: array + description: The product's categories. + items: + type: object + description: The product's category. + required: + - id + properties: + id: + type: string + title: id + description: The category's ID. + tags: + type: array + description: The product's tags. + items: + type: object + description: The product's tag. + required: + - id + properties: + id: + type: string + title: id + description: The tag's ID. + options: + type: array + description: The product's options. + items: + $ref: ./AdminUpdateProductOption.yaml + variants: + type: array + description: >- + The product's variants. You can add new variants or update existing ones, + passing their IDs in the object. + items: + oneOf: + - $ref: ./AdminCreateProductVariant.yaml + - $ref: ./AdminUpdateProductVariant.yaml + sales_channels: + type: array + description: The sales channels that the product is available in. + items: + type: object + description: The sales channel's details. + required: + - id + properties: + id: + type: string + title: id + description: The sales channel's ID. + weight: + type: number + title: weight + description: The product's weight. + length: + type: number + title: length + description: The product's length. + height: + type: number + title: height + description: The product's height. + width: + type: number + title: width + description: The product's width. + hs_code: + type: string + title: hs_code + description: The product's HS code. + mid_code: + type: string + title: mid_code + description: The product's MID code. + origin_country: + type: string + title: origin_country + description: The product's origin country. + material: + type: string + title: material + description: The product's material. + metadata: + type: object + description: The product's metadata, can hold custom key-value pairs. + external_id: + type: string + title: external_id + description: The ID of the product in an external or third-party system. + id: + type: string + title: id + description: The product's ID. +required: + - id diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminProductImage.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminProductImage.yaml index 050650545a5da..d1561e5a2fcf4 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/AdminProductImage.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminProductImage.yaml @@ -28,6 +28,11 @@ properties: metadata: type: object description: The image's metadata, can hold custom key-value pairs. + rank: + type: number + title: rank + description: The image's rank among sibling images. required: - id - url + - rank diff --git a/www/apps/api-reference/specs/admin/components/schemas/AdminTransferOrder.yaml b/www/apps/api-reference/specs/admin/components/schemas/AdminTransferOrder.yaml new file mode 100644 index 0000000000000..675e3606c1b0c --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/AdminTransferOrder.yaml @@ -0,0 +1,20 @@ +type: object +description: The details of the request to transfer the order. +x-schemaName: AdminTransferOrder +required: + - customer_id +properties: + customer_id: + type: string + title: customer_id + description: The ID of the customer to transfer the order to. + description: + type: string + title: description + description: >- + The description of the order transfer, which can be shown to the customer + receiving the order transfer request. + internal_note: + type: string + title: internal_note + description: An internal note viewable only by admin users. diff --git a/www/apps/api-reference/specs/admin/components/schemas/BaseCalculatedPriceSet.yaml b/www/apps/api-reference/specs/admin/components/schemas/BaseCalculatedPriceSet.yaml index ac22d66e394f8..ec11356ec0947 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/BaseCalculatedPriceSet.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/BaseCalculatedPriceSet.yaml @@ -56,6 +56,60 @@ properties: calculated_price: type: object description: The calculated price's details. + properties: + id: + type: string + title: id + description: The ID of the price. + price_list_id: + type: string + title: price_list_id + description: The ID of the associated price list. + price_list_type: + type: string + title: price_list_type + description: The price list's type. For example, sale. + min_quantity: + type: number + title: min_quantity + description: The minimum quantity required in the cart for this price to apply. + max_quantity: + type: number + title: max_quantity + description: The maximum quantity allowed in the cart for this price to apply. + required: + - id + - price_list_id + - price_list_type + - min_quantity + - max_quantity original_price: type: object description: The original price's details. + properties: + id: + type: string + title: id + description: The ID of the price. + price_list_id: + type: string + title: price_list_id + description: The ID of the associated price list. + price_list_type: + type: string + title: price_list_type + description: The price list's type. For example, sale. + min_quantity: + type: number + title: min_quantity + description: The minimum quantity required in the cart for this price to apply. + max_quantity: + type: number + title: max_quantity + description: The maximum quantity allowed in the cart for this price to apply. + required: + - id + - price_list_id + - price_list_type + - min_quantity + - max_quantity diff --git a/www/apps/api-reference/specs/admin/components/schemas/BaseCartShippingMethod.yaml b/www/apps/api-reference/specs/admin/components/schemas/BaseCartShippingMethod.yaml index 1dbcebc278269..0a23a60cdc4c2 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/BaseCartShippingMethod.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/BaseCartShippingMethod.yaml @@ -53,7 +53,7 @@ properties: services. externalDocs: url: >- - https://docs.medusajs.com/v2/resources/commerce-modules/cart/concepts#data-property + https://docs.medusajs.com/resources/commerce-modules/cart/concepts#data-property metadata: type: object description: The shipping method's metadata, can hold custom key-value pairs. @@ -78,38 +78,38 @@ properties: title: updated_at description: The date the shipping method was updated. original_total: - type: string + type: number title: original_total description: The shipping method's total including taxes, excluding promotions. original_subtotal: - type: string + type: number title: original_subtotal description: The shipping method's total excluding taxes, including promotions. original_tax_total: - type: string + type: number title: original_tax_total description: >- The total taxes applied on the shipping method's amount including promotions. total: - type: string + type: number title: total description: The shipping method's total amount including taxes and promotions. subtotal: - type: string + type: number title: subtotal description: The shipping method's total amount excluding taxes, including promotions. tax_total: - type: string + type: number title: tax_total description: >- The total taxes applied on the shipping method's amount including promotions. discount_total: - type: string + type: number title: discount_total description: The total amount discounted. discount_tax_total: - type: string - title: discount_total + type: number + title: discount_tax_total description: The taxes applied on the discounted amount. diff --git a/www/apps/api-reference/specs/admin/components/schemas/BaseLineItemAdjustment.yaml b/www/apps/api-reference/specs/admin/components/schemas/BaseLineItemAdjustment.yaml index af9b884de8cdf..70d85b5243b6b 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/BaseLineItemAdjustment.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/BaseLineItemAdjustment.yaml @@ -1,6 +1,14 @@ type: object description: The adjustment's details. x-schemaName: BaseLineItemAdjustment +required: + - item + - item_id + - id + - amount + - cart_id + - created_at + - updated_at properties: item: type: object @@ -46,11 +54,3 @@ properties: format: date-time title: updated_at description: The date the adjustment was updated. -required: - - item - - item_id - - id - - amount - - cart_id - - created_at - - updated_at diff --git a/www/apps/api-reference/specs/admin/components/schemas/BaseLineItemTaxLine.yaml b/www/apps/api-reference/specs/admin/components/schemas/BaseLineItemTaxLine.yaml index 63946d4c1ff10..5ab35961357fd 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/BaseLineItemTaxLine.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/BaseLineItemTaxLine.yaml @@ -1,6 +1,16 @@ type: object description: The tax line's details x-schemaName: BaseLineItemTaxLine +required: + - item + - item_id + - total + - subtotal + - id + - code + - rate + - created_at + - updated_at properties: item: $ref: ./BaseCartLineItem.yaml @@ -50,13 +60,3 @@ properties: format: date-time title: updated_at description: The date the tax line was updated. -required: - - item - - item_id - - total - - subtotal - - id - - code - - rate - - created_at - - updated_at diff --git a/www/apps/api-reference/specs/admin/components/schemas/BaseProductImage.yaml b/www/apps/api-reference/specs/admin/components/schemas/BaseProductImage.yaml index f1e59ad937a5e..25637c69e893d 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/BaseProductImage.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/BaseProductImage.yaml @@ -28,6 +28,11 @@ properties: metadata: type: object description: The image's metadata, can hold custom key-value pairs. + rank: + type: number + title: rank + description: The image's rank among its sibling images. required: - id - url + - rank diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreAcceptOrderTransfer.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreAcceptOrderTransfer.yaml new file mode 100644 index 0000000000000..c7bf57491b8b9 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreAcceptOrderTransfer.yaml @@ -0,0 +1,10 @@ +type: object +description: The details of accepting the order transfer. +x-schemaName: StoreAcceptOrderTransfer +required: + - token +properties: + token: + type: string + title: token + description: The order transfer's token issued when the transfer was requested. diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreDeclineOrderTransferRequest.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreDeclineOrderTransferRequest.yaml new file mode 100644 index 0000000000000..ab03d7e6b8730 --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreDeclineOrderTransferRequest.yaml @@ -0,0 +1,10 @@ +type: object +description: The details of declining the order transfer request. +x-schemaName: StoreDeclineOrderTransferRequest +required: + - token +properties: + token: + type: string + title: token + description: The order transfer's token issued when the transfer was requested. diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreProductImage.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreProductImage.yaml index 632f1a9c1a929..a3b3b1c72afd1 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/StoreProductImage.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreProductImage.yaml @@ -4,6 +4,7 @@ x-schemaName: StoreProductImage required: - id - url + - rank properties: id: type: string @@ -31,3 +32,7 @@ properties: metadata: type: object description: The image's metadata, can hold custom key-value pairs. + rank: + type: number + title: rank + description: The image's rank among its sibling images diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreRequestOrderTransfer.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreRequestOrderTransfer.yaml new file mode 100644 index 0000000000000..e2c65712ca9fb --- /dev/null +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreRequestOrderTransfer.yaml @@ -0,0 +1,10 @@ +type: object +description: The details of requesting the order transfer. +x-schemaName: StoreRequestOrderTransfer +properties: + description: + type: string + title: description + description: >- + The transfer's description, which can be shown to the other customer + receiving the request. diff --git a/www/apps/api-reference/specs/admin/openapi.full.yaml b/www/apps/api-reference/specs/admin/openapi.full.yaml index 9890edb795961..8f67e56846073 100644 --- a/www/apps/api-reference/specs/admin/openapi.full.yaml +++ b/www/apps/api-reference/specs/admin/openapi.full.yaml @@ -13379,7 +13379,7 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' - x-workflow: createOrdersWorkflow + x-workflow: createOrderWorkflow /admin/draft-orders/{id}: get: operationId: GetDraftOrdersId @@ -19772,59 +19772,6 @@ paths: '500': $ref: '#/components/responses/500_error' x-workflow: getOrderDetailWorkflow - post: - operationId: PostOrdersId - summary: Update an Order - description: Update an order's details. - x-authenticated: true - parameters: - - name: id - in: path - description: The order's ID. - required: true - schema: - type: string - - name: fields - in: query - description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. - required: false - schema: - type: string - title: fields - description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. without prefix it will replace the entire default fields. - externalDocs: - url: '#select-fields-and-relations' - security: - - api_token: [] - - cookie_auth: [] - - jwt_token: [] - x-codeSamples: - - lang: Shell - label: cURL - source: |- - curl -X POST '{backend_url}/admin/orders/{id}' \ - -H 'Authorization: Bearer {access_token}' - tags: - - Orders - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/AdminOrderResponse' - '400': - $ref: '#/components/responses/400_error' - '401': - $ref: '#/components/responses/unauthorized' - '404': - $ref: '#/components/responses/not_found_error' - '409': - $ref: '#/components/responses/invalid_state_error' - '422': - $ref: '#/components/responses/invalid_request_error' - '500': - $ref: '#/components/responses/500_error' /admin/orders/{id}/archive: post: operationId: PostOrdersIdArchive @@ -20670,6 +20617,133 @@ paths: $ref: '#/components/responses/invalid_request_error' '500': $ref: '#/components/responses/500_error' + /admin/orders/{id}/transfer: + post: + operationId: PostOrdersIdTransfer + x-sidebar-summary: Request Transfer + summary: Request Order Transfer + description: Request an order to be transfered to another customer. The transfer is confirmed by sending a request to the [Accept Order Transfer](https://docs.medusajs.com/api/store#orders_postordersidtransferaccept) Store API route. + x-authenticated: true + parameters: + - name: id + in: path + description: The order's ID. + required: true + schema: + type: string + - name: fields + in: query + description: |- + Comma-separated fields that should be included in the returned data. + if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. + without prefix it will replace the entire default fields. + required: false + schema: + type: string + title: fields + description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. Without prefix it will replace the entire default fields. + externalDocs: + url: '#select-fields-and-relations' + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdminTransferOrder' + x-codeSamples: + - lang: Shell + label: cURL + source: |- + curl -X POST '{backend_url}/admin/orders/{id}/transfer' \ + -H 'Authorization: Bearer {access_token}' \ + -H 'Content-Type: application/json' \ + --data-raw '{ + "customer_id": "cus_123" + }' + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderResponse' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-workflow: requestOrderTransferWorkflow + /admin/orders/{id}/transfer/cancel: + post: + operationId: PostOrdersIdTransferCancel + summary: Cancel Transfer Request + x-sidebar-summary: Cancel Transfer + description: Cancel a request to transfer an order to another customer. + x-authenticated: true + parameters: + - name: id + in: path + description: The order's ID. + required: true + schema: + type: string + - name: fields + in: query + description: |- + Comma-separated fields that should be included in the returned data. + if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. + without prefix it will replace the entire default fields. + required: false + schema: + type: string + title: fields + description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. Without prefix it will replace the entire default fields. + externalDocs: + url: '#select-fields-and-relations' + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: Shell + label: cURL + source: |- + curl -X POST '{backend_url}/admin/orders/{id}/transfer/cancel' \ + -H 'Authorization: Bearer {access_token}' + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdminOrderResponse' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-workflow: cancelOrderTransferRequestWorkflow /admin/payment-collections: post: operationId: PostPaymentCollections @@ -43586,7 +43660,7 @@ components: type: array description: The products to update. items: - $ref: '#/components/schemas/AdminUpdateProduct' + $ref: '#/components/schemas/AdminBatchUpdateProduct' delete: type: array description: The products to delete. @@ -43702,6 +43776,164 @@ components: type: boolean title: deleted description: Whether the product variants were deleted. + AdminBatchUpdateProduct: + type: object + description: The product's details. + x-schemaName: AdminBatchUpdateProduct + properties: + title: + type: string + title: title + description: The product's title. + subtitle: + type: string + title: subtitle + description: The product's subtitle. + description: + type: string + title: description + description: The product's description. + is_giftcard: + type: boolean + title: is_giftcard + description: Whether the product is a gift card. + discountable: + type: boolean + title: discountable + description: Whether discounts can be applied on the product. + images: + type: array + description: The product's images. + items: + type: object + description: The image's details. + required: + - url + properties: + url: + type: string + title: url + description: The image's URL. + thumbnail: + type: string + title: thumbnail + description: The product's thumbnail URL. + handle: + type: string + title: handle + description: The product's unique handle. + status: + type: string + description: The product's status. + enum: + - draft + - proposed + - published + - rejected + type_id: + type: string + title: type_id + description: The ID of the product's type. + collection_id: + type: string + title: collection_id + description: The ID of the product's collection. + categories: + type: array + description: The product's categories. + items: + type: object + description: The product's category. + required: + - id + properties: + id: + type: string + title: id + description: The category's ID. + tags: + type: array + description: The product's tags. + items: + type: object + description: The product's tag. + required: + - id + properties: + id: + type: string + title: id + description: The tag's ID. + options: + type: array + description: The product's options. + items: + $ref: '#/components/schemas/AdminUpdateProductOption' + variants: + type: array + description: The product's variants. You can add new variants or update existing ones, passing their IDs in the object. + items: + oneOf: + - $ref: '#/components/schemas/AdminCreateProductVariant' + - $ref: '#/components/schemas/AdminUpdateProductVariant' + sales_channels: + type: array + description: The sales channels that the product is available in. + items: + type: object + description: The sales channel's details. + required: + - id + properties: + id: + type: string + title: id + description: The sales channel's ID. + weight: + type: number + title: weight + description: The product's weight. + length: + type: number + title: length + description: The product's length. + height: + type: number + title: height + description: The product's height. + width: + type: number + title: width + description: The product's width. + hs_code: + type: string + title: hs_code + description: The product's HS code. + mid_code: + type: string + title: mid_code + description: The product's MID code. + origin_country: + type: string + title: origin_country + description: The product's origin country. + material: + type: string + title: material + description: The product's material. + metadata: + type: object + description: The product's metadata, can hold custom key-value pairs. + external_id: + type: string + title: external_id + description: The ID of the product in an external or third-party system. + id: + type: string + title: id + description: The product's ID. + required: + - id AdminBatchUpdateProductVariant: type: object description: The properties to update of a product variant. @@ -50988,9 +51220,14 @@ components: metadata: type: object description: The image's metadata, can hold custom key-value pairs. + rank: + type: number + title: rank + description: The image's rank among sibling images. required: - id - url + - rank AdminProductOption: type: object description: The product option's details. @@ -53359,6 +53596,25 @@ components: properties: tax_region: $ref: '#/components/schemas/AdminTaxRegion' + AdminTransferOrder: + type: object + description: The details of the request to transfer the order. + x-schemaName: AdminTransferOrder + required: + - customer_id + properties: + customer_id: + type: string + title: customer_id + description: The ID of the customer to transfer the order to. + description: + type: string + title: description + description: The description of the order transfer, which can be shown to the customer receiving the order transfer request. + internal_note: + type: string + title: internal_note + description: An internal note viewable only by admin users. AdminUpdateApiKey: type: object description: The details to update in an API key. @@ -54548,9 +54804,63 @@ components: calculated_price: type: object description: The calculated price's details. + properties: + id: + type: string + title: id + description: The ID of the price. + price_list_id: + type: string + title: price_list_id + description: The ID of the associated price list. + price_list_type: + type: string + title: price_list_type + description: The price list's type. For example, sale. + min_quantity: + type: number + title: min_quantity + description: The minimum quantity required in the cart for this price to apply. + max_quantity: + type: number + title: max_quantity + description: The maximum quantity allowed in the cart for this price to apply. + required: + - id + - price_list_id + - price_list_type + - min_quantity + - max_quantity original_price: type: object description: The original price's details. + properties: + id: + type: string + title: id + description: The ID of the price. + price_list_id: + type: string + title: price_list_id + description: The ID of the associated price list. + price_list_type: + type: string + title: price_list_type + description: The price list's type. For example, sale. + min_quantity: + type: number + title: min_quantity + description: The minimum quantity required in the cart for this price to apply. + max_quantity: + type: number + title: max_quantity + description: The maximum quantity allowed in the cart for this price to apply. + required: + - id + - price_list_id + - price_list_type + - min_quantity + - max_quantity BaseCapture: type: object description: The details of a captured payment. @@ -55006,7 +55316,7 @@ components: type: object description: The shipping method's data, useful for fulfillment handling by third-party services. externalDocs: - url: https://docs.medusajs.com/v2/resources/commerce-modules/cart/concepts#data-property + url: https://docs.medusajs.com/resources/commerce-modules/cart/concepts#data-property metadata: type: object description: The shipping method's metadata, can hold custom key-value pairs. @@ -55031,36 +55341,36 @@ components: title: updated_at description: The date the shipping method was updated. original_total: - type: string + type: number title: original_total description: The shipping method's total including taxes, excluding promotions. original_subtotal: - type: string + type: number title: original_subtotal description: The shipping method's total excluding taxes, including promotions. original_tax_total: - type: string + type: number title: original_tax_total description: The total taxes applied on the shipping method's amount including promotions. total: - type: string + type: number title: total description: The shipping method's total amount including taxes and promotions. subtotal: - type: string + type: number title: subtotal description: The shipping method's total amount excluding taxes, including promotions. tax_total: - type: string + type: number title: tax_total description: The total taxes applied on the shipping method's amount including promotions. discount_total: - type: string + type: number title: discount_total description: The total amount discounted. discount_tax_total: - type: string - title: discount_total + type: number + title: discount_tax_total description: The taxes applied on the discounted amount. BaseClaimItem: type: object @@ -55244,6 +55554,14 @@ components: type: object description: The adjustment's details. x-schemaName: BaseLineItemAdjustment + required: + - item + - item_id + - id + - amount + - cart_id + - created_at + - updated_at properties: item: type: object @@ -55289,18 +55607,20 @@ components: format: date-time title: updated_at description: The date the adjustment was updated. + BaseLineItemTaxLine: + type: object + description: The tax line's details + x-schemaName: BaseLineItemTaxLine required: - item - item_id + - total + - subtotal - id - - amount - - cart_id + - code + - rate - created_at - updated_at - BaseLineItemTaxLine: - type: object - description: The tax line's details - x-schemaName: BaseLineItemTaxLine properties: item: $ref: '#/components/schemas/BaseCartLineItem' @@ -55350,16 +55670,6 @@ components: format: date-time title: updated_at description: The date the tax line was updated. - required: - - item - - item_id - - total - - subtotal - - id - - code - - rate - - created_at - - updated_at BaseOrder: type: object description: The order's details. @@ -57066,9 +57376,14 @@ components: metadata: type: object description: The image's metadata, can hold custom key-value pairs. + rank: + type: number + title: rank + description: The image's rank among its sibling images. required: - id - url + - rank BaseProductOption: type: object description: The product option's details. @@ -59876,6 +60191,17 @@ components: title: received_at description: The date the return was received. format: date-time + StoreAcceptOrderTransfer: + type: object + description: The details of accepting the order transfer. + x-schemaName: StoreAcceptOrderTransfer + required: + - token + properties: + token: + type: string + title: token + description: The order transfer's token issued when the transfer was requested. StoreAddCartLineItem: type: object description: The details of the line item to add. @@ -61336,6 +61662,17 @@ components: properties: customer: $ref: '#/components/schemas/StoreCustomer' + StoreDeclineOrderTransferRequest: + type: object + description: The details of declining the order transfer request. + x-schemaName: StoreDeclineOrderTransferRequest + required: + - token + properties: + token: + type: string + title: token + description: The order transfer's token issued when the transfer was requested. StoreInitializePaymentSession: type: object description: The payment session's details. @@ -67915,6 +68252,7 @@ components: required: - id - url + - rank properties: id: type: string @@ -67942,6 +68280,10 @@ components: metadata: type: object description: The image's metadata, can hold custom key-value pairs. + rank: + type: number + title: rank + description: The image's rank among its sibling images StoreProductOption: type: object description: The product option's details. @@ -68290,6 +68632,15 @@ components: type: string title: display_name description: The country's display name. + StoreRequestOrderTransfer: + type: object + description: The details of requesting the order transfer. + x-schemaName: StoreRequestOrderTransfer + properties: + description: + type: string + title: description + description: The transfer's description, which can be shown to the other customer receiving the request. StoreReturn: type: object description: The return's details. diff --git a/www/apps/api-reference/specs/admin/openapi.yaml b/www/apps/api-reference/specs/admin/openapi.yaml index 9aa4f767af531..e31e84806da8b 100644 --- a/www/apps/api-reference/specs/admin/openapi.yaml +++ b/www/apps/api-reference/specs/admin/openapi.yaml @@ -802,6 +802,10 @@ paths: $ref: paths/admin_orders_{id}_line-items.yaml /admin/orders/{id}/preview: $ref: paths/admin_orders_{id}_preview.yaml + /admin/orders/{id}/transfer: + $ref: paths/admin_orders_{id}_transfer.yaml + /admin/orders/{id}/transfer/cancel: + $ref: paths/admin_orders_{id}_transfer_cancel.yaml /admin/payment-collections: $ref: paths/admin_payment-collections.yaml /admin/payment-collections/{id}: diff --git a/www/apps/api-reference/specs/admin/paths/admin_draft-orders.yaml b/www/apps/api-reference/specs/admin/paths/admin_draft-orders.yaml index eb5835a85ca54..3d78e7cfa5b83 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_draft-orders.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_draft-orders.yaml @@ -2201,4 +2201,4 @@ post: $ref: ../components/responses/invalid_request_error.yaml '500': $ref: ../components/responses/500_error.yaml - x-workflow: createOrdersWorkflow + x-workflow: createOrderWorkflow diff --git a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}.yaml b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}.yaml index 68a89c114dc41..fd00de2fb9f45 100644 --- a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}.yaml +++ b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}.yaml @@ -109,63 +109,3 @@ get: '500': $ref: ../components/responses/500_error.yaml x-workflow: getOrderDetailWorkflow -post: - operationId: PostOrdersId - summary: Update an Order - description: Update an order's details. - x-authenticated: true - parameters: - - name: id - in: path - description: The order's ID. - required: true - schema: - type: string - - name: fields - in: query - description: >- - Comma-separated fields that should be included in the returned data. if - a field is prefixed with `+` it will be added to the default fields, - using `-` will remove it from the default fields. without prefix it will - replace the entire default fields. - required: false - schema: - type: string - title: fields - description: >- - Comma-separated fields that should be included in the returned data. - if a field is prefixed with `+` it will be added to the default - fields, using `-` will remove it from the default fields. without - prefix it will replace the entire default fields. - externalDocs: - url: '#select-fields-and-relations' - security: - - api_token: [] - - cookie_auth: [] - - jwt_token: [] - x-codeSamples: - - lang: Shell - label: cURL - source: - $ref: ../code_samples/Shell/admin_orders_{id}/post.sh - tags: - - Orders - responses: - '200': - description: OK - content: - application/json: - schema: - $ref: ../components/schemas/AdminOrderResponse.yaml - '400': - $ref: ../components/responses/400_error.yaml - '401': - $ref: ../components/responses/unauthorized.yaml - '404': - $ref: ../components/responses/not_found_error.yaml - '409': - $ref: ../components/responses/invalid_state_error.yaml - '422': - $ref: ../components/responses/invalid_request_error.yaml - '500': - $ref: ../components/responses/500_error.yaml diff --git a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_transfer.yaml b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_transfer.yaml new file mode 100644 index 0000000000000..7851f0d847037 --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_transfer.yaml @@ -0,0 +1,73 @@ +post: + operationId: PostOrdersIdTransfer + x-sidebar-summary: Request Transfer + summary: Request Order Transfer + description: >- + Request an order to be transfered to another customer. The transfer is + confirmed by sending a request to the [Accept Order + Transfer](https://docs.medusajs.com/api/store#orders_postordersidtransferaccept) + Store API route. + x-authenticated: true + parameters: + - name: id + in: path + description: The order's ID. + required: true + schema: + type: string + - name: fields + in: query + description: >- + Comma-separated fields that should be included in the returned data. + + if a field is prefixed with `+` it will be added to the default fields, + using `-` will remove it from the default fields. + + without prefix it will replace the entire default fields. + required: false + schema: + type: string + title: fields + description: >- + Comma-separated fields that should be included in the returned data. + If a field is prefixed with `+` it will be added to the default + fields, using `-` will remove it from the default fields. Without + prefix it will replace the entire default fields. + externalDocs: + url: '#select-fields-and-relations' + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/AdminTransferOrder.yaml + x-codeSamples: + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_orders_{id}_transfer/post.sh + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminOrderResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-workflow: requestOrderTransferWorkflow diff --git a/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_transfer_cancel.yaml b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_transfer_cancel.yaml new file mode 100644 index 0000000000000..88c6ecc027916 --- /dev/null +++ b/www/apps/api-reference/specs/admin/paths/admin_orders_{id}_transfer_cancel.yaml @@ -0,0 +1,64 @@ +post: + operationId: PostOrdersIdTransferCancel + summary: Cancel Transfer Request + x-sidebar-summary: Cancel Transfer + description: Cancel a request to transfer an order to another customer. + x-authenticated: true + parameters: + - name: id + in: path + description: The order's ID. + required: true + schema: + type: string + - name: fields + in: query + description: >- + Comma-separated fields that should be included in the returned data. + + if a field is prefixed with `+` it will be added to the default fields, + using `-` will remove it from the default fields. + + without prefix it will replace the entire default fields. + required: false + schema: + type: string + title: fields + description: >- + Comma-separated fields that should be included in the returned data. + If a field is prefixed with `+` it will be added to the default + fields, using `-` will remove it from the default fields. Without + prefix it will replace the entire default fields. + externalDocs: + url: '#select-fields-and-relations' + security: + - api_token: [] + - cookie_auth: [] + - jwt_token: [] + x-codeSamples: + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/admin_orders_{id}_transfer_cancel/post.sh + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/AdminOrderResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-workflow: cancelOrderTransferRequestWorkflow diff --git a/www/apps/api-reference/specs/store/code_samples/Shell/store_carts_{id}_customer/post.sh b/www/apps/api-reference/specs/store/code_samples/Shell/store_carts_{id}_customer/post.sh new file mode 100644 index 0000000000000..f698d88fe77e3 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/Shell/store_carts_{id}_customer/post.sh @@ -0,0 +1,2 @@ +curl -X POST '{backend_url}/store/carts/{id}/customer' \ +-H 'x-publishable-api-key: {your_publishable_api_key}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/Shell/store_orders_{id}_transfer_accept/post.sh b/www/apps/api-reference/specs/store/code_samples/Shell/store_orders_{id}_transfer_accept/post.sh new file mode 100644 index 0000000000000..5dc300417d468 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/Shell/store_orders_{id}_transfer_accept/post.sh @@ -0,0 +1,6 @@ +curl -X POST '{backend_url}/store/orders/{id}/transfer/accept' \ +-H 'x-publishable-api-key: {your_publishable_api_key}' \ +-H 'Content-Type: application/json' \ +--data-raw '{ + "token": "{value}" +}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/Shell/store_orders_{id}_transfer_cancel/post.sh b/www/apps/api-reference/specs/store/code_samples/Shell/store_orders_{id}_transfer_cancel/post.sh new file mode 100644 index 0000000000000..a98b365140c7c --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/Shell/store_orders_{id}_transfer_cancel/post.sh @@ -0,0 +1,2 @@ +curl -X POST '{backend_url}/store/orders/{id}/transfer/cancel' \ +-H 'x-publishable-api-key: {your_publishable_api_key}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/Shell/store_orders_{id}_transfer_decline/post.sh b/www/apps/api-reference/specs/store/code_samples/Shell/store_orders_{id}_transfer_decline/post.sh new file mode 100644 index 0000000000000..d8af0266b03b8 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/Shell/store_orders_{id}_transfer_decline/post.sh @@ -0,0 +1,6 @@ +curl -X POST '{backend_url}/store/orders/{id}/transfer/decline' \ +-H 'x-publishable-api-key: {your_publishable_api_key}' \ +-H 'Content-Type: application/json' \ +--data-raw '{ + "token": "{value}" +}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/code_samples/Shell/store_orders_{id}_transfer_request/post.sh b/www/apps/api-reference/specs/store/code_samples/Shell/store_orders_{id}_transfer_request/post.sh new file mode 100644 index 0000000000000..232a87c1f4c14 --- /dev/null +++ b/www/apps/api-reference/specs/store/code_samples/Shell/store_orders_{id}_transfer_request/post.sh @@ -0,0 +1,2 @@ +curl -X POST '{backend_url}/store/orders/{id}/transfer/request' \ +-H 'x-publishable-api-key: {your_publishable_api_key}' \ No newline at end of file diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminBatchProductRequest.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminBatchProductRequest.yaml index 5f35aa599fcad..46abcccd8a61f 100644 --- a/www/apps/api-reference/specs/store/components/schemas/AdminBatchProductRequest.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/AdminBatchProductRequest.yaml @@ -11,7 +11,7 @@ properties: type: array description: The products to update. items: - $ref: ./AdminUpdateProduct.yaml + $ref: ./AdminBatchUpdateProduct.yaml delete: type: array description: The products to delete. diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminBatchUpdateProduct.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminBatchUpdateProduct.yaml new file mode 100644 index 0000000000000..fcbe73708b8c3 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminBatchUpdateProduct.yaml @@ -0,0 +1,159 @@ +type: object +description: The product's details. +x-schemaName: AdminBatchUpdateProduct +properties: + title: + type: string + title: title + description: The product's title. + subtitle: + type: string + title: subtitle + description: The product's subtitle. + description: + type: string + title: description + description: The product's description. + is_giftcard: + type: boolean + title: is_giftcard + description: Whether the product is a gift card. + discountable: + type: boolean + title: discountable + description: Whether discounts can be applied on the product. + images: + type: array + description: The product's images. + items: + type: object + description: The image's details. + required: + - url + properties: + url: + type: string + title: url + description: The image's URL. + thumbnail: + type: string + title: thumbnail + description: The product's thumbnail URL. + handle: + type: string + title: handle + description: The product's unique handle. + status: + type: string + description: The product's status. + enum: + - draft + - proposed + - published + - rejected + type_id: + type: string + title: type_id + description: The ID of the product's type. + collection_id: + type: string + title: collection_id + description: The ID of the product's collection. + categories: + type: array + description: The product's categories. + items: + type: object + description: The product's category. + required: + - id + properties: + id: + type: string + title: id + description: The category's ID. + tags: + type: array + description: The product's tags. + items: + type: object + description: The product's tag. + required: + - id + properties: + id: + type: string + title: id + description: The tag's ID. + options: + type: array + description: The product's options. + items: + $ref: ./AdminUpdateProductOption.yaml + variants: + type: array + description: >- + The product's variants. You can add new variants or update existing ones, + passing their IDs in the object. + items: + oneOf: + - $ref: ./AdminCreateProductVariant.yaml + - $ref: ./AdminUpdateProductVariant.yaml + sales_channels: + type: array + description: The sales channels that the product is available in. + items: + type: object + description: The sales channel's details. + required: + - id + properties: + id: + type: string + title: id + description: The sales channel's ID. + weight: + type: number + title: weight + description: The product's weight. + length: + type: number + title: length + description: The product's length. + height: + type: number + title: height + description: The product's height. + width: + type: number + title: width + description: The product's width. + hs_code: + type: string + title: hs_code + description: The product's HS code. + mid_code: + type: string + title: mid_code + description: The product's MID code. + origin_country: + type: string + title: origin_country + description: The product's origin country. + material: + type: string + title: material + description: The product's material. + metadata: + type: object + description: The product's metadata, can hold custom key-value pairs. + external_id: + type: string + title: external_id + description: The ID of the product in an external or third-party system. + id: + type: string + title: id + description: The product's ID. +required: + - id diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminProductImage.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminProductImage.yaml index 050650545a5da..d1561e5a2fcf4 100644 --- a/www/apps/api-reference/specs/store/components/schemas/AdminProductImage.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/AdminProductImage.yaml @@ -28,6 +28,11 @@ properties: metadata: type: object description: The image's metadata, can hold custom key-value pairs. + rank: + type: number + title: rank + description: The image's rank among sibling images. required: - id - url + - rank diff --git a/www/apps/api-reference/specs/store/components/schemas/AdminTransferOrder.yaml b/www/apps/api-reference/specs/store/components/schemas/AdminTransferOrder.yaml new file mode 100644 index 0000000000000..675e3606c1b0c --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/AdminTransferOrder.yaml @@ -0,0 +1,20 @@ +type: object +description: The details of the request to transfer the order. +x-schemaName: AdminTransferOrder +required: + - customer_id +properties: + customer_id: + type: string + title: customer_id + description: The ID of the customer to transfer the order to. + description: + type: string + title: description + description: >- + The description of the order transfer, which can be shown to the customer + receiving the order transfer request. + internal_note: + type: string + title: internal_note + description: An internal note viewable only by admin users. diff --git a/www/apps/api-reference/specs/store/components/schemas/BaseCalculatedPriceSet.yaml b/www/apps/api-reference/specs/store/components/schemas/BaseCalculatedPriceSet.yaml index ac22d66e394f8..ec11356ec0947 100644 --- a/www/apps/api-reference/specs/store/components/schemas/BaseCalculatedPriceSet.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/BaseCalculatedPriceSet.yaml @@ -56,6 +56,60 @@ properties: calculated_price: type: object description: The calculated price's details. + properties: + id: + type: string + title: id + description: The ID of the price. + price_list_id: + type: string + title: price_list_id + description: The ID of the associated price list. + price_list_type: + type: string + title: price_list_type + description: The price list's type. For example, sale. + min_quantity: + type: number + title: min_quantity + description: The minimum quantity required in the cart for this price to apply. + max_quantity: + type: number + title: max_quantity + description: The maximum quantity allowed in the cart for this price to apply. + required: + - id + - price_list_id + - price_list_type + - min_quantity + - max_quantity original_price: type: object description: The original price's details. + properties: + id: + type: string + title: id + description: The ID of the price. + price_list_id: + type: string + title: price_list_id + description: The ID of the associated price list. + price_list_type: + type: string + title: price_list_type + description: The price list's type. For example, sale. + min_quantity: + type: number + title: min_quantity + description: The minimum quantity required in the cart for this price to apply. + max_quantity: + type: number + title: max_quantity + description: The maximum quantity allowed in the cart for this price to apply. + required: + - id + - price_list_id + - price_list_type + - min_quantity + - max_quantity diff --git a/www/apps/api-reference/specs/store/components/schemas/BaseCartShippingMethod.yaml b/www/apps/api-reference/specs/store/components/schemas/BaseCartShippingMethod.yaml index 1dbcebc278269..0a23a60cdc4c2 100644 --- a/www/apps/api-reference/specs/store/components/schemas/BaseCartShippingMethod.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/BaseCartShippingMethod.yaml @@ -53,7 +53,7 @@ properties: services. externalDocs: url: >- - https://docs.medusajs.com/v2/resources/commerce-modules/cart/concepts#data-property + https://docs.medusajs.com/resources/commerce-modules/cart/concepts#data-property metadata: type: object description: The shipping method's metadata, can hold custom key-value pairs. @@ -78,38 +78,38 @@ properties: title: updated_at description: The date the shipping method was updated. original_total: - type: string + type: number title: original_total description: The shipping method's total including taxes, excluding promotions. original_subtotal: - type: string + type: number title: original_subtotal description: The shipping method's total excluding taxes, including promotions. original_tax_total: - type: string + type: number title: original_tax_total description: >- The total taxes applied on the shipping method's amount including promotions. total: - type: string + type: number title: total description: The shipping method's total amount including taxes and promotions. subtotal: - type: string + type: number title: subtotal description: The shipping method's total amount excluding taxes, including promotions. tax_total: - type: string + type: number title: tax_total description: >- The total taxes applied on the shipping method's amount including promotions. discount_total: - type: string + type: number title: discount_total description: The total amount discounted. discount_tax_total: - type: string - title: discount_total + type: number + title: discount_tax_total description: The taxes applied on the discounted amount. diff --git a/www/apps/api-reference/specs/store/components/schemas/BaseCollection.yaml b/www/apps/api-reference/specs/store/components/schemas/BaseCollection.yaml index 3aedaefa436b9..58ab3baab3f94 100644 --- a/www/apps/api-reference/specs/store/components/schemas/BaseCollection.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/BaseCollection.yaml @@ -41,7 +41,7 @@ properties: type: array description: The collection's products. items: - $ref: ./BaseProduct.yaml + type: object metadata: type: object description: The collection's metadata, used to store custom key-value pairs. diff --git a/www/apps/api-reference/specs/store/components/schemas/BaseLineItemAdjustment.yaml b/www/apps/api-reference/specs/store/components/schemas/BaseLineItemAdjustment.yaml index af9b884de8cdf..70d85b5243b6b 100644 --- a/www/apps/api-reference/specs/store/components/schemas/BaseLineItemAdjustment.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/BaseLineItemAdjustment.yaml @@ -1,6 +1,14 @@ type: object description: The adjustment's details. x-schemaName: BaseLineItemAdjustment +required: + - item + - item_id + - id + - amount + - cart_id + - created_at + - updated_at properties: item: type: object @@ -46,11 +54,3 @@ properties: format: date-time title: updated_at description: The date the adjustment was updated. -required: - - item - - item_id - - id - - amount - - cart_id - - created_at - - updated_at diff --git a/www/apps/api-reference/specs/store/components/schemas/BaseLineItemTaxLine.yaml b/www/apps/api-reference/specs/store/components/schemas/BaseLineItemTaxLine.yaml index 63946d4c1ff10..5ab35961357fd 100644 --- a/www/apps/api-reference/specs/store/components/schemas/BaseLineItemTaxLine.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/BaseLineItemTaxLine.yaml @@ -1,6 +1,16 @@ type: object description: The tax line's details x-schemaName: BaseLineItemTaxLine +required: + - item + - item_id + - total + - subtotal + - id + - code + - rate + - created_at + - updated_at properties: item: $ref: ./BaseCartLineItem.yaml @@ -50,13 +60,3 @@ properties: format: date-time title: updated_at description: The date the tax line was updated. -required: - - item - - item_id - - total - - subtotal - - id - - code - - rate - - created_at - - updated_at diff --git a/www/apps/api-reference/specs/store/components/schemas/BaseProductCategory.yaml b/www/apps/api-reference/specs/store/components/schemas/BaseProductCategory.yaml index 5fcced7319784..b7311e22133fc 100644 --- a/www/apps/api-reference/specs/store/components/schemas/BaseProductCategory.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/BaseProductCategory.yaml @@ -27,7 +27,7 @@ properties: type: array description: The category's products. items: - $ref: ./AdminProduct.yaml + type: object name: type: string title: name diff --git a/www/apps/api-reference/specs/store/components/schemas/BaseProductImage.yaml b/www/apps/api-reference/specs/store/components/schemas/BaseProductImage.yaml index f1e59ad937a5e..25637c69e893d 100644 --- a/www/apps/api-reference/specs/store/components/schemas/BaseProductImage.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/BaseProductImage.yaml @@ -28,6 +28,11 @@ properties: metadata: type: object description: The image's metadata, can hold custom key-value pairs. + rank: + type: number + title: rank + description: The image's rank among its sibling images. required: - id - url + - rank diff --git a/www/apps/api-reference/specs/store/components/schemas/Return.yaml b/www/apps/api-reference/specs/store/components/schemas/Return.yaml index 2460eadd117cb..cfefdef18c517 100644 --- a/www/apps/api-reference/specs/store/components/schemas/Return.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/Return.yaml @@ -83,7 +83,7 @@ properties: title: exchange_id description: The ID of the exchange this return belongs to, if any. exchange: - $ref: ./OrderExchange.yaml + type: object claim_id: type: string title: claim_id diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreAcceptOrderTransfer.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreAcceptOrderTransfer.yaml new file mode 100644 index 0000000000000..c7bf57491b8b9 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/StoreAcceptOrderTransfer.yaml @@ -0,0 +1,10 @@ +type: object +description: The details of accepting the order transfer. +x-schemaName: StoreAcceptOrderTransfer +required: + - token +properties: + token: + type: string + title: token + description: The order transfer's token issued when the transfer was requested. diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreDeclineOrderTransferRequest.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreDeclineOrderTransferRequest.yaml new file mode 100644 index 0000000000000..ab03d7e6b8730 --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/StoreDeclineOrderTransferRequest.yaml @@ -0,0 +1,10 @@ +type: object +description: The details of declining the order transfer request. +x-schemaName: StoreDeclineOrderTransferRequest +required: + - token +properties: + token: + type: string + title: token + description: The order transfer's token issued when the transfer was requested. diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreProductImage.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreProductImage.yaml index 632f1a9c1a929..a3b3b1c72afd1 100644 --- a/www/apps/api-reference/specs/store/components/schemas/StoreProductImage.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/StoreProductImage.yaml @@ -4,6 +4,7 @@ x-schemaName: StoreProductImage required: - id - url + - rank properties: id: type: string @@ -31,3 +32,7 @@ properties: metadata: type: object description: The image's metadata, can hold custom key-value pairs. + rank: + type: number + title: rank + description: The image's rank among its sibling images diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreRequestOrderTransfer.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreRequestOrderTransfer.yaml new file mode 100644 index 0000000000000..e2c65712ca9fb --- /dev/null +++ b/www/apps/api-reference/specs/store/components/schemas/StoreRequestOrderTransfer.yaml @@ -0,0 +1,10 @@ +type: object +description: The details of requesting the order transfer. +x-schemaName: StoreRequestOrderTransfer +properties: + description: + type: string + title: description + description: >- + The transfer's description, which can be shown to the other customer + receiving the request. diff --git a/www/apps/api-reference/specs/store/openapi.full.yaml b/www/apps/api-reference/specs/store/openapi.full.yaml index 9857f9d85145a..2bd69b8809630 100644 --- a/www/apps/api-reference/specs/store/openapi.full.yaml +++ b/www/apps/api-reference/specs/store/openapi.full.yaml @@ -840,6 +840,64 @@ paths: '500': $ref: '#/components/responses/500_error' x-workflow: completeCartWorkflow + /store/carts/{id}/customer: + post: + operationId: PostCartsIdCustomer + summary: Set Cart's Customer + x-sidebar-summary: Set Customer + description: Set the customer of the cart. This is useful when you create the cart for a guest customer, then they log in with their account. + externalDocs: + url: https://docs.medusajs.com/resources/storefront-development/cart/update#set-carts-customer + description: 'Storefront guide: How to set the cart''s customer.' + x-authenticated: false + parameters: + - name: id + in: path + description: The cart's ID. + required: true + schema: + type: string + - name: fields + in: query + description: |- + Comma-separated fields that should be included in the returned data. + if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. + without prefix it will replace the entire default fields. + required: false + schema: + type: string + title: fields + description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. Without prefix it will replace the entire default fields. + externalDocs: + url: '#select-fields-and-relations' + x-codeSamples: + - lang: Shell + label: cURL + source: |- + curl -X POST '{backend_url}/store/carts/{id}/customer' \ + -H 'x-publishable-api-key: {your_publishable_api_key}' + tags: + - Carts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreCartResponse' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-workflow: transferCartCustomerWorkflow /store/carts/{id}/line-items: post: operationId: PostCartsIdLineItems @@ -3093,6 +3151,255 @@ paths: '500': $ref: '#/components/responses/500_error' x-workflow: getOrderDetailWorkflow + /store/orders/{id}/transfer/accept: + post: + operationId: PostOrdersIdTransferAccept + summary: Accept Order Transfer + x-sidebar-summary: Accept Transfer + description: Accept an order to be transfered to a customer's account, which was specified when the transfer request was created. The transfer is requested previously either by the customer using the [Request Order Transfer Store API route](https://docs.medusajs.com/api/store#orders_postordersidtransferrequest), or by the admin using the [Request Order Transfer Admin API route](https://docs.medusajs.com/api/admin#orders_postordersidtransferrequest). + x-authenticated: false + parameters: + - name: id + in: path + description: The order's ID. + required: true + schema: + type: string + - name: fields + in: query + description: |- + Comma-separated fields that should be included in the returned data. + if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. + without prefix it will replace the entire default fields. + required: false + schema: + type: string + title: fields + description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. Without prefix it will replace the entire default fields. + externalDocs: + url: '#select-fields-and-relations' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StoreAcceptOrderTransfer' + x-codeSamples: + - lang: Shell + label: cURL + source: |- + curl -X POST '{backend_url}/store/orders/{id}/transfer/accept' \ + -H 'x-publishable-api-key: {your_publishable_api_key}' \ + -H 'Content-Type: application/json' \ + --data-raw '{ + "token": "{value}" + }' + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreOrderResponse' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-workflow: acceptOrderTransferWorkflow + /store/orders/{id}/transfer/cancel: + post: + operationId: PostOrdersIdTransferCancel + summary: Cancel Order Transfer + x-sidebar-summary: Cancel Transfer + description: Cancel an order transfer that the logged-in customer previously requested using the [Request Order Transfer](https://docs.medusajs.com/api/store#orders_postordersidtransferrequest) API route. + x-authenticated: true + parameters: + - name: id + in: path + description: The order's ID. + required: true + schema: + type: string + - name: fields + in: query + description: |- + Comma-separated fields that should be included in the returned data. + if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. + without prefix it will replace the entire default fields. + required: false + schema: + type: string + title: fields + description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. Without prefix it will replace the entire default fields. + externalDocs: + url: '#select-fields-and-relations' + x-codeSamples: + - lang: Shell + label: cURL + source: |- + curl -X POST '{backend_url}/store/orders/{id}/transfer/cancel' \ + -H 'x-publishable-api-key: {your_publishable_api_key}' + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreOrderResponse' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-workflow: cancelOrderTransferRequestWorkflow + security: + - cookie_auth: [] + - jwt_token: [] + /store/orders/{id}/transfer/decline: + post: + operationId: PostOrdersIdTransferDecline + summary: Decline Order Transfer + x-sidebar-summary: Decline Transfer + description: Decline an order transfer previously requested, typically by the admin user using the [Request Order Transfer Admin API route](https://docs.medusajs.com/api/admin#orders_postordersidtransferrequest). + x-authenticated: false + parameters: + - name: id + in: path + description: The order's ID. + required: true + schema: + type: string + - name: fields + in: query + description: |- + Comma-separated fields that should be included in the returned data. + if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. + without prefix it will replace the entire default fields. + required: false + schema: + type: string + title: fields + description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. Without prefix it will replace the entire default fields. + externalDocs: + url: '#select-fields-and-relations' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StoreDeclineOrderTransferRequest' + x-codeSamples: + - lang: Shell + label: cURL + source: |- + curl -X POST '{backend_url}/store/orders/{id}/transfer/decline' \ + -H 'x-publishable-api-key: {your_publishable_api_key}' \ + -H 'Content-Type: application/json' \ + --data-raw '{ + "token": "{value}" + }' + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreOrderResponse' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-workflow: declineOrderTransferRequestWorkflow + /store/orders/{id}/transfer/request: + post: + operationId: PostOrdersIdTransferRequest + summary: Request Order Transfer + x-sidebar-summery: Request Transfer + description: Request an order to be transfered to the logged-in customer's account. The transfer is confirmed using the [Accept Order Transfer](https://docs.medusajs.com/api/store#orders_postordersidtransferaccept) API route. + x-authenticated: true + parameters: + - name: id + in: path + description: The order's ID. + required: true + schema: + type: string + - name: fields + in: query + description: |- + Comma-separated fields that should be included in the returned data. + if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. + without prefix it will replace the entire default fields. + required: false + schema: + type: string + title: fields + description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. Without prefix it will replace the entire default fields. + externalDocs: + url: '#select-fields-and-relations' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/StoreRequestOrderTransfer' + x-codeSamples: + - lang: Shell + label: cURL + source: |- + curl -X POST '{backend_url}/store/orders/{id}/transfer/request' \ + -H 'x-publishable-api-key: {your_publishable_api_key}' + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/StoreOrderResponse' + '400': + $ref: '#/components/responses/400_error' + '401': + $ref: '#/components/responses/unauthorized' + '404': + $ref: '#/components/responses/not_found_error' + '409': + $ref: '#/components/responses/invalid_state_error' + '422': + $ref: '#/components/responses/invalid_request_error' + '500': + $ref: '#/components/responses/500_error' + x-workflow: getOrderDetailWorkflow + security: + - cookie_auth: [] + - jwt_token: [] /store/payment-collections: post: operationId: PostPaymentCollections @@ -5613,7 +5920,7 @@ components: type: array description: The products to update. items: - $ref: '#/components/schemas/AdminUpdateProduct' + $ref: '#/components/schemas/AdminBatchUpdateProduct' delete: type: array description: The products to delete. @@ -5729,6 +6036,164 @@ components: type: boolean title: deleted description: Whether the product variants were deleted. + AdminBatchUpdateProduct: + type: object + description: The product's details. + x-schemaName: AdminBatchUpdateProduct + properties: + title: + type: string + title: title + description: The product's title. + subtitle: + type: string + title: subtitle + description: The product's subtitle. + description: + type: string + title: description + description: The product's description. + is_giftcard: + type: boolean + title: is_giftcard + description: Whether the product is a gift card. + discountable: + type: boolean + title: discountable + description: Whether discounts can be applied on the product. + images: + type: array + description: The product's images. + items: + type: object + description: The image's details. + required: + - url + properties: + url: + type: string + title: url + description: The image's URL. + thumbnail: + type: string + title: thumbnail + description: The product's thumbnail URL. + handle: + type: string + title: handle + description: The product's unique handle. + status: + type: string + description: The product's status. + enum: + - draft + - proposed + - published + - rejected + type_id: + type: string + title: type_id + description: The ID of the product's type. + collection_id: + type: string + title: collection_id + description: The ID of the product's collection. + categories: + type: array + description: The product's categories. + items: + type: object + description: The product's category. + required: + - id + properties: + id: + type: string + title: id + description: The category's ID. + tags: + type: array + description: The product's tags. + items: + type: object + description: The product's tag. + required: + - id + properties: + id: + type: string + title: id + description: The tag's ID. + options: + type: array + description: The product's options. + items: + $ref: '#/components/schemas/AdminUpdateProductOption' + variants: + type: array + description: The product's variants. You can add new variants or update existing ones, passing their IDs in the object. + items: + oneOf: + - $ref: '#/components/schemas/AdminCreateProductVariant' + - $ref: '#/components/schemas/AdminUpdateProductVariant' + sales_channels: + type: array + description: The sales channels that the product is available in. + items: + type: object + description: The sales channel's details. + required: + - id + properties: + id: + type: string + title: id + description: The sales channel's ID. + weight: + type: number + title: weight + description: The product's weight. + length: + type: number + title: length + description: The product's length. + height: + type: number + title: height + description: The product's height. + width: + type: number + title: width + description: The product's width. + hs_code: + type: string + title: hs_code + description: The product's HS code. + mid_code: + type: string + title: mid_code + description: The product's MID code. + origin_country: + type: string + title: origin_country + description: The product's origin country. + material: + type: string + title: material + description: The product's material. + metadata: + type: object + description: The product's metadata, can hold custom key-value pairs. + external_id: + type: string + title: external_id + description: The ID of the product in an external or third-party system. + id: + type: string + title: id + description: The product's ID. + required: + - id AdminBatchUpdateProductVariant: type: object description: The properties to update of a product variant. @@ -13015,9 +13480,14 @@ components: metadata: type: object description: The image's metadata, can hold custom key-value pairs. + rank: + type: number + title: rank + description: The image's rank among sibling images. required: - id - url + - rank AdminProductOption: type: object description: The product option's details. @@ -15386,6 +15856,25 @@ components: properties: tax_region: $ref: '#/components/schemas/AdminTaxRegion' + AdminTransferOrder: + type: object + description: The details of the request to transfer the order. + x-schemaName: AdminTransferOrder + required: + - customer_id + properties: + customer_id: + type: string + title: customer_id + description: The ID of the customer to transfer the order to. + description: + type: string + title: description + description: The description of the order transfer, which can be shown to the customer receiving the order transfer request. + internal_note: + type: string + title: internal_note + description: An internal note viewable only by admin users. AdminUpdateApiKey: type: object description: The details to update in an API key. @@ -16575,9 +17064,63 @@ components: calculated_price: type: object description: The calculated price's details. + properties: + id: + type: string + title: id + description: The ID of the price. + price_list_id: + type: string + title: price_list_id + description: The ID of the associated price list. + price_list_type: + type: string + title: price_list_type + description: The price list's type. For example, sale. + min_quantity: + type: number + title: min_quantity + description: The minimum quantity required in the cart for this price to apply. + max_quantity: + type: number + title: max_quantity + description: The maximum quantity allowed in the cart for this price to apply. + required: + - id + - price_list_id + - price_list_type + - min_quantity + - max_quantity original_price: type: object description: The original price's details. + properties: + id: + type: string + title: id + description: The ID of the price. + price_list_id: + type: string + title: price_list_id + description: The ID of the associated price list. + price_list_type: + type: string + title: price_list_type + description: The price list's type. For example, sale. + min_quantity: + type: number + title: min_quantity + description: The minimum quantity required in the cart for this price to apply. + max_quantity: + type: number + title: max_quantity + description: The maximum quantity allowed in the cart for this price to apply. + required: + - id + - price_list_id + - price_list_type + - min_quantity + - max_quantity BaseCapture: type: object description: The details of a captured payment. @@ -17033,7 +17576,7 @@ components: type: object description: The shipping method's data, useful for fulfillment handling by third-party services. externalDocs: - url: https://docs.medusajs.com/v2/resources/commerce-modules/cart/concepts#data-property + url: https://docs.medusajs.com/resources/commerce-modules/cart/concepts#data-property metadata: type: object description: The shipping method's metadata, can hold custom key-value pairs. @@ -17058,36 +17601,36 @@ components: title: updated_at description: The date the shipping method was updated. original_total: - type: string + type: number title: original_total description: The shipping method's total including taxes, excluding promotions. original_subtotal: - type: string + type: number title: original_subtotal description: The shipping method's total excluding taxes, including promotions. original_tax_total: - type: string + type: number title: original_tax_total description: The total taxes applied on the shipping method's amount including promotions. total: - type: string + type: number title: total description: The shipping method's total amount including taxes and promotions. subtotal: - type: string + type: number title: subtotal description: The shipping method's total amount excluding taxes, including promotions. tax_total: - type: string + type: number title: tax_total description: The total taxes applied on the shipping method's amount including promotions. discount_total: - type: string + type: number title: discount_total description: The total amount discounted. discount_tax_total: - type: string - title: discount_total + type: number + title: discount_tax_total description: The taxes applied on the discounted amount. BaseClaimItem: type: object @@ -17271,6 +17814,14 @@ components: type: object description: The adjustment's details. x-schemaName: BaseLineItemAdjustment + required: + - item + - item_id + - id + - amount + - cart_id + - created_at + - updated_at properties: item: type: object @@ -17316,18 +17867,20 @@ components: format: date-time title: updated_at description: The date the adjustment was updated. + BaseLineItemTaxLine: + type: object + description: The tax line's details + x-schemaName: BaseLineItemTaxLine required: - item - item_id + - total + - subtotal - id - - amount - - cart_id + - code + - rate - created_at - updated_at - BaseLineItemTaxLine: - type: object - description: The tax line's details - x-schemaName: BaseLineItemTaxLine properties: item: $ref: '#/components/schemas/BaseCartLineItem' @@ -17377,16 +17930,6 @@ components: format: date-time title: updated_at description: The date the tax line was updated. - required: - - item - - item_id - - total - - subtotal - - id - - code - - rate - - created_at - - updated_at BaseOrder: type: object description: The order's details. @@ -19093,9 +19636,14 @@ components: metadata: type: object description: The image's metadata, can hold custom key-value pairs. + rank: + type: number + title: rank + description: The image's rank among its sibling images. required: - id - url + - rank BaseProductOption: type: object description: The product option's details. @@ -21903,6 +22451,17 @@ components: title: received_at description: The date the return was received. format: date-time + StoreAcceptOrderTransfer: + type: object + description: The details of accepting the order transfer. + x-schemaName: StoreAcceptOrderTransfer + required: + - token + properties: + token: + type: string + title: token + description: The order transfer's token issued when the transfer was requested. StoreAddCartLineItem: type: object description: The details of the line item to add. @@ -23363,6 +23922,17 @@ components: properties: customer: $ref: '#/components/schemas/StoreCustomer' + StoreDeclineOrderTransferRequest: + type: object + description: The details of declining the order transfer request. + x-schemaName: StoreDeclineOrderTransferRequest + required: + - token + properties: + token: + type: string + title: token + description: The order transfer's token issued when the transfer was requested. StoreInitializePaymentSession: type: object description: The payment session's details. @@ -29942,6 +30512,7 @@ components: required: - id - url + - rank properties: id: type: string @@ -29969,6 +30540,10 @@ components: metadata: type: object description: The image's metadata, can hold custom key-value pairs. + rank: + type: number + title: rank + description: The image's rank among its sibling images StoreProductOption: type: object description: The product option's details. @@ -30317,6 +30892,15 @@ components: type: string title: display_name description: The country's display name. + StoreRequestOrderTransfer: + type: object + description: The details of requesting the order transfer. + x-schemaName: StoreRequestOrderTransfer + properties: + description: + type: string + title: description + description: The transfer's description, which can be shown to the other customer receiving the request. StoreReturn: type: object description: The return's details. diff --git a/www/apps/api-reference/specs/store/openapi.yaml b/www/apps/api-reference/specs/store/openapi.yaml index 58b8428f6a687..8209c7e0f0a39 100644 --- a/www/apps/api-reference/specs/store/openapi.yaml +++ b/www/apps/api-reference/specs/store/openapi.yaml @@ -209,6 +209,8 @@ paths: $ref: paths/store_carts_{id}.yaml /store/carts/{id}/complete: $ref: paths/store_carts_{id}_complete.yaml + /store/carts/{id}/customer: + $ref: paths/store_carts_{id}_customer.yaml /store/carts/{id}/line-items: $ref: paths/store_carts_{id}_line-items.yaml /store/carts/{id}/line-items/{line_id}: @@ -239,6 +241,14 @@ paths: $ref: paths/store_orders.yaml /store/orders/{id}: $ref: paths/store_orders_{id}.yaml + /store/orders/{id}/transfer/accept: + $ref: paths/store_orders_{id}_transfer_accept.yaml + /store/orders/{id}/transfer/cancel: + $ref: paths/store_orders_{id}_transfer_cancel.yaml + /store/orders/{id}/transfer/decline: + $ref: paths/store_orders_{id}_transfer_decline.yaml + /store/orders/{id}/transfer/request: + $ref: paths/store_orders_{id}_transfer_request.yaml /store/payment-collections: $ref: paths/store_payment-collections.yaml /store/payment-collections/{id}/payment-sessions: diff --git a/www/apps/api-reference/specs/store/paths/store_carts_{id}_customer.yaml b/www/apps/api-reference/specs/store/paths/store_carts_{id}_customer.yaml new file mode 100644 index 0000000000000..f6beb6b8333aa --- /dev/null +++ b/www/apps/api-reference/specs/store/paths/store_carts_{id}_customer.yaml @@ -0,0 +1,66 @@ +post: + operationId: PostCartsIdCustomer + summary: Set Cart's Customer + x-sidebar-summary: Set Customer + description: >- + Set the customer of the cart. This is useful when you create the cart for a + guest customer, then they log in with their account. + externalDocs: + url: >- + https://docs.medusajs.com/resources/storefront-development/cart/update#set-carts-customer + description: 'Storefront guide: How to set the cart''s customer.' + x-authenticated: false + parameters: + - name: id + in: path + description: The cart's ID. + required: true + schema: + type: string + - name: fields + in: query + description: >- + Comma-separated fields that should be included in the returned data. + + if a field is prefixed with `+` it will be added to the default fields, + using `-` will remove it from the default fields. + + without prefix it will replace the entire default fields. + required: false + schema: + type: string + title: fields + description: >- + Comma-separated fields that should be included in the returned data. + If a field is prefixed with `+` it will be added to the default + fields, using `-` will remove it from the default fields. Without + prefix it will replace the entire default fields. + externalDocs: + url: '#select-fields-and-relations' + x-codeSamples: + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/store_carts_{id}_customer/post.sh + tags: + - Carts + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/StoreCartResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-workflow: transferCartCustomerWorkflow diff --git a/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_accept.yaml b/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_accept.yaml new file mode 100644 index 0000000000000..9d4fa276a66a8 --- /dev/null +++ b/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_accept.yaml @@ -0,0 +1,72 @@ +post: + operationId: PostOrdersIdTransferAccept + summary: Accept Order Transfer + x-sidebar-summary: Accept Transfer + description: >- + Accept an order to be transfered to a customer's account, which was + specified when the transfer request was created. The transfer is requested + previously either by the customer using the [Request Order Transfer Store + API + route](https://docs.medusajs.com/api/store#orders_postordersidtransferrequest), + or by the admin using the [Request Order Transfer Admin API + route](https://docs.medusajs.com/api/admin#orders_postordersidtransferrequest). + x-authenticated: false + parameters: + - name: id + in: path + description: The order's ID. + required: true + schema: + type: string + - name: fields + in: query + description: >- + Comma-separated fields that should be included in the returned data. + + if a field is prefixed with `+` it will be added to the default fields, + using `-` will remove it from the default fields. + + without prefix it will replace the entire default fields. + required: false + schema: + type: string + title: fields + description: >- + Comma-separated fields that should be included in the returned data. + If a field is prefixed with `+` it will be added to the default + fields, using `-` will remove it from the default fields. Without + prefix it will replace the entire default fields. + externalDocs: + url: '#select-fields-and-relations' + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/StoreAcceptOrderTransfer.yaml + x-codeSamples: + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/store_orders_{id}_transfer_accept/post.sh + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/StoreOrderResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-workflow: acceptOrderTransferWorkflow diff --git a/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_cancel.yaml b/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_cancel.yaml new file mode 100644 index 0000000000000..d1786bc3de6ad --- /dev/null +++ b/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_cancel.yaml @@ -0,0 +1,67 @@ +post: + operationId: PostOrdersIdTransferCancel + summary: Cancel Order Transfer + x-sidebar-summary: Cancel Transfer + description: >- + Cancel an order transfer that the logged-in customer previously requested + using the [Request Order + Transfer](https://docs.medusajs.com/api/store#orders_postordersidtransferrequest) + API route. + x-authenticated: true + parameters: + - name: id + in: path + description: The order's ID. + required: true + schema: + type: string + - name: fields + in: query + description: >- + Comma-separated fields that should be included in the returned data. + + if a field is prefixed with `+` it will be added to the default fields, + using `-` will remove it from the default fields. + + without prefix it will replace the entire default fields. + required: false + schema: + type: string + title: fields + description: >- + Comma-separated fields that should be included in the returned data. + If a field is prefixed with `+` it will be added to the default + fields, using `-` will remove it from the default fields. Without + prefix it will replace the entire default fields. + externalDocs: + url: '#select-fields-and-relations' + x-codeSamples: + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/store_orders_{id}_transfer_cancel/post.sh + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/StoreOrderResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-workflow: cancelOrderTransferRequestWorkflow + security: + - cookie_auth: [] + - jwt_token: [] diff --git a/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_decline.yaml b/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_decline.yaml new file mode 100644 index 0000000000000..3849b015b812a --- /dev/null +++ b/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_decline.yaml @@ -0,0 +1,68 @@ +post: + operationId: PostOrdersIdTransferDecline + summary: Decline Order Transfer + x-sidebar-summary: Decline Transfer + description: >- + Decline an order transfer previously requested, typically by the admin user + using the [Request Order Transfer Admin API + route](https://docs.medusajs.com/api/admin#orders_postordersidtransferrequest). + x-authenticated: false + parameters: + - name: id + in: path + description: The order's ID. + required: true + schema: + type: string + - name: fields + in: query + description: >- + Comma-separated fields that should be included in the returned data. + + if a field is prefixed with `+` it will be added to the default fields, + using `-` will remove it from the default fields. + + without prefix it will replace the entire default fields. + required: false + schema: + type: string + title: fields + description: >- + Comma-separated fields that should be included in the returned data. + If a field is prefixed with `+` it will be added to the default + fields, using `-` will remove it from the default fields. Without + prefix it will replace the entire default fields. + externalDocs: + url: '#select-fields-and-relations' + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/StoreDeclineOrderTransferRequest.yaml + x-codeSamples: + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/store_orders_{id}_transfer_decline/post.sh + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/StoreOrderResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-workflow: declineOrderTransferRequestWorkflow diff --git a/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_request.yaml b/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_request.yaml new file mode 100644 index 0000000000000..4ccfc02588bf5 --- /dev/null +++ b/www/apps/api-reference/specs/store/paths/store_orders_{id}_transfer_request.yaml @@ -0,0 +1,72 @@ +post: + operationId: PostOrdersIdTransferRequest + summary: Request Order Transfer + x-sidebar-summery: Request Transfer + description: >- + Request an order to be transfered to the logged-in customer's account. The + transfer is confirmed using the [Accept Order + Transfer](https://docs.medusajs.com/api/store#orders_postordersidtransferaccept) + API route. + x-authenticated: true + parameters: + - name: id + in: path + description: The order's ID. + required: true + schema: + type: string + - name: fields + in: query + description: >- + Comma-separated fields that should be included in the returned data. + + if a field is prefixed with `+` it will be added to the default fields, + using `-` will remove it from the default fields. + + without prefix it will replace the entire default fields. + required: false + schema: + type: string + title: fields + description: >- + Comma-separated fields that should be included in the returned data. + If a field is prefixed with `+` it will be added to the default + fields, using `-` will remove it from the default fields. Without + prefix it will replace the entire default fields. + externalDocs: + url: '#select-fields-and-relations' + requestBody: + content: + application/json: + schema: + $ref: ../components/schemas/StoreRequestOrderTransfer.yaml + x-codeSamples: + - lang: Shell + label: cURL + source: + $ref: ../code_samples/Shell/store_orders_{id}_transfer_request/post.sh + tags: + - Orders + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: ../components/schemas/StoreOrderResponse.yaml + '400': + $ref: ../components/responses/400_error.yaml + '401': + $ref: ../components/responses/unauthorized.yaml + '404': + $ref: ../components/responses/not_found_error.yaml + '409': + $ref: ../components/responses/invalid_state_error.yaml + '422': + $ref: ../components/responses/invalid_request_error.yaml + '500': + $ref: ../components/responses/500_error.yaml + x-workflow: getOrderDetailWorkflow + security: + - cookie_auth: [] + - jwt_token: [] diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders.ts b/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders.ts index 82e64db5aaec5..da8abdbc09284 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders.ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_draft-orders.ts @@ -357,7 +357,7 @@ * $ref: "#/components/responses/invalid_request_error" * "500": * $ref: "#/components/responses/500_error" - * x-workflow: createOrdersWorkflow + * x-workflow: createOrderWorkflow * */ diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_transfer.ts b/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_transfer.ts new file mode 100644 index 0000000000000..43c30da1b874b --- /dev/null +++ b/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_transfer.ts @@ -0,0 +1,72 @@ +/** + * @oas [post] /admin/orders/{id}/transfer + * operationId: PostOrdersIdTransfer + * x-sidebar-summary: Request Transfer + * summary: Request Order Transfer + * description: Request an order to be transfered to another customer. The transfer is confirmed by sending a request to the [Accept Order Transfer](https://docs.medusajs.com/api/store#orders_postordersidtransferaccept) Store API route. + * x-authenticated: true + * parameters: + * - name: id + * in: path + * description: The order's ID. + * required: true + * schema: + * type: string + * - name: fields + * in: query + * description: |- + * Comma-separated fields that should be included in the returned data. + * if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. + * without prefix it will replace the entire default fields. + * required: false + * schema: + * type: string + * title: fields + * description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default + * fields. Without prefix it will replace the entire default fields. + * externalDocs: + * url: "#select-fields-and-relations" + * security: + * - api_token: [] + * - cookie_auth: [] + * - jwt_token: [] + * requestBody: + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminTransferOrder" + * x-codeSamples: + * - lang: Shell + * label: cURL + * source: |- + * curl -X POST '{backend_url}/admin/orders/{id}/transfer' \ + * -H 'Authorization: Bearer {access_token}' \ + * -H 'Content-Type: application/json' \ + * --data-raw '{ + * "customer_id": "cus_123" + * }' + * tags: + * - Orders + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/AdminOrderResponse" + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * x-workflow: requestOrderTransferWorkflow + * +*/ + diff --git a/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id].ts b/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_transfer_cancel.ts similarity index 62% rename from www/utils/generated/oas-output/operations/admin/post_admin_orders_[id].ts rename to www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_transfer_cancel.ts index 13d4079d7d0af..11b0a9c561852 100644 --- a/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id].ts +++ b/www/utils/generated/oas-output/operations/admin/post_admin_orders_[id]_transfer_cancel.ts @@ -1,8 +1,9 @@ /** - * @oas [post] /admin/orders/{id} - * operationId: PostOrdersId - * summary: Update an Order - * description: Update an order's details. + * @oas [post] /admin/orders/{id}/transfer/cancel + * operationId: PostOrdersIdTransferCancel + * summary: Cancel Transfer Request + * x-sidebar-summary: Cancel Transfer + * description: Cancel a request to transfer an order to another customer. * x-authenticated: true * parameters: * - name: id @@ -13,14 +14,16 @@ * type: string * - name: fields * in: query - * description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default - * fields. without prefix it will replace the entire default fields. + * description: |- + * Comma-separated fields that should be included in the returned data. + * if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. + * without prefix it will replace the entire default fields. * required: false * schema: * type: string * title: fields - * description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default - * fields. without prefix it will replace the entire default fields. + * description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default + * fields. Without prefix it will replace the entire default fields. * externalDocs: * url: "#select-fields-and-relations" * security: @@ -31,7 +34,7 @@ * - lang: Shell * label: cURL * source: |- - * curl -X POST '{backend_url}/admin/orders/{id}' \ + * curl -X POST '{backend_url}/admin/orders/{id}/transfer/cancel' \ * -H 'Authorization: Bearer {access_token}' * tags: * - Orders @@ -54,6 +57,7 @@ * $ref: "#/components/responses/invalid_request_error" * "500": * $ref: "#/components/responses/500_error" + * x-workflow: cancelOrderTransferRequestWorkflow * */ diff --git a/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_customer.ts b/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_customer.ts new file mode 100644 index 0000000000000..37364a55e8ea2 --- /dev/null +++ b/www/utils/generated/oas-output/operations/store/post_store_carts_[id]_customer.ts @@ -0,0 +1,62 @@ +/** + * @oas [post] /store/carts/{id}/customer + * operationId: PostCartsIdCustomer + * summary: Set Cart's Customer + * x-sidebar-summary: Set Customer + * description: Set the customer of the cart. This is useful when you create the cart for a guest customer, then they log in with their account. + * externalDocs: + * url: https://docs.medusajs.com/resources/storefront-development/cart/update#set-carts-customer + * description: "Storefront guide: How to set the cart's customer." + * x-authenticated: false + * parameters: + * - name: id + * in: path + * description: The cart's ID. + * required: true + * schema: + * type: string + * - name: fields + * in: query + * description: |- + * Comma-separated fields that should be included in the returned data. + * if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. + * without prefix it will replace the entire default fields. + * required: false + * schema: + * type: string + * title: fields + * description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default + * fields. Without prefix it will replace the entire default fields. + * externalDocs: + * url: "#select-fields-and-relations" + * x-codeSamples: + * - lang: Shell + * label: cURL + * source: |- + * curl -X POST '{backend_url}/store/carts/{id}/customer' \ + * -H 'x-publishable-api-key: {your_publishable_api_key}' + * tags: + * - Carts + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/StoreCartResponse" + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * x-workflow: transferCartCustomerWorkflow + * +*/ + diff --git a/www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_accept.ts b/www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_accept.ts new file mode 100644 index 0000000000000..997341a4e4098 --- /dev/null +++ b/www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_accept.ts @@ -0,0 +1,70 @@ +/** + * @oas [post] /store/orders/{id}/transfer/accept + * operationId: PostOrdersIdTransferAccept + * summary: Accept Order Transfer + * x-sidebar-summary: Accept Transfer + * description: Accept an order to be transfered to a customer's account, which was specified when the transfer request was created. The transfer is requested previously either by the customer using the + * [Request Order Transfer Store API route](https://docs.medusajs.com/api/store#orders_postordersidtransferrequest), or by the admin using the [Request Order Transfer Admin API + * route](https://docs.medusajs.com/api/admin#orders_postordersidtransferrequest). + * x-authenticated: false + * parameters: + * - name: id + * in: path + * description: The order's ID. + * required: true + * schema: + * type: string + * - name: fields + * in: query + * description: |- + * Comma-separated fields that should be included in the returned data. + * if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. + * without prefix it will replace the entire default fields. + * required: false + * schema: + * type: string + * title: fields + * description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default + * fields. Without prefix it will replace the entire default fields. + * externalDocs: + * url: "#select-fields-and-relations" + * requestBody: + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/StoreAcceptOrderTransfer" + * x-codeSamples: + * - lang: Shell + * label: cURL + * source: |- + * curl -X POST '{backend_url}/store/orders/{id}/transfer/accept' \ + * -H 'x-publishable-api-key: {your_publishable_api_key}' \ + * -H 'Content-Type: application/json' \ + * --data-raw '{ + * "token": "{value}" + * }' + * tags: + * - Orders + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/StoreOrderResponse" + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * x-workflow: acceptOrderTransferWorkflow + * +*/ + diff --git a/www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_cancel.ts b/www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_cancel.ts new file mode 100644 index 0000000000000..72d0102c01fcd --- /dev/null +++ b/www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_cancel.ts @@ -0,0 +1,62 @@ +/** + * @oas [post] /store/orders/{id}/transfer/cancel + * operationId: PostOrdersIdTransferCancel + * summary: Cancel Order Transfer + * x-sidebar-summary: Cancel Transfer + * description: Cancel an order transfer that the logged-in customer previously requested using the [Request Order Transfer](https://docs.medusajs.com/api/store#orders_postordersidtransferrequest) API route. + * x-authenticated: true + * parameters: + * - name: id + * in: path + * description: The order's ID. + * required: true + * schema: + * type: string + * - name: fields + * in: query + * description: |- + * Comma-separated fields that should be included in the returned data. + * if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. + * without prefix it will replace the entire default fields. + * required: false + * schema: + * type: string + * title: fields + * description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default + * fields. Without prefix it will replace the entire default fields. + * externalDocs: + * url: "#select-fields-and-relations" + * x-codeSamples: + * - lang: Shell + * label: cURL + * source: |- + * curl -X POST '{backend_url}/store/orders/{id}/transfer/cancel' \ + * -H 'x-publishable-api-key: {your_publishable_api_key}' + * tags: + * - Orders + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/StoreOrderResponse" + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * x-workflow: cancelOrderTransferRequestWorkflow + * security: + * - cookie_auth: [] + * - jwt_token: [] + * +*/ + diff --git a/www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_decline.ts b/www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_decline.ts new file mode 100644 index 0000000000000..225c2f199bcd7 --- /dev/null +++ b/www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_decline.ts @@ -0,0 +1,68 @@ +/** + * @oas [post] /store/orders/{id}/transfer/decline + * operationId: PostOrdersIdTransferDecline + * summary: Decline Order Transfer + * x-sidebar-summary: Decline Transfer + * description: Decline an order transfer previously requested, typically by the admin user using the [Request Order Transfer Admin API route](https://docs.medusajs.com/api/admin#orders_postordersidtransferrequest). + * x-authenticated: false + * parameters: + * - name: id + * in: path + * description: The order's ID. + * required: true + * schema: + * type: string + * - name: fields + * in: query + * description: |- + * Comma-separated fields that should be included in the returned data. + * if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. + * without prefix it will replace the entire default fields. + * required: false + * schema: + * type: string + * title: fields + * description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default + * fields. Without prefix it will replace the entire default fields. + * externalDocs: + * url: "#select-fields-and-relations" + * requestBody: + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/StoreDeclineOrderTransferRequest" + * x-codeSamples: + * - lang: Shell + * label: cURL + * source: |- + * curl -X POST '{backend_url}/store/orders/{id}/transfer/decline' \ + * -H 'x-publishable-api-key: {your_publishable_api_key}' \ + * -H 'Content-Type: application/json' \ + * --data-raw '{ + * "token": "{value}" + * }' + * tags: + * - Orders + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/StoreOrderResponse" + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * x-workflow: declineOrderTransferRequestWorkflow + * +*/ + diff --git a/www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_request.ts b/www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_request.ts new file mode 100644 index 0000000000000..f7616721ef2a4 --- /dev/null +++ b/www/utils/generated/oas-output/operations/store/post_store_orders_[id]_transfer_request.ts @@ -0,0 +1,68 @@ +/** + * @oas [post] /store/orders/{id}/transfer/request + * operationId: PostOrdersIdTransferRequest + * summary: Request Order Transfer + * x-sidebar-summery: Request Transfer + * description: Request an order to be transfered to the logged-in customer's account. The transfer is confirmed using the [Accept Order + * Transfer](https://docs.medusajs.com/api/store#orders_postordersidtransferaccept) API route. + * x-authenticated: true + * parameters: + * - name: id + * in: path + * description: The order's ID. + * required: true + * schema: + * type: string + * - name: fields + * in: query + * description: |- + * Comma-separated fields that should be included in the returned data. + * if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default fields. + * without prefix it will replace the entire default fields. + * required: false + * schema: + * type: string + * title: fields + * description: Comma-separated fields that should be included in the returned data. If a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default + * fields. Without prefix it will replace the entire default fields. + * externalDocs: + * url: "#select-fields-and-relations" + * requestBody: + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/StoreRequestOrderTransfer" + * x-codeSamples: + * - lang: Shell + * label: cURL + * source: |- + * curl -X POST '{backend_url}/store/orders/{id}/transfer/request' \ + * -H 'x-publishable-api-key: {your_publishable_api_key}' + * tags: + * - Orders + * responses: + * "200": + * description: OK + * content: + * application/json: + * schema: + * $ref: "#/components/schemas/StoreOrderResponse" + * "400": + * $ref: "#/components/responses/400_error" + * "401": + * $ref: "#/components/responses/unauthorized" + * "404": + * $ref: "#/components/responses/not_found_error" + * "409": + * $ref: "#/components/responses/invalid_state_error" + * "422": + * $ref: "#/components/responses/invalid_request_error" + * "500": + * $ref: "#/components/responses/500_error" + * x-workflow: getOrderDetailWorkflow + * security: + * - cookie_auth: [] + * - jwt_token: [] + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminBatchProductRequest.ts b/www/utils/generated/oas-output/schemas/AdminBatchProductRequest.ts index 58e0879d0ed78..69092c3db2ae7 100644 --- a/www/utils/generated/oas-output/schemas/AdminBatchProductRequest.ts +++ b/www/utils/generated/oas-output/schemas/AdminBatchProductRequest.ts @@ -13,7 +13,7 @@ * type: array * description: The products to update. * items: - * $ref: "#/components/schemas/AdminUpdateProduct" + * $ref: "#/components/schemas/AdminBatchUpdateProduct" * delete: * type: array * description: The products to delete. diff --git a/www/utils/generated/oas-output/schemas/AdminBatchUpdateProduct.ts b/www/utils/generated/oas-output/schemas/AdminBatchUpdateProduct.ts new file mode 100644 index 0000000000000..0fa4bfbc116b1 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminBatchUpdateProduct.ts @@ -0,0 +1,162 @@ +/** + * @schema AdminBatchUpdateProduct + * type: object + * description: The product's details. + * x-schemaName: AdminBatchUpdateProduct + * properties: + * title: + * type: string + * title: title + * description: The product's title. + * subtitle: + * type: string + * title: subtitle + * description: The product's subtitle. + * description: + * type: string + * title: description + * description: The product's description. + * is_giftcard: + * type: boolean + * title: is_giftcard + * description: Whether the product is a gift card. + * discountable: + * type: boolean + * title: discountable + * description: Whether discounts can be applied on the product. + * images: + * type: array + * description: The product's images. + * items: + * type: object + * description: The image's details. + * required: + * - url + * properties: + * url: + * type: string + * title: url + * description: The image's URL. + * thumbnail: + * type: string + * title: thumbnail + * description: The product's thumbnail URL. + * handle: + * type: string + * title: handle + * description: The product's unique handle. + * status: + * type: string + * description: The product's status. + * enum: + * - draft + * - proposed + * - published + * - rejected + * type_id: + * type: string + * title: type_id + * description: The ID of the product's type. + * collection_id: + * type: string + * title: collection_id + * description: The ID of the product's collection. + * categories: + * type: array + * description: The product's categories. + * items: + * type: object + * description: The product's category. + * required: + * - id + * properties: + * id: + * type: string + * title: id + * description: The category's ID. + * tags: + * type: array + * description: The product's tags. + * items: + * type: object + * description: The product's tag. + * required: + * - id + * properties: + * id: + * type: string + * title: id + * description: The tag's ID. + * options: + * type: array + * description: The product's options. + * items: + * $ref: "#/components/schemas/AdminUpdateProductOption" + * variants: + * type: array + * description: The product's variants. You can add new variants or update existing ones, passing their IDs in the object. + * items: + * oneOf: + * - $ref: "#/components/schemas/AdminCreateProductVariant" + * - $ref: "#/components/schemas/AdminUpdateProductVariant" + * sales_channels: + * type: array + * description: The sales channels that the product is available in. + * items: + * type: object + * description: The sales channel's details. + * required: + * - id + * properties: + * id: + * type: string + * title: id + * description: The sales channel's ID. + * weight: + * type: number + * title: weight + * description: The product's weight. + * length: + * type: number + * title: length + * description: The product's length. + * height: + * type: number + * title: height + * description: The product's height. + * width: + * type: number + * title: width + * description: The product's width. + * hs_code: + * type: string + * title: hs_code + * description: The product's HS code. + * mid_code: + * type: string + * title: mid_code + * description: The product's MID code. + * origin_country: + * type: string + * title: origin_country + * description: The product's origin country. + * material: + * type: string + * title: material + * description: The product's material. + * metadata: + * type: object + * description: The product's metadata, can hold custom key-value pairs. + * external_id: + * type: string + * title: external_id + * description: The ID of the product in an external or third-party system. + * id: + * type: string + * title: id + * description: The product's ID. + * required: + * - id + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/AdminProductImage.ts b/www/utils/generated/oas-output/schemas/AdminProductImage.ts index d665a8eaab94d..74636a4e3b45c 100644 --- a/www/utils/generated/oas-output/schemas/AdminProductImage.ts +++ b/www/utils/generated/oas-output/schemas/AdminProductImage.ts @@ -30,9 +30,14 @@ * metadata: * type: object * description: The image's metadata, can hold custom key-value pairs. + * rank: + * type: number + * title: rank + * description: The image's rank among sibling images. * required: * - id * - url + * - rank * */ diff --git a/www/utils/generated/oas-output/schemas/AdminTransferOrder.ts b/www/utils/generated/oas-output/schemas/AdminTransferOrder.ts new file mode 100644 index 0000000000000..8289d7a8d3bd5 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/AdminTransferOrder.ts @@ -0,0 +1,23 @@ +/** + * @schema AdminTransferOrder + * type: object + * description: The details of the request to transfer the order. + * x-schemaName: AdminTransferOrder + * required: + * - customer_id + * properties: + * customer_id: + * type: string + * title: customer_id + * description: The ID of the customer to transfer the order to. + * description: + * type: string + * title: description + * description: The description of the order transfer, which can be shown to the customer receiving the order transfer request. + * internal_note: + * type: string + * title: internal_note + * description: An internal note viewable only by admin users. + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/BaseCalculatedPriceSet.ts b/www/utils/generated/oas-output/schemas/BaseCalculatedPriceSet.ts index ea2335d125a5f..a339bb81f87cb 100644 --- a/www/utils/generated/oas-output/schemas/BaseCalculatedPriceSet.ts +++ b/www/utils/generated/oas-output/schemas/BaseCalculatedPriceSet.ts @@ -53,9 +53,63 @@ * calculated_price: * type: object * description: The calculated price's details. + * properties: + * id: + * type: string + * title: id + * description: The ID of the price. + * price_list_id: + * type: string + * title: price_list_id + * description: The ID of the associated price list. + * price_list_type: + * type: string + * title: price_list_type + * description: The price list's type. For example, sale. + * min_quantity: + * type: number + * title: min_quantity + * description: The minimum quantity required in the cart for this price to apply. + * max_quantity: + * type: number + * title: max_quantity + * description: The maximum quantity allowed in the cart for this price to apply. + * required: + * - id + * - price_list_id + * - price_list_type + * - min_quantity + * - max_quantity * original_price: * type: object * description: The original price's details. + * properties: + * id: + * type: string + * title: id + * description: The ID of the price. + * price_list_id: + * type: string + * title: price_list_id + * description: The ID of the associated price list. + * price_list_type: + * type: string + * title: price_list_type + * description: The price list's type. For example, sale. + * min_quantity: + * type: number + * title: min_quantity + * description: The minimum quantity required in the cart for this price to apply. + * max_quantity: + * type: number + * title: max_quantity + * description: The maximum quantity allowed in the cart for this price to apply. + * required: + * - id + * - price_list_id + * - price_list_type + * - min_quantity + * - max_quantity * */ diff --git a/www/utils/generated/oas-output/schemas/BaseCartShippingMethod.ts b/www/utils/generated/oas-output/schemas/BaseCartShippingMethod.ts index b403f0dabdfec..7d935c64b8cf8 100644 --- a/www/utils/generated/oas-output/schemas/BaseCartShippingMethod.ts +++ b/www/utils/generated/oas-output/schemas/BaseCartShippingMethod.ts @@ -52,7 +52,7 @@ * type: object * description: The shipping method's data, useful for fulfillment handling by third-party services. * externalDocs: - * url: https://docs.medusajs.com/v2/resources/commerce-modules/cart/concepts#data-property + * url: https://docs.medusajs.com/resources/commerce-modules/cart/concepts#data-property * metadata: * type: object * description: The shipping method's metadata, can hold custom key-value pairs. @@ -77,36 +77,36 @@ * title: updated_at * description: The date the shipping method was updated. * original_total: - * type: string + * type: number * title: original_total * description: The shipping method's total including taxes, excluding promotions. * original_subtotal: - * type: string + * type: number * title: original_subtotal * description: The shipping method's total excluding taxes, including promotions. * original_tax_total: - * type: string + * type: number * title: original_tax_total * description: The total taxes applied on the shipping method's amount including promotions. * total: - * type: string + * type: number * title: total * description: The shipping method's total amount including taxes and promotions. * subtotal: - * type: string + * type: number * title: subtotal * description: The shipping method's total amount excluding taxes, including promotions. * tax_total: - * type: string + * type: number * title: tax_total * description: The total taxes applied on the shipping method's amount including promotions. * discount_total: - * type: string + * type: number * title: discount_total * description: The total amount discounted. * discount_tax_total: - * type: string - * title: discount_total + * type: number + * title: discount_tax_total * description: The taxes applied on the discounted amount. * */ diff --git a/www/utils/generated/oas-output/schemas/BaseLineItemAdjustment.ts b/www/utils/generated/oas-output/schemas/BaseLineItemAdjustment.ts index 59d0210c73122..e419e2f2c0db3 100644 --- a/www/utils/generated/oas-output/schemas/BaseLineItemAdjustment.ts +++ b/www/utils/generated/oas-output/schemas/BaseLineItemAdjustment.ts @@ -3,6 +3,14 @@ * type: object * description: The adjustment's details. * x-schemaName: BaseLineItemAdjustment + * required: + * - item + * - item_id + * - id + * - amount + * - cart_id + * - created_at + * - updated_at * properties: * item: * $ref: "#/components/schemas/BaseCartLineItem" @@ -48,14 +56,6 @@ * format: date-time * title: updated_at * description: The date the adjustment was updated. - * required: - * - item - * - item_id - * - id - * - amount - * - cart_id - * - created_at - * - updated_at * */ diff --git a/www/utils/generated/oas-output/schemas/BaseLineItemTaxLine.ts b/www/utils/generated/oas-output/schemas/BaseLineItemTaxLine.ts index 2c5563722287b..132e69b490ea6 100644 --- a/www/utils/generated/oas-output/schemas/BaseLineItemTaxLine.ts +++ b/www/utils/generated/oas-output/schemas/BaseLineItemTaxLine.ts @@ -3,6 +3,16 @@ * type: object * description: The tax line's details * x-schemaName: BaseLineItemTaxLine + * required: + * - item + * - item_id + * - total + * - subtotal + * - id + * - code + * - rate + * - created_at + * - updated_at * properties: * item: * $ref: "#/components/schemas/BaseCartLineItem" @@ -52,16 +62,6 @@ * format: date-time * title: updated_at * description: The date the tax line was updated. - * required: - * - item - * - item_id - * - total - * - subtotal - * - id - * - code - * - rate - * - created_at - * - updated_at * */ diff --git a/www/utils/generated/oas-output/schemas/BaseProductImage.ts b/www/utils/generated/oas-output/schemas/BaseProductImage.ts index c258e914f7f7d..9ff1cf55d2e06 100644 --- a/www/utils/generated/oas-output/schemas/BaseProductImage.ts +++ b/www/utils/generated/oas-output/schemas/BaseProductImage.ts @@ -30,9 +30,14 @@ * metadata: * type: object * description: The image's metadata, can hold custom key-value pairs. + * rank: + * type: number + * title: rank + * description: The image's rank among its sibling images. * required: * - id * - url + * - rank * */ diff --git a/www/utils/generated/oas-output/schemas/StoreAcceptOrderTransfer.ts b/www/utils/generated/oas-output/schemas/StoreAcceptOrderTransfer.ts new file mode 100644 index 0000000000000..68aeec45b7a2c --- /dev/null +++ b/www/utils/generated/oas-output/schemas/StoreAcceptOrderTransfer.ts @@ -0,0 +1,15 @@ +/** + * @schema StoreAcceptOrderTransfer + * type: object + * description: The details of accepting the order transfer. + * x-schemaName: StoreAcceptOrderTransfer + * required: + * - token + * properties: + * token: + * type: string + * title: token + * description: The order transfer's token issued when the transfer was requested. + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/StoreDeclineOrderTransferRequest.ts b/www/utils/generated/oas-output/schemas/StoreDeclineOrderTransferRequest.ts new file mode 100644 index 0000000000000..47c756da6a60c --- /dev/null +++ b/www/utils/generated/oas-output/schemas/StoreDeclineOrderTransferRequest.ts @@ -0,0 +1,15 @@ +/** + * @schema StoreDeclineOrderTransferRequest + * type: object + * description: The details of declining the order transfer request. + * x-schemaName: StoreDeclineOrderTransferRequest + * required: + * - token + * properties: + * token: + * type: string + * title: token + * description: The order transfer's token issued when the transfer was requested. + * +*/ + diff --git a/www/utils/generated/oas-output/schemas/StoreProductImage.ts b/www/utils/generated/oas-output/schemas/StoreProductImage.ts index 9c68a4cbb9c68..5111ed18d4b19 100644 --- a/www/utils/generated/oas-output/schemas/StoreProductImage.ts +++ b/www/utils/generated/oas-output/schemas/StoreProductImage.ts @@ -6,6 +6,7 @@ * required: * - id * - url + * - rank * properties: * id: * type: string @@ -33,6 +34,10 @@ * metadata: * type: object * description: The image's metadata, can hold custom key-value pairs. + * rank: + * type: number + * title: rank + * description: The image's rank among its sibling images * */ diff --git a/www/utils/generated/oas-output/schemas/StoreRequestOrderTransfer.ts b/www/utils/generated/oas-output/schemas/StoreRequestOrderTransfer.ts new file mode 100644 index 0000000000000..68e74e1001726 --- /dev/null +++ b/www/utils/generated/oas-output/schemas/StoreRequestOrderTransfer.ts @@ -0,0 +1,13 @@ +/** + * @schema StoreRequestOrderTransfer + * type: object + * description: The details of requesting the order transfer. + * x-schemaName: StoreRequestOrderTransfer + * properties: + * description: + * type: string + * title: description + * description: The transfer's description, which can be shown to the other customer receiving the request. + * +*/ + diff --git a/www/utils/packages/docs-generator/src/classes/kinds/oas.ts b/www/utils/packages/docs-generator/src/classes/kinds/oas.ts index cb978ebd65527..ec63cde75575b 100644 --- a/www/utils/packages/docs-generator/src/classes/kinds/oas.ts +++ b/www/utils/packages/docs-generator/src/classes/kinds/oas.ts @@ -77,6 +77,14 @@ class OasKindGenerator extends FunctionKindGenerator { startsWith: "store/customers", requiresAuthentication: true, }, + { + exact: "store/orders/[id]/transfer/request", + requiresAuthentication: true, + }, + { + exact: "store/orders/[id]/transfer/cancel", + requiresAuthentication: true, + }, ] readonly RESPONSE_TYPE_NAMES = ["MedusaResponse"] readonly FIELD_QUERY_PARAMS = ["fields", "expand"]