1 /**
2 * @schema StoreCart
3 * type: object
4 * description: The cart's details.
5 * x-schemaName: StoreCart
6 * required:
7 * - promotions
8 * - id
9 * - currency_code
10 * - original_item_total
11 * - original_item_subtotal
12 * - original_item_tax_total
13 * - item_total
14 * - item_subtotal
15 * - item_tax_total
16 * - original_total
17 * - original_subtotal
18 * - original_tax_total
19 * - total
20 * - subtotal
21 * - tax_total
22 * - discount_total
23 * - discount_tax_total
24 * - gift_card_total
25 * - gift_card_tax_total
26 * - shipping_total
27 * - shipping_subtotal
28 * - shipping_tax_total
29 * - original_shipping_total
30 * - original_shipping_subtotal
31 * - original_shipping_tax_total
32 * properties:
33 * id:
34 * type: string
35 * title: id
36 * description: The cart's ID.
37 * region:
38 * $ref: "#/components/schemas/StoreRegion"
39 * region_id:
40 * type: string
41 * title: region_id
42 * description: The ID of the region the cart belongs to.
43 * customer_id:
44 * type: string
45 * title: customer_id
46 * description: The ID of the customer the cart belongs to.
47 * sales_channel_id:
48 * type: string
49 * title: sales_channel_id
50 * description: |
51 * The ID of the cart's sales channel. The created order is associated with the same sales channel.
52 *
53 * A product's availability in a sales channel only filters the products you retrieve. Medusa doesn't reject a variant added to the cart when its product isn't available in the cart's sales channel. Refer to the guide in the external documentation to learn how to enforce that validation.
54 * externalDocs:
55 * url: https://docs.medusajs.com/resources/commerce-modules/cart/sales-channel-availability
56 * email:
57 * type: string
58 * title: email
59 * description: The email of the customer the cart belongs to.
60 * format: email
61 * currency_code:
62 * type: string
63 * title: currency_code
64 * description: The cart's currency code.
65 * example: usd
66 * shipping_address:
67 * $ref: "#/components/schemas/StoreCartAddress"
68 * billing_address:
69 * $ref: "#/components/schemas/StoreCartAddress"
70 * items:
71 * type: array
72 * description: The cart's items.
73 * items:
74 * $ref: "#/components/schemas/StoreCartLineItem"
75 * shipping_methods:
76 * type: array
77 * description: The cart's shipping methods.
78 * items:
79 * $ref: "#/components/schemas/StoreCartShippingMethod"
80 * payment_collection:
81 * $ref: "#/components/schemas/StorePaymentCollection"
82 * metadata:
83 * type: object
84 * description: The cart's metadata, can hold custom key-value pairs.
85 * externalDocs:
86 * url: https://docs.medusajs.com/api/store#manage-metadata
87 * description: Learn how to manage metadata
88 * created_at:
89 * type: string
90 * format: date-time
91 * title: created_at
92 * description: The date the cart was created.
93 * updated_at:
94 * type: string
95 * format: date-time
96 * title: updated_at
97 * description: The date the cart was updated.
98 * original_item_total:
99 * type: number
100 * title: original_item_total
101 * description: The sum of all line items' original totals before discounts, including taxes.
102 * original_item_subtotal:
103 * type: number
104 * title: original_item_subtotal
105 * description: The sum of all line items' original subtotals before discounts, excluding taxes.
106 * original_item_tax_total:
107 * type: number
108 * title: original_item_tax_total
109 * description: The sum of all line items' original tax totals before discounts.
110 * item_total:
111 * type: number
112 * title: item_total
113 * description: The sum of all line items' totals after discounts, including taxes.
114 * item_subtotal:
115 * type: number
116 * title: item_subtotal
117 * description: The sum of all line items' subtotals before discounts, excluding taxes.
118 * item_tax_total:
119 * type: number
120 * title: item_tax_total
121 * description: The sum of all line items' tax totals after discounts.
122 * original_total:
123 * type: number
124 * title: original_total
125 * description: The cart's total before discounts, including taxes. Calculated as the sum of `original_item_total` and `original_shipping_total`.
126 * original_subtotal:
127 * type: number
128 * title: original_subtotal
129 * description: The cart's subtotal before discounts, excluding taxes. Calculated as the sum of `original_item_subtotal` and `original_shipping_subtotal`.
130 * original_tax_total:
131 * type: number
132 * title: original_tax_total
133 * description: The cart's tax total before discounts. Calculated as the sum of `original_item_tax_total` and `original_shipping_tax_total`.
134 * total:
135 * type: number
136 * title: total
137 * description: The cart's final total after discounts and credit lines, including taxes.
138 * subtotal:
139 * type: number
140 * title: subtotal
141 * description: The cart's subtotal before discounts, excluding taxes. Calculated as the sum of `item_subtotal` and `shipping_subtotal`.
142 * tax_total:
143 * type: number
144 * title: tax_total
145 * description: The cart's tax total after discounts. Calculated as the sum of `item_tax_total` and `shipping_tax_total`.
146 * discount_total:
147 * type: number
148 * title: discount_total
149 * description: The total amount of discounts applied to the cart, including the tax portion of discounts.
150 * discount_tax_total:
151 * type: number
152 * title: discount_tax_total
153 * description: The total amount of discounts applied to the cart's tax. Represents the tax portion of discounts.
154 * gift_card_total:
155 * type: number
156 * title: gift_card_total
157 * description: The total gift card amount applied on the cart.
158 * gift_card_tax_total:
159 * type: number
160 * title: gift_card_tax_total
161 * description: The total taxes applied on the gift card amount.
162 * shipping_total:
163 * type: number
164 * title: shipping_total
165 * description: The sum of all shipping methods' totals after discounts, including taxes.
166 * shipping_subtotal:
167 * type: number
168 * title: shipping_subtotal
169 * description: The sum of all shipping methods' subtotals before discounts, excluding taxes.
170 * shipping_tax_total:
171 * type: number
172 * title: shipping_tax_total
173 * description: The sum of all shipping methods' tax totals after discounts.
174 * original_shipping_total:
175 * type: number
176 * title: original_shipping_total
177 * description: The sum of all shipping methods' original totals before discounts, including taxes.
178 * original_shipping_subtotal:
179 * type: number
180 * title: original_shipping_subtotal
181 * description: The sum of all shipping methods' original subtotals before discounts, excluding taxes.
182 * original_shipping_tax_total:
183 * type: number
184 * title: original_shipping_tax_total
185 * description: The sum of all shipping methods' original tax totals before discounts.
186 * promotions:
187 * type: array
188 * description: The cart's promotions.
189 * items:
190 * $ref: "#/components/schemas/StoreCartPromotion"
191 * completed_at:
192 * type: string
193 * title: completed_at
194 * description: The date the cart was completed.
195 * format: date-time
196 *
197 */
198