Interface MyCartDraft

All Superinterfaces:
CustomizableDraft<MyCartDraft>, io.vrap.rmf.base.client.Draft<MyCartDraft>
All Known Implementing Classes:
MyCartDraftImpl

public interface MyCartDraft extends CustomizableDraft<MyCartDraft>, io.vrap.rmf.base.client.Draft<MyCartDraft>

The customerId is determined by a password flow token and automatically set on the resulting Cart. The anonymousId is determined by a token for an anonymous session and automatically set on the resulting Cart.


Example to create an instance using the builder pattern

     MyCartDraft myCartDraft = MyCartDraft.builder()
             .currency("{currency}")
             .build()
 
  • Method Details

    • getCurrency

      @NotNull @NotNull String getCurrency()

      Currency the Cart uses.

      Returns:
      currency
    • getCustomerEmail

      Email address of the Customer the Cart belongs to.

      Returns:
      customerEmail
    • getBusinessUnit

      ResourceIdentifier to the Business Unit the Cart should belong to. The Customer must be an Associate of the Business Unit.

      Returns:
      businessUnit
    • getStore

      ResourceIdentifier to the Store the Cart should belong to. Once set, it cannot be updated.

      Returns:
      store
    • getLineItems

      Line Items to add to the Cart.

      Returns:
      lineItems
    • getTaxMode

      Determines how Tax Rates are set. The Disabled TaxMode cannot be set.

      Returns:
      taxMode
    • getInventoryMode

      Determines how stock quantities are tracked for Line Items in the Cart.

      Returns:
      inventoryMode
    • getBillingAddress

      Billing address associated with the Cart.

      Returns:
      billingAddress
    • getShippingAddress

      Shipping address associated with the Cart. Determines eligible ShippingMethod rates and Tax Rates of Line Items.

      Returns:
      shippingAddress
    • getShippingMethod

      Shipping Method for the Cart. If the referenced ShippingMethod has a predicate that does not match the Cart, an InvalidOperation error is returned when creating a Cart.

      Returns:
      shippingMethod
    • getItemShippingAddresses

      Multiple shipping addresses of the Cart. Each address must contain a key that is unique in this Cart. The keys are used by LineItems to reference these addresses under their shippingDetails.

      Eligible Shipping Methods or applicable Tax Rates are determined by the Cart shippingAddress, and not itemShippingAddresses.

      Returns:
      itemShippingAddresses
    • getDiscountCodes

      code of the existing DiscountCodes to add to the Cart.

      Returns:
      discountCodes
    • getCountry

      Used for LineItem Price selection. If used for Create Cart in Store, the provided country must be one of the Store's countries.

      Returns:
      country
    • getLocale

      Languages of the Cart. Can only contain languages supported by the Project.

      Returns:
      locale
    • getDeleteDaysAfterLastModification

      Number of days after which a Cart with Active CartState is deleted since its last modification. If not provided, the default value for this field configured in Project settings is assigned.

      Create a ChangeSubscription for Carts to receive a ResourceDeletedDeliveryPayload upon deletion of the Cart.

      Returns:
      deleteDaysAfterLastModification
    • getCustom

      @Valid @Valid CustomFieldsDraft getCustom()

      Custom Fields for the Cart.

      Specified by:
      getCustom in interface CustomizableDraft<MyCartDraft>
      Returns:
      custom
    • setCurrency

      void setCurrency(String currency)

      Currency the Cart uses.

      Parameters:
      currency - value to be set
    • setCustomerEmail

      void setCustomerEmail(String customerEmail)

      Email address of the Customer the Cart belongs to.

      Parameters:
      customerEmail - value to be set
    • setBusinessUnit

      ResourceIdentifier to the Business Unit the Cart should belong to. The Customer must be an Associate of the Business Unit.

      Parameters:
      businessUnit - value to be set
    • setStore

      ResourceIdentifier to the Store the Cart should belong to. Once set, it cannot be updated.

      Parameters:
      store - value to be set
    • setLineItems

      void setLineItems(MyLineItemDraft... lineItems)

      Line Items to add to the Cart.

      Parameters:
      lineItems - values to be set
    • setLineItems

      void setLineItems(List<MyLineItemDraft> lineItems)

      Line Items to add to the Cart.

      Parameters:
      lineItems - values to be set
    • setTaxMode

      void setTaxMode(TaxMode taxMode)

      Determines how Tax Rates are set. The Disabled TaxMode cannot be set.

      Parameters:
      taxMode - value to be set
    • setInventoryMode

      void setInventoryMode(InventoryMode inventoryMode)

      Determines how stock quantities are tracked for Line Items in the Cart.

      Parameters:
      inventoryMode - value to be set
    • setBillingAddress

      void setBillingAddress(BaseAddress billingAddress)

      Billing address associated with the Cart.

      Parameters:
      billingAddress - value to be set
    • setShippingAddress

      void setShippingAddress(BaseAddress shippingAddress)

      Shipping address associated with the Cart. Determines eligible ShippingMethod rates and Tax Rates of Line Items.

      Parameters:
      shippingAddress - value to be set
    • setShippingMethod

      Shipping Method for the Cart. If the referenced ShippingMethod has a predicate that does not match the Cart, an InvalidOperation error is returned when creating a Cart.

      Parameters:
      shippingMethod - value to be set
    • setItemShippingAddresses

      void setItemShippingAddresses(BaseAddress... itemShippingAddresses)

      Multiple shipping addresses of the Cart. Each address must contain a key that is unique in this Cart. The keys are used by LineItems to reference these addresses under their shippingDetails.

      Eligible Shipping Methods or applicable Tax Rates are determined by the Cart shippingAddress, and not itemShippingAddresses.

      Parameters:
      itemShippingAddresses - values to be set
    • setItemShippingAddresses

      void setItemShippingAddresses(List<BaseAddress> itemShippingAddresses)

      Multiple shipping addresses of the Cart. Each address must contain a key that is unique in this Cart. The keys are used by LineItems to reference these addresses under their shippingDetails.

      Eligible Shipping Methods or applicable Tax Rates are determined by the Cart shippingAddress, and not itemShippingAddresses.

      Parameters:
      itemShippingAddresses - values to be set
    • setDiscountCodes

      void setDiscountCodes(String... discountCodes)

      code of the existing DiscountCodes to add to the Cart.

      Parameters:
      discountCodes - values to be set
    • setDiscountCodes

      void setDiscountCodes(List<String> discountCodes)

      code of the existing DiscountCodes to add to the Cart.

      Parameters:
      discountCodes - values to be set
    • setCountry

      void setCountry(String country)

      Used for LineItem Price selection. If used for Create Cart in Store, the provided country must be one of the Store's countries.

      Parameters:
      country - value to be set
    • setLocale

      void setLocale(String locale)

      Languages of the Cart. Can only contain languages supported by the Project.

      Parameters:
      locale - value to be set
    • setDeleteDaysAfterLastModification

      void setDeleteDaysAfterLastModification(Long deleteDaysAfterLastModification)

      Number of days after which a Cart with Active CartState is deleted since its last modification. If not provided, the default value for this field configured in Project settings is assigned.

      Create a ChangeSubscription for Carts to receive a ResourceDeletedDeliveryPayload upon deletion of the Cart.

      Parameters:
      deleteDaysAfterLastModification - value to be set
    • setCustom

      Custom Fields for the Cart.

      Specified by:
      setCustom in interface CustomizableDraft<MyCartDraft>
      Parameters:
      custom - value to be set
    • of

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

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

      factory method to create a deep copy of MyCartDraft
      Parameters:
      template - instance to be copied
      Returns:
      copy instance
    • builder

      builder factory method for MyCartDraft
      Returns:
      builder
    • builder

      create builder for MyCartDraft instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder
    • withMyCartDraft

      default <T> T withMyCartDraft(Function<MyCartDraft,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<MyCartDraft> typeReference()
      gives a TypeReference for usage with Jackson DataBind
      Returns:
      TypeReference