Interface CartAddCustomLineItemAction

All Superinterfaces:
CartUpdateAction, CustomizableDraft<CartAddCustomLineItemAction>, ResourceUpdateAction<CartUpdateAction>
All Known Implementing Classes:
CartAddCustomLineItemActionImpl

If the Cart already contains a CustomLineItem with the same slug, name, money, taxCategory, state, and Custom Fields, then only the quantity of the existing Custom Line Item is increased. If CustomLineItem shippingDetails are set, they are merged with the targets that already exist on the ItemShippingDetails of the Custom Line Item. In case of overlapping address keys the ItemShippingTarget quantity is summed up.

If the Cart already contains a Custom Line Item with the same slug that is otherwise not identical, an InvalidOperation error is returned.

If the Tax Rate is not set, a MissingTaxRateForCountry error is returned.


Example to create an instance using the builder pattern

     CartAddCustomLineItemAction cartAddCustomLineItemAction = CartAddCustomLineItemAction.builder()
             .money(moneyBuilder -> moneyBuilder)
             .name(nameBuilder -> nameBuilder)
             .slug("{slug}")
             .build()