diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreCartLineItem.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreCartLineItem.yaml index cbb841f1d0..86e2bbd1bd 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/StoreCartLineItem.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreCartLineItem.yaml @@ -5,17 +5,6 @@ required: - cart - title - id - - item_total - - item_subtotal - - item_tax_total - - original_total - - original_subtotal - - original_tax_total - - total - - subtotal - - tax_total - - discount_total - - discount_tax_total - requires_shipping - is_discountable - is_tax_inclusive @@ -298,44 +287,88 @@ properties: original_total: type: number title: original_total - description: The item's total including taxes, excluding promotions. + description: >- + The item's total including taxes, excluding promotions. This field is only + available if you expand the `items.*` relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) + guide. original_subtotal: type: number title: original_subtotal - description: The item's total excluding taxes, including promotions. + description: >- + The item's total excluding taxes, including promotions. This field is only + available if you expand the `items.*` relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) + guide. original_tax_total: type: number title: original_tax_total - description: The total taxes of the item excluding promotions. + description: >- + The total taxes of the item excluding promotions. This field is only + available if you expand the `items.*` relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) + guide. item_total: type: number title: original_tax_total - description: The item's total including taxes and promotions. + description: >- + The item's total including taxes and promotions. This field is only + available if you expand the `items.*` relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) + guide. item_subtotal: type: number title: item_subtotal - description: The item's total excluding taxes, including promotions. + description: >- + The item's total excluding taxes, including promotions. This field is only + available if you expand the `items.*` relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) + guide. item_tax_total: type: number title: item_tax_total - description: The total taxes of the item including promotions. + description: >- + The total taxes of the item including promotions. This field is only + available if you expand the `items.*` relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) + guide. total: type: number title: total - description: The item's total including taxes and promotions. + description: >- + The item's total including taxes and promotions. This field is only + available if you expand the `items.*` relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) + guide. subtotal: type: number title: subtotal - description: The item's total excluding taxes, including promotions. + description: >- + The item's total excluding taxes, including promotions. This field is only + available if you expand the `items.*` relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) + guide. tax_total: type: number title: tax_total - description: The total taxes of the item including promotions. + description: >- + The total taxes of the item including promotions. This field is only + available if you expand the `items.*` relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) + guide. discount_total: type: number title: discount_total - description: The total discount of the item. + description: >- + The total discount of the item. This field is only available if you expand + the `items.*` relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) + guide. discount_tax_total: type: number title: discount_tax_total - description: The total taxes applied on the discounted amount. + description: >- + The total taxes applied on the discounted amount. This field is only + available if you expand the `items.*` relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) + guide. diff --git a/www/apps/api-reference/specs/admin/components/schemas/StoreCartShippingMethod.yaml b/www/apps/api-reference/specs/admin/components/schemas/StoreCartShippingMethod.yaml index 4cd0151100..f46cf54c91 100644 --- a/www/apps/api-reference/specs/admin/components/schemas/StoreCartShippingMethod.yaml +++ b/www/apps/api-reference/specs/admin/components/schemas/StoreCartShippingMethod.yaml @@ -9,14 +9,6 @@ required: - is_tax_inclusive - created_at - updated_at - - original_total - - original_subtotal - - original_tax_total - - total - - subtotal - - tax_total - - discount_total - - discount_tax_total properties: id: type: string @@ -221,36 +213,70 @@ properties: original_total: type: number title: original_total - description: The shipping method's total including taxes, excluding promotions. + description: >- + The shipping method's total including taxes, excluding promotions. This + field is only available if you expand the `shipping_methods.*` relation. + Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) + guide. original_subtotal: type: number title: original_subtotal - description: The shipping method's total excluding taxes, including promotions. + description: >- + The shipping method's total excluding taxes, including promotions. This + field is only available if you expand the `shipping_methods.*` relation. + Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) + guide. original_tax_total: type: number title: original_tax_total description: >- The total taxes applied on the shipping method's amount including - promotions. + promotions. This field is only available if you expand the + `shipping_methods.*` relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) + guide. total: type: number title: total - description: The shipping method's total amount including taxes and promotions. + description: >- + The shipping method's total amount including taxes and promotions. This + field is only available if you expand the `shipping_methods.*` relation. + Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) + guide. subtotal: type: number title: subtotal - description: The shipping method's total amount excluding taxes, including promotions. + description: >- + The shipping method's total amount excluding taxes, including promotions. + This field is only available if you expand the `shipping_methods.*` + relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) + guide. tax_total: type: number title: tax_total description: >- The total taxes applied on the shipping method's amount including - promotions. + promotions. This field is only available if you expand the + `shipping_methods.*` relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) + guide. discount_total: type: number title: discount_total - description: The total amount discounted. + description: >- + The total amount discounted. This field is only available if you expand + the `shipping_methods.*` relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) + guide. discount_tax_total: type: number title: discount_tax_total - description: The taxes applied on the discounted amount. + description: >- + The taxes applied on the discounted amount. This field is only available + if you expand the `shipping_methods.*` relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) + guide. diff --git a/www/apps/api-reference/specs/admin/openapi.full.yaml b/www/apps/api-reference/specs/admin/openapi.full.yaml index 03f8329181..87cc4245f5 100644 --- a/www/apps/api-reference/specs/admin/openapi.full.yaml +++ b/www/apps/api-reference/specs/admin/openapi.full.yaml @@ -76258,17 +76258,6 @@ components: - cart - title - id - - item_total - - item_subtotal - - item_tax_total - - original_total - - original_subtotal - - original_tax_total - - total - - subtotal - - tax_total - - discount_total - - discount_tax_total - requires_shipping - is_discountable - is_tax_inclusive @@ -76551,47 +76540,47 @@ components: original_total: type: number title: original_total - description: The item's total including taxes, excluding promotions. + description: The item's total including taxes, excluding promotions. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. original_subtotal: type: number title: original_subtotal - description: The item's total excluding taxes, including promotions. + description: The item's total excluding taxes, including promotions. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. original_tax_total: type: number title: original_tax_total - description: The total taxes of the item excluding promotions. + description: The total taxes of the item excluding promotions. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. item_total: type: number title: original_tax_total - description: The item's total including taxes and promotions. + description: The item's total including taxes and promotions. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. item_subtotal: type: number title: item_subtotal - description: The item's total excluding taxes, including promotions. + description: The item's total excluding taxes, including promotions. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. item_tax_total: type: number title: item_tax_total - description: The total taxes of the item including promotions. + description: The total taxes of the item including promotions. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. total: type: number title: total - description: The item's total including taxes and promotions. + description: The item's total including taxes and promotions. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. subtotal: type: number title: subtotal - description: The item's total excluding taxes, including promotions. + description: The item's total excluding taxes, including promotions. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. tax_total: type: number title: tax_total - description: The total taxes of the item including promotions. + description: The total taxes of the item including promotions. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. discount_total: type: number title: discount_total - description: The total discount of the item. + description: The total discount of the item. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. discount_tax_total: type: number title: discount_tax_total - description: The total taxes applied on the discounted amount. + description: The total taxes applied on the discounted amount. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. StoreCartPromotion: type: object description: The promotion's promotions. @@ -76668,14 +76657,6 @@ components: - is_tax_inclusive - created_at - updated_at - - original_total - - original_subtotal - - original_tax_total - - total - - subtotal - - tax_total - - discount_total - - discount_tax_total properties: id: type: string @@ -76877,35 +76858,35 @@ components: original_total: type: number title: original_total - description: The shipping method's total including taxes, excluding promotions. + description: The shipping method's total including taxes, excluding promotions. This field is only available if you expand the `shipping_methods.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. original_subtotal: type: number title: original_subtotal - description: The shipping method's total excluding taxes, including promotions. + description: The shipping method's total excluding taxes, including promotions. This field is only available if you expand the `shipping_methods.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. original_tax_total: type: number title: original_tax_total - description: The total taxes applied on the shipping method's amount including promotions. + description: The total taxes applied on the shipping method's amount including promotions. This field is only available if you expand the `shipping_methods.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. total: type: number title: total - description: The shipping method's total amount including taxes and promotions. + description: The shipping method's total amount including taxes and promotions. This field is only available if you expand the `shipping_methods.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. subtotal: type: number title: subtotal - description: The shipping method's total amount excluding taxes, including promotions. + description: The shipping method's total amount excluding taxes, including promotions. This field is only available if you expand the `shipping_methods.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. tax_total: type: number title: tax_total - description: The total taxes applied on the shipping method's amount including promotions. + description: The total taxes applied on the shipping method's amount including promotions. This field is only available if you expand the `shipping_methods.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. discount_total: type: number title: discount_total - description: The total amount discounted. + description: The total amount discounted. This field is only available if you expand the `shipping_methods.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. discount_tax_total: type: number title: discount_tax_total - description: The taxes applied on the discounted amount. + description: The taxes applied on the discounted amount. This field is only available if you expand the `shipping_methods.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. StoreCartShippingOption: type: object description: The shipping option's details. diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreCartLineItem.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreCartLineItem.yaml index cbb841f1d0..86e2bbd1bd 100644 --- a/www/apps/api-reference/specs/store/components/schemas/StoreCartLineItem.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/StoreCartLineItem.yaml @@ -5,17 +5,6 @@ required: - cart - title - id - - item_total - - item_subtotal - - item_tax_total - - original_total - - original_subtotal - - original_tax_total - - total - - subtotal - - tax_total - - discount_total - - discount_tax_total - requires_shipping - is_discountable - is_tax_inclusive @@ -298,44 +287,88 @@ properties: original_total: type: number title: original_total - description: The item's total including taxes, excluding promotions. + description: >- + The item's total including taxes, excluding promotions. This field is only + available if you expand the `items.*` relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) + guide. original_subtotal: type: number title: original_subtotal - description: The item's total excluding taxes, including promotions. + description: >- + The item's total excluding taxes, including promotions. This field is only + available if you expand the `items.*` relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) + guide. original_tax_total: type: number title: original_tax_total - description: The total taxes of the item excluding promotions. + description: >- + The total taxes of the item excluding promotions. This field is only + available if you expand the `items.*` relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) + guide. item_total: type: number title: original_tax_total - description: The item's total including taxes and promotions. + description: >- + The item's total including taxes and promotions. This field is only + available if you expand the `items.*` relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) + guide. item_subtotal: type: number title: item_subtotal - description: The item's total excluding taxes, including promotions. + description: >- + The item's total excluding taxes, including promotions. This field is only + available if you expand the `items.*` relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) + guide. item_tax_total: type: number title: item_tax_total - description: The total taxes of the item including promotions. + description: >- + The total taxes of the item including promotions. This field is only + available if you expand the `items.*` relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) + guide. total: type: number title: total - description: The item's total including taxes and promotions. + description: >- + The item's total including taxes and promotions. This field is only + available if you expand the `items.*` relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) + guide. subtotal: type: number title: subtotal - description: The item's total excluding taxes, including promotions. + description: >- + The item's total excluding taxes, including promotions. This field is only + available if you expand the `items.*` relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) + guide. tax_total: type: number title: tax_total - description: The total taxes of the item including promotions. + description: >- + The total taxes of the item including promotions. This field is only + available if you expand the `items.*` relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) + guide. discount_total: type: number title: discount_total - description: The total discount of the item. + description: >- + The total discount of the item. This field is only available if you expand + the `items.*` relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) + guide. discount_tax_total: type: number title: discount_tax_total - description: The total taxes applied on the discounted amount. + description: >- + The total taxes applied on the discounted amount. This field is only + available if you expand the `items.*` relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) + guide. diff --git a/www/apps/api-reference/specs/store/components/schemas/StoreCartShippingMethod.yaml b/www/apps/api-reference/specs/store/components/schemas/StoreCartShippingMethod.yaml index 4cd0151100..f46cf54c91 100644 --- a/www/apps/api-reference/specs/store/components/schemas/StoreCartShippingMethod.yaml +++ b/www/apps/api-reference/specs/store/components/schemas/StoreCartShippingMethod.yaml @@ -9,14 +9,6 @@ required: - is_tax_inclusive - created_at - updated_at - - original_total - - original_subtotal - - original_tax_total - - total - - subtotal - - tax_total - - discount_total - - discount_tax_total properties: id: type: string @@ -221,36 +213,70 @@ properties: original_total: type: number title: original_total - description: The shipping method's total including taxes, excluding promotions. + description: >- + The shipping method's total including taxes, excluding promotions. This + field is only available if you expand the `shipping_methods.*` relation. + Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) + guide. original_subtotal: type: number title: original_subtotal - description: The shipping method's total excluding taxes, including promotions. + description: >- + The shipping method's total excluding taxes, including promotions. This + field is only available if you expand the `shipping_methods.*` relation. + Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) + guide. original_tax_total: type: number title: original_tax_total description: >- The total taxes applied on the shipping method's amount including - promotions. + promotions. This field is only available if you expand the + `shipping_methods.*` relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) + guide. total: type: number title: total - description: The shipping method's total amount including taxes and promotions. + description: >- + The shipping method's total amount including taxes and promotions. This + field is only available if you expand the `shipping_methods.*` relation. + Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) + guide. subtotal: type: number title: subtotal - description: The shipping method's total amount excluding taxes, including promotions. + description: >- + The shipping method's total amount excluding taxes, including promotions. + This field is only available if you expand the `shipping_methods.*` + relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) + guide. tax_total: type: number title: tax_total description: >- The total taxes applied on the shipping method's amount including - promotions. + promotions. This field is only available if you expand the + `shipping_methods.*` relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) + guide. discount_total: type: number title: discount_total - description: The total amount discounted. + description: >- + The total amount discounted. This field is only available if you expand + the `shipping_methods.*` relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) + guide. discount_tax_total: type: number title: discount_tax_total - description: The taxes applied on the discounted amount. + description: >- + The taxes applied on the discounted amount. This field is only available + if you expand the `shipping_methods.*` relation. Learn more in the [Cart + Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) + guide. diff --git a/www/apps/api-reference/specs/store/openapi.full.yaml b/www/apps/api-reference/specs/store/openapi.full.yaml index aa50550d67..b3d36cd2f2 100644 --- a/www/apps/api-reference/specs/store/openapi.full.yaml +++ b/www/apps/api-reference/specs/store/openapi.full.yaml @@ -30519,17 +30519,6 @@ components: - cart - title - id - - item_total - - item_subtotal - - item_tax_total - - original_total - - original_subtotal - - original_tax_total - - total - - subtotal - - tax_total - - discount_total - - discount_tax_total - requires_shipping - is_discountable - is_tax_inclusive @@ -30812,47 +30801,47 @@ components: original_total: type: number title: original_total - description: The item's total including taxes, excluding promotions. + description: The item's total including taxes, excluding promotions. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. original_subtotal: type: number title: original_subtotal - description: The item's total excluding taxes, including promotions. + description: The item's total excluding taxes, including promotions. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. original_tax_total: type: number title: original_tax_total - description: The total taxes of the item excluding promotions. + description: The total taxes of the item excluding promotions. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. item_total: type: number title: original_tax_total - description: The item's total including taxes and promotions. + description: The item's total including taxes and promotions. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. item_subtotal: type: number title: item_subtotal - description: The item's total excluding taxes, including promotions. + description: The item's total excluding taxes, including promotions. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. item_tax_total: type: number title: item_tax_total - description: The total taxes of the item including promotions. + description: The total taxes of the item including promotions. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. total: type: number title: total - description: The item's total including taxes and promotions. + description: The item's total including taxes and promotions. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. subtotal: type: number title: subtotal - description: The item's total excluding taxes, including promotions. + description: The item's total excluding taxes, including promotions. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. tax_total: type: number title: tax_total - description: The total taxes of the item including promotions. + description: The total taxes of the item including promotions. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. discount_total: type: number title: discount_total - description: The total discount of the item. + description: The total discount of the item. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. discount_tax_total: type: number title: discount_tax_total - description: The total taxes applied on the discounted amount. + description: The total taxes applied on the discounted amount. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. StoreCartPromotion: type: object description: The promotion's promotions. @@ -30929,14 +30918,6 @@ components: - is_tax_inclusive - created_at - updated_at - - original_total - - original_subtotal - - original_tax_total - - total - - subtotal - - tax_total - - discount_total - - discount_tax_total properties: id: type: string @@ -31138,35 +31119,35 @@ components: original_total: type: number title: original_total - description: The shipping method's total including taxes, excluding promotions. + description: The shipping method's total including taxes, excluding promotions. This field is only available if you expand the `shipping_methods.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. original_subtotal: type: number title: original_subtotal - description: The shipping method's total excluding taxes, including promotions. + description: The shipping method's total excluding taxes, including promotions. This field is only available if you expand the `shipping_methods.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. original_tax_total: type: number title: original_tax_total - description: The total taxes applied on the shipping method's amount including promotions. + description: The total taxes applied on the shipping method's amount including promotions. This field is only available if you expand the `shipping_methods.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. total: type: number title: total - description: The shipping method's total amount including taxes and promotions. + description: The shipping method's total amount including taxes and promotions. This field is only available if you expand the `shipping_methods.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. subtotal: type: number title: subtotal - description: The shipping method's total amount excluding taxes, including promotions. + description: The shipping method's total amount excluding taxes, including promotions. This field is only available if you expand the `shipping_methods.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. tax_total: type: number title: tax_total - description: The total taxes applied on the shipping method's amount including promotions. + description: The total taxes applied on the shipping method's amount including promotions. This field is only available if you expand the `shipping_methods.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. discount_total: type: number title: discount_total - description: The total amount discounted. + description: The total amount discounted. This field is only available if you expand the `shipping_methods.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. discount_tax_total: type: number title: discount_tax_total - description: The taxes applied on the discounted amount. + description: The taxes applied on the discounted amount. This field is only available if you expand the `shipping_methods.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. StoreCartShippingOption: type: object description: The shipping option's details. diff --git a/www/apps/book/public/llms-full.txt b/www/apps/book/public/llms-full.txt index a4d8d098b8..5879ccbf97 100644 --- a/www/apps/book/public/llms-full.txt +++ b/www/apps/book/public/llms-full.txt @@ -24479,7 +24479,7 @@ The basic authentication flow requires first using the `register` method, then t const { success, authIdentity, - error + error, } = await authModuleService.register( "emailpass", // passed to auth provider @@ -24527,7 +24527,7 @@ There are two ways to handle this: const { success, authIdentity, - location + location, } = await authModuleService.authenticate( "emailpass", // passed to auth provider @@ -24600,7 +24600,7 @@ The Google and GitHub providers allow you to override their `callbackUrl` option const { success, authIdentity, - location + location, } = await authModuleService.authenticate( "google", // passed to auth provider diff --git a/www/apps/resources/app/commerce-modules/auth/auth-flows/page.mdx b/www/apps/resources/app/commerce-modules/auth/auth-flows/page.mdx index cce7c817d9..1d06d851fe 100644 --- a/www/apps/resources/app/commerce-modules/auth/auth-flows/page.mdx +++ b/www/apps/resources/app/commerce-modules/auth/auth-flows/page.mdx @@ -90,7 +90,7 @@ The basic authentication flow requires first using the `register` method, then t const { success, authIdentity, - error + error, } = await authModuleService.register( "emailpass", // passed to auth provider @@ -142,7 +142,7 @@ There are two ways to handle this: const { success, authIdentity, - location + location, } = await authModuleService.authenticate( "emailpass", // passed to auth provider @@ -215,7 +215,7 @@ The Google and GitHub providers allow you to override their `callbackUrl` option const { success, authIdentity, - location + location, } = await authModuleService.authenticate( "google", // passed to auth provider diff --git a/www/apps/resources/app/storefront-development/cart/totals/page.mdx b/www/apps/resources/app/storefront-development/cart/totals/page.mdx index cc751a445b..3635d407e5 100644 --- a/www/apps/resources/app/storefront-development/cart/totals/page.mdx +++ b/www/apps/resources/app/storefront-development/cart/totals/page.mdx @@ -35,7 +35,7 @@ The fields that are most commonly used are: `subtotal` - The cart's subtotal excluding taxes, and including total of items, shipping, and discounts. + The cart's subtotal excluding taxes and including items, shipping, and discounts. @@ -75,7 +75,7 @@ The fields that are most commonly used are: --- -## Example: React Storefront +## Example: Show Cart Totals in React Storefront Here's an example of how you can show the cart totals in a React component: @@ -106,7 +106,7 @@ export default function CartTotals() { const formatPrice = (amount: number): string => { return new Intl.NumberFormat("en-US", { style: "currency", - currency: cart?.currency_code, + currency: cart?.currency_code || "USD", }) .format(amount) } @@ -146,3 +146,129 @@ export default function CartTotals() { In the example, you first retrieve the cart using the [Cart Context](../context/page.mdx). Then, you define the [formatPrice](../retrieve/page.mdx#format-prices) function to format the total amounts. Finally, you render the cart totals in a list, showing the subtotal, discounts, shipping, taxes, and the total amount. + +--- + +## Retrieve and Show Cart Item Totals + +You can also show the totals specific to each item in the cart. This is useful when you want to show the price breakdown for each item, such as price before and after discounts. + +The cart item totals aren't included by default in the cart object. You need to explicitly expand the `items.*` relation when retrieving the cart. This will add item totals like `total`, `subtotal`, `tax_total`, and `discount_total` to each item object in the cart. You can learn about other total fields in the [Store API reference](!api!/store#carts_cart_schema). + +For example, when retrieving the cart, you can expand the `items.*` relation like this: + +```ts +sdk.store.cart.retrieve(cartId, { + fields: "+items.*", + // TIP: You can also expand both items and shipping methods at the same time + // fields: "+items.*, +shipping_methods.*", +}) +.then(({ cart: dataCart }) => { + setCart(dataCart) +}) +``` + +Then, you can show the item totals in a React component like this: + +```tsx +"use client" // include with Next.js 13+ + +import { HttpTypes } from "@medusajs/types" + +type CartItemTotalsProps = { + cart: HttpTypes.StoreCart +} + +export default function CartItemTotals({ + cart, +}: CartItemTotalsProps) { + const formatPrice = (amount: number): string => { + return new Intl.NumberFormat("en-US", { + style: "currency", + currency: cart.currency_code, + }) + .format(amount) + } + + return ( + + ) +} +``` + +In the example, you receive the cart with the expanded item totals as a prop. Then, you define the [formatPrice](../retrieve/page.mdx#format-prices) function to format the total amounts. + +Finally, you render the cart items in a list, showing each item's title, total, subtotal, discounts, and taxes. + +--- + +## Retrieve and Show Shipping Method Totals + +You can also show the totals specific to each shipping method in the cart. This is useful when you want to show the price breakdown for each shipping method, such as price before and after discounts. + +The cart shipping method totals aren't included by default in the cart response. You need to explicitly expand the `shipping_methods.*` relation when retrieving the cart. This will add shipping method totals like `total`, `subtotal`, `tax_total`, and `discount_total` to each shipping method object in the cart. You can learn about other total fields in the [Store API reference](!api!/store#carts_cart_schema). + +For example, when retrieving the cart, you can expand the `shipping_methods.*` relation like this: + +```ts +sdk.store.cart.retrieve(cartId, { + fields: "+shipping_methods.*", + // TIP: You can also expand both items and shipping methods at the same time + // fields: "+items.*, +shipping_methods.*", +}) +.then(({ cart: dataCart }) => { + setCart(dataCart) +}) +``` + +Then, you can show the shipping method totals in a React component like this: + +```tsx +"use client" // include with Next.js 13+ + +import { HttpTypes } from "@medusajs/types" + +type CartShippingMethodTotalsProps = { + cart: HttpTypes.StoreCart +} + +export default function CartShippingMethodTotals({ + cart, +}: CartShippingMethodTotalsProps) { + const formatPrice = (amount: number): string => { + return new Intl.NumberFormat("en-US", { + style: "currency", + currency: cart.currency_code, + }) + .format(amount) + } + + return ( + + ) +} +``` + +In the example, you receive the cart with the expanded shipping method totals as a prop. Then, you define the [formatPrice](../retrieve/page.mdx#format-prices) function to format the total amounts. + +Finally, you render the cart shipping methods in a list, showing each method's name, total, subtotal, discounts, and taxes. \ No newline at end of file diff --git a/www/apps/resources/generated/edit-dates.mjs b/www/apps/resources/generated/edit-dates.mjs index 1b3104adff..2de1d02fcc 100644 --- a/www/apps/resources/generated/edit-dates.mjs +++ b/www/apps/resources/generated/edit-dates.mjs @@ -6035,7 +6035,7 @@ export const generatedEditDates = { "references/modules/notification_service/page.mdx": "2025-03-17T15:24:05.164Z", "references/notification_service/interfaces/notification_service.INotificationModuleService/page.mdx": "2025-07-24T08:20:50.610Z", "app/nextjs-starter/guides/revalidate-cache/page.mdx": "2025-05-01T15:33:42.490Z", - "app/storefront-development/cart/totals/page.mdx": "2025-08-14T15:58:30.316Z", + "app/storefront-development/cart/totals/page.mdx": "2025-09-15T15:13:56.268Z", "app/storefront-development/checkout/order-confirmation/page.mdx": "2025-08-14T15:58:36.610Z", "app/how-to-tutorials/tutorials/product-reviews/page.mdx": "2025-06-26T12:34:50.976Z", "app/troubleshooting/data-models/default-fields/page.mdx": "2025-03-21T06:59:06.775Z", diff --git a/www/utils/generated/oas-output/schemas/StoreCartLineItem.ts b/www/utils/generated/oas-output/schemas/StoreCartLineItem.ts index 3958dabe53..1f7462981f 100644 --- a/www/utils/generated/oas-output/schemas/StoreCartLineItem.ts +++ b/www/utils/generated/oas-output/schemas/StoreCartLineItem.ts @@ -7,17 +7,6 @@ * - cart * - title * - id - * - item_total - * - item_subtotal - * - item_tax_total - * - original_total - * - original_subtotal - * - original_tax_total - * - total - * - subtotal - * - tax_total - * - discount_total - * - discount_tax_total * - requires_shipping * - is_discountable * - is_tax_inclusive @@ -300,47 +289,47 @@ * original_total: * type: number * title: original_total - * description: The item's total including taxes, excluding promotions. + * description: The item's total including taxes, excluding promotions. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. * original_subtotal: * type: number * title: original_subtotal - * description: The item's total excluding taxes, including promotions. + * description: The item's total excluding taxes, including promotions. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. * original_tax_total: * type: number * title: original_tax_total - * description: The total taxes of the item excluding promotions. + * description: The total taxes of the item excluding promotions. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. * item_total: * type: number * title: original_tax_total - * description: The item's total including taxes and promotions. + * description: The item's total including taxes and promotions. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. * item_subtotal: * type: number * title: item_subtotal - * description: The item's total excluding taxes, including promotions. + * description: The item's total excluding taxes, including promotions. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. * item_tax_total: * type: number * title: item_tax_total - * description: The total taxes of the item including promotions. + * description: The total taxes of the item including promotions. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. * total: * type: number * title: total - * description: The item's total including taxes and promotions. + * description: The item's total including taxes and promotions. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. * subtotal: * type: number * title: subtotal - * description: The item's total excluding taxes, including promotions. + * description: The item's total excluding taxes, including promotions. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. * tax_total: * type: number * title: tax_total - * description: The total taxes of the item including promotions. + * description: The total taxes of the item including promotions. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. * discount_total: * type: number * title: discount_total - * description: The total discount of the item. + * description: The total discount of the item. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. * discount_tax_total: * type: number * title: discount_tax_total - * description: The total taxes applied on the discounted amount. + * description: The total taxes applied on the discounted amount. This field is only available if you expand the `items.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-cart-item-totals) guide. * */ diff --git a/www/utils/generated/oas-output/schemas/StoreCartShippingMethod.ts b/www/utils/generated/oas-output/schemas/StoreCartShippingMethod.ts index e687323c64..ae5e3629f2 100644 --- a/www/utils/generated/oas-output/schemas/StoreCartShippingMethod.ts +++ b/www/utils/generated/oas-output/schemas/StoreCartShippingMethod.ts @@ -11,14 +11,6 @@ * - is_tax_inclusive * - created_at * - updated_at - * - original_total - * - original_subtotal - * - original_tax_total - * - total - * - subtotal - * - tax_total - * - discount_total - * - discount_tax_total * properties: * id: * type: string @@ -220,35 +212,35 @@ * original_total: * type: number * title: original_total - * description: The shipping method's total including taxes, excluding promotions. + * description: The shipping method's total including taxes, excluding promotions. This field is only available if you expand the `shipping_methods.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. * original_subtotal: * type: number * title: original_subtotal - * description: The shipping method's total excluding taxes, including promotions. + * description: The shipping method's total excluding taxes, including promotions. This field is only available if you expand the `shipping_methods.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. * original_tax_total: * type: number * title: original_tax_total - * description: The total taxes applied on the shipping method's amount including promotions. + * description: The total taxes applied on the shipping method's amount including promotions. This field is only available if you expand the `shipping_methods.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. * total: * type: number * title: total - * description: The shipping method's total amount including taxes and promotions. + * description: The shipping method's total amount including taxes and promotions. This field is only available if you expand the `shipping_methods.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. * subtotal: * type: number * title: subtotal - * description: The shipping method's total amount excluding taxes, including promotions. + * description: The shipping method's total amount excluding taxes, including promotions. This field is only available if you expand the `shipping_methods.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. * tax_total: * type: number * title: tax_total - * description: The total taxes applied on the shipping method's amount including promotions. + * description: The total taxes applied on the shipping method's amount including promotions. This field is only available if you expand the `shipping_methods.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. * discount_total: * type: number * title: discount_total - * description: The total amount discounted. + * description: The total amount discounted. This field is only available if you expand the `shipping_methods.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. * discount_tax_total: * type: number * title: discount_tax_total - * description: The taxes applied on the discounted amount. + * description: The taxes applied on the discounted amount. This field is only available if you expand the `shipping_methods.*` relation. Learn more in the [Cart Totals](https://docs.medusajs.com/resources/storefront-development/cart/totals#retrieve-and-show-shipping-method-totals) guide. * */