@@ -15,6 +15,7 @@ import { Address } from './address'
1515import { Price , FormattedPrice } from './price'
1616import { Order } from './order'
1717import { PcmProductResponse } from './pcm'
18+ import { Promotion } from './promotions'
1819
1920export interface CheckoutCustomer {
2021 id : string
@@ -58,6 +59,7 @@ export interface Cart {
5859 links ?: { }
5960 meta ?: {
6061 display_price ?: {
62+ discount ?: FormattedPrice
6163 with_tax ?: FormattedPrice
6264 without_tax ?: FormattedPrice
6365 tax ?: FormattedPrice
@@ -165,6 +167,11 @@ export interface BulkAddOptions {
165167 add_all_or_nothing : boolean
166168}
167169
170+ export type AddProductsItem = {
171+ quantity ?: number
172+ [ key : string ] : any
173+ } & ( { id : string ; sku ?: never } | { sku : string ; id ?: never } )
174+
168175export interface BulkCustomDiscountOptions {
169176 add_all_or_nothing : boolean
170177}
@@ -199,7 +206,7 @@ export interface CartTaxItemObject {
199206 }
200207}
201208
202- export type CartInclude = 'items' | 'tax_items'
209+ export type CartInclude = 'items' | 'tax_items' | 'promotions'
203210
204211interface CartQueryableResource < R , F , S >
205212 extends QueryableResource < Cart , F , S , CartInclude > {
@@ -208,6 +215,7 @@ interface CartQueryableResource<R, F, S>
208215
209216export interface CartIncluded {
210217 items : CartItem [ ]
218+ promotions : Promotion [ ]
211219}
212220
213221export interface CartAdditionalHeaders {
@@ -385,6 +393,21 @@ export interface CartEndpoint
385393 additionalHeaders ?: CartAdditionalHeaders
386394 ) : Promise < CartItemsResponse >
387395
396+ /**
397+ * Add Multiple Products to Cart
398+ * Description: Add multiple products to cart in a single request. Each product can be identified by either ID or SKU.
399+ * @param products Array of products to add, each with either an id or sku field
400+ * @param options Optional bulk add options
401+ * @param token Optional customer token
402+ * @param additionalHeaders Optional additional headers
403+ */
404+ AddProducts (
405+ products : AddProductsItem [ ] ,
406+ options ?: BulkAddOptions ,
407+ token ?: string ,
408+ additionalHeaders ?: CartAdditionalHeaders
409+ ) : Promise < CartItemsResponse >
410+
388411 RemoveAllItems ( ) : Promise < CartItemsResponse >
389412
390413 /**
@@ -418,6 +441,14 @@ export interface CartEndpoint
418441 */
419442 AddPromotion ( code : string ) : Promise < CartItemsResponse >
420443
444+ /**
445+ * Remove promotion from Cart
446+ * Description: Removes a manually applied promotion code from a cart. Does not work if the promotion is applied automatically.
447+ * DOCS: https://developer.elasticpath.com/docs/api/carts/delete-a-promotion-via-promotion-code
448+ * @param promoCode the promotion code to remove.
449+ */
450+ RemovePromotion ( promoCode : string ) : Promise < { } >
451+
421452 /**
422453 * Bulk Update Items to Cart
423454 * Description: When you enable the bulk update feature, a shopper can update an array of items to their cart in one action, rather than updating each item one at a time.
0 commit comments