@@ -30,19 +30,17 @@ export interface CartApiContent {
30
30
subscribable : RemoteSubscribable < Cart > ;
31
31
32
32
/** Bulk update the cart
33
+ *
33
34
* @param cartState the cart state to set
34
35
* @returns the updated cart
35
- *
36
- * @throws CartNotEditableError if the cart is not currently editable.
37
36
*/
38
37
bulkCartUpdate ( cartState : CartUpdateInput ) : Promise < Cart > ;
39
38
40
39
/** Apply a cart level discount
40
+ *
41
41
* @param type the type of discount applied (example: 'Percentage')
42
42
* @param title the title attributed with the discount
43
43
* @param amount the percentage or fixed monetary amount deducted with the discount. Pass in `undefined` if using discount codes.
44
- *
45
- * @throws CartNotEditableError if the cart is not currently editable.
46
44
*/
47
45
applyCartDiscount (
48
46
type : CartDiscountType ,
@@ -52,98 +50,83 @@ export interface CartApiContent {
52
50
53
51
/**
54
52
* Add a code discount to the cart
55
- * @param code the code for the discount to add to the cart
56
53
*
57
- * @throws CartNotEditableError if the cart is not currently editable.
54
+ * @param code the code for the discount to add to the cart
58
55
*/
59
56
addCartCodeDiscount ( code : string ) : Promise < void > ;
60
57
61
58
/**
62
59
* Remove the cart discount
63
- *
64
- * @throws CartNotEditableError if the cart is not currently editable.
65
60
*/
66
61
removeCartDiscount ( ) : Promise < void > ;
67
62
68
63
/**
69
64
* Remove all cart and line item discounts
70
- * @param disableAutomaticDiscounts Whether or not automatic discounts should be enabled after removing the discounts.
71
65
*
72
- * @throws CartNotEditableError if the cart is not currently editable .
66
+ * @param disableAutomaticDiscounts Whether or not automatic discounts should be enabled after removing the discounts .
73
67
*/
74
68
removeAllDiscounts ( disableAutomaticDiscounts : boolean ) : Promise < void > ;
75
69
76
70
/**
77
71
* Clear the cart
78
- *
79
- * @throws CartNotEditableError if the cart is not currently editable.
80
72
*/
81
73
clearCart ( ) : Promise < void > ;
82
74
83
75
/**
84
76
* Set the customer in the cart
85
- * @param customer the customer object to add to the cart
86
77
*
87
- * @throws CartNotEditableError if the cart is not currently editable.
78
+ * @param customer the customer object to add to the cart
88
79
*/
89
80
setCustomer ( customer : Customer ) : Promise < void > ;
90
81
91
82
/**
92
83
* Remove the current customer from the cart
93
- *
94
- * @throws CartNotEditableError if the cart is not currently editable.
95
84
*/
96
85
removeCustomer ( ) : Promise < void > ;
97
86
98
87
/**
99
88
* Add a custom sale to the cart
89
+ *
100
90
* @param customSale the custom sale object to add to the cart
101
91
* @returns {string } the uuid of the line item added
102
- *
103
- * @throws CartNotEditableError if the cart is not currently editable.
104
92
*/
105
93
addCustomSale ( customSale : CustomSale ) : Promise < string > ;
106
94
107
95
/**
108
96
* Add a line item by variant ID to the cart
97
+ *
109
98
* @param variantId the product variant's numeric ID to add to the cart
110
99
* @param quantity the number of this variant to add to the cart
111
100
* @returns {string } the uuid of the line item added
112
- *
113
- * @throws CartNotEditableError if the cart is not currently editable.
114
101
*/
115
102
addLineItem ( variantId : number , quantity : number ) : Promise < string > ;
116
103
117
104
/**
118
105
* Remove the line item at this uuid from the cart
119
- * @param uuid the uuid of the line item that should be removed
120
106
*
121
- * @throws CartNotEditableError if the cart is not currently editable.
107
+ * @param uuid the uuid of the line item that should be removed
122
108
*/
123
109
removeLineItem ( uuid : string ) : Promise < void > ;
124
110
125
111
/**
126
112
* Adds custom properties to the cart
127
- * @param properties the custom key to value object to attribute to the cart
128
113
*
129
- * @throws CartNotEditableError if the cart is not currently editable.
114
+ * @param properties the custom key to value object to attribute to the cart
130
115
*/
131
116
addCartProperties ( properties : Record < string , string > ) : Promise < void > ;
132
117
133
118
/**
134
119
* Removes the specified cart properties
135
- * @param keys the collection of keys to be removed from the cart properties
136
120
*
137
- * @throws CartNotEditableError if the cart is not currently editable.
121
+ * @param keys the collection of keys to be removed from the cart properties
138
122
*/
139
123
removeCartProperties ( keys : string [ ] ) : Promise < void > ;
140
124
141
125
/**
142
126
* Adds custom properties to the specified line item
127
+ *
143
128
* @param uuid the uuid of the line item to which the properties should be stringd
144
129
* @param properties the custom key to value object to attribute to the line item
145
- *
146
- * @throws CartNotEditableError if the cart is not currently editable.
147
130
*/
148
131
addLineItemProperties (
149
132
uuid : string ,
@@ -152,31 +135,28 @@ export interface CartApiContent {
152
135
153
136
/**
154
137
* Adds custom properties to multiple line items at the same time.
155
- * @param lineItemProperties the collection of custom line item properties to apply to their respective line items.
156
138
*
157
- * @throws CartNotEditableError if the cart is not currently editable .
139
+ * @param lineItemProperties the collection of custom line item properties to apply to their respective line items .
158
140
*/
159
141
bulkAddLineItemProperties (
160
142
lineItemProperties : SetLineItemPropertiesInput [ ] ,
161
143
) : Promise < void > ;
162
144
163
145
/**
164
146
* Removes the specified line item properties
147
+ *
165
148
* @param uuid the uuid of the line item to which the properties should be removed
166
149
* @param keys the collection of keys to be removed from the line item properties
167
- *
168
- * @throws CartNotEditableError if the cart is not currently editable.
169
150
*/
170
151
removeLineItemProperties ( uuid : string , keys : string [ ] ) : Promise < void > ;
171
152
172
153
/**
173
154
* Add a discount on a line item to the cart
155
+ *
174
156
* @param uuid the uuid of the line item that should receive a discount
175
157
* @param type the type of discount applied (example: 'Percentage')
176
158
* @param title the title attributed with the discount
177
159
* @param amount the percentage or fixed monetary amount deducted with the discout
178
- *
179
- * @throws CartNotEditableError if the cart is not currently editable.
180
160
*/
181
161
setLineItemDiscount (
182
162
uuid : string ,
@@ -187,28 +167,25 @@ export interface CartApiContent {
187
167
188
168
/**
189
169
* Set line item discounts to multiple line items at the same time.
190
- * @param lineItemDiscounts a map of discounts to add. They key is the uuid of the line item you want to add the discount to. The value is the discount input.
191
170
*
192
- * @throws CartNotEditableError if the cart is not currently editable .
171
+ * @param lineItemDiscounts a map of discounts to add. They key is the uuid of the line item you want to add the discount to. The value is the discount input .
193
172
*/
194
173
bulkSetLineItemDiscounts (
195
174
lineItemDiscounts : SetLineItemDiscountInput [ ] ,
196
175
) : Promise < void > ;
197
176
198
177
/**
199
178
* Sets an attributed staff to all line items in the cart.
200
- * @param staffId the ID of the staff. Providing undefined will clear the attributed staff from all line items.
201
179
*
202
- * @throws CartNotEditableError if the cart is not currently editable .
180
+ * @param staffId the ID of the staff. Providing undefined will clear the attributed staff from all line items .
203
181
*/
204
182
setAttributedStaff ( staffId : number | undefined ) : Promise < void > ;
205
183
206
184
/**
207
185
* Sets an attributed staff to a specific line items in the cart.
186
+ *
208
187
* @param staffId the ID of the staff. Providing undefined will clear the attributed staff on the line item.
209
188
* @param lineItemUuid the UUID of the line item.
210
- *
211
- * @throws CartNotEditableError if the cart is not currently editable.
212
189
*/
213
190
setAttributedStaffToLineItem (
214
191
staffId : number | undefined ,
@@ -217,33 +194,29 @@ export interface CartApiContent {
217
194
218
195
/**
219
196
* Remove all discounts from a line item
220
- * @param uuid the uuid of the line item whose discounts should be removed
221
197
*
222
- * @throws CartNotEditableError if the cart is not currently editable.
198
+ * @param uuid the uuid of the line item whose discounts should be removed
223
199
*/
224
200
removeLineItemDiscount ( uuid : string ) : Promise < void > ;
225
201
226
202
/**
227
203
* Add an address to the customer (Customer must be present)
228
- * @param address the address object to add to the customer in cart
229
204
*
230
- * @throws CartNotEditableError if the cart is not currently editable.
205
+ * @param address the address object to add to the customer in cart
231
206
*/
232
207
addAddress ( address : Address ) : Promise < void > ;
233
208
234
209
/**
235
210
* Delete an address from the customer (Customer must be present)
236
- * @param addressId the address ID to delete
237
211
*
238
- * @throws CartNotEditableError if the cart is not currently editable.
212
+ * @param addressId the address ID to delete
239
213
*/
240
214
deleteAddress ( addressId : number ) : Promise < void > ;
241
215
242
216
/**
243
217
* Update the default address for the customer (Customer must be present)
244
- * @param addressId the address ID to set as the default address
245
218
*
246
- * @throws CartNotEditableError if the cart is not currently editable.
219
+ * @param addressId the address ID to set as the default address
247
220
*/
248
221
updateDefaultAddress ( addressId : number ) : Promise < void > ;
249
222
}
0 commit comments