Interface MergeCartDraft

All Superinterfaces:
Draft<MergeCartDraft>

public interface MergeCartDraft extends Draft<MergeCartDraft>

Used for merging an anonymous Cart with a Customer Cart with the Merge Cart and Merge Cart in Store endpoints. Either anonymousCart or anonymousId is required.


Example to create an instance using the builder pattern

     MergeCartDraft mergeCartDraft = MergeCartDraft.builder()
             .build()
 
  • Method Details

    • getAnonymousCart

      @Valid @Valid CartResourceIdentifier getAnonymousCart()

      ResourceIdentifier to the anonymous Cart to be merged. Required if anonymousId is not provided.

      Returns:
      anonymousCart
    • getMergeMode

      CartMergeMode getMergeMode()

      Determines how to merge the anonymous Cart with the existing Customer Cart.

      Returns:
      mergeMode
    • getUpdateProductData

      Boolean getUpdateProductData()
      • If true, the LineItem Product data (name, variant, and productType) of the returned Cart will be updated.
      • If false, only the prices, discounts, and tax rates will be updated.
      Returns:
      updateProductData
    • getAnonymousId

      String getAnonymousId()

      Assigns the Customer to the Carts that have the same anonymousId. Required if anonymousCart is not provided. If both anonymousCart and anonymousId are provided, this value must match the anonymousId of the anonymous Cart otherwise, an InvalidOperation error is returned.

      Returns:
      anonymousId
    • setAnonymousCart

      void setAnonymousCart(CartResourceIdentifier anonymousCart)

      ResourceIdentifier to the anonymous Cart to be merged. Required if anonymousId is not provided.

      Parameters:
      anonymousCart - value to be set
    • setMergeMode

      void setMergeMode(CartMergeMode mergeMode)

      Determines how to merge the anonymous Cart with the existing Customer Cart.

      Parameters:
      mergeMode - value to be set
    • setUpdateProductData

      void setUpdateProductData(Boolean updateProductData)
      • If true, the LineItem Product data (name, variant, and productType) of the returned Cart will be updated.
      • If false, only the prices, discounts, and tax rates will be updated.
      Parameters:
      updateProductData - value to be set
    • setAnonymousId

      void setAnonymousId(String anonymousId)

      Assigns the Customer to the Carts that have the same anonymousId. Required if anonymousCart is not provided. If both anonymousCart and anonymousId are provided, this value must match the anonymousId of the anonymous Cart otherwise, an InvalidOperation error is returned.

      Parameters:
      anonymousId - value to be set
    • of

      static MergeCartDraft of()
      factory method
      Returns:
      instance of MergeCartDraft
    • of

      static MergeCartDraft of(MergeCartDraft template)
      factory method to create a shallow copy MergeCartDraft
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • copyDeep

      MergeCartDraft copyDeep()
    • deepCopy

      @Nullable static MergeCartDraft deepCopy(@Nullable MergeCartDraft template)
      factory method to create a deep copy of MergeCartDraft
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      static MergeCartDraftBuilder builder()
      builder factory method for MergeCartDraft
      Returns:
      builder
    • builder

      static MergeCartDraftBuilder builder(MergeCartDraft template)
      create builder for MergeCartDraft instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withMergeCartDraft

      default <T> T withMergeCartDraft(Function<MergeCartDraft,T> helper)
      accessor map function
      Type Parameters:
      T - mapped type
      Parameters:
      helper - function to map the object
      Returns:
      mapped value
    • typeReference

      static com.fasterxml.jackson.core.type.TypeReference<MergeCartDraft> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference