Class CartDraftBuilder

java.lang.Object
com.commercetools.api.models.cart.CartDraftBuilder
All Implemented Interfaces:
Builder<CartDraft>

public class CartDraftBuilder extends Object implements Builder<CartDraft>
CartDraftBuilder
Example to create an instance using the builder pattern

     CartDraft cartDraft = CartDraft.builder()
             .currency("{currency}")
             .build()
 
  • Constructor Details

    • CartDraftBuilder

      public CartDraftBuilder()
  • Method Details

    • currency

      public CartDraftBuilder currency(String currency)

      Currency the Cart uses.

      Parameters:
      currency - value to be set
      Returns:
      Builder
    • key

      public CartDraftBuilder key(@Nullable String key)

      User-defined unique identifier for the Cart.

      Parameters:
      key - value to be set
      Returns:
      Builder
    • customerId

      public CartDraftBuilder customerId(@Nullable String customerId)

      id of the Customer that the Cart belongs to.

      Parameters:
      customerId - value to be set
      Returns:
      Builder
    • customerEmail

      public CartDraftBuilder customerEmail(@Nullable String customerEmail)

      Email address of the Customer that the Cart belongs to.

      Parameters:
      customerEmail - value to be set
      Returns:
      Builder
    • customerGroup

      ResourceIdentifier to the Customer Group of the Customer that the Cart belongs to. Used for Line Item price selection.

      It is automatically set if the Customer referenced in customerId belongs to a Customer Group. It can also be set explicitly when no customerId is present.

      Parameters:
      builder - function to build the customerGroup value
      Returns:
      Builder
    • withCustomerGroup

      ResourceIdentifier to the Customer Group of the Customer that the Cart belongs to. Used for Line Item price selection.

      It is automatically set if the Customer referenced in customerId belongs to a Customer Group. It can also be set explicitly when no customerId is present.

      Parameters:
      builder - function to build the customerGroup value
      Returns:
      Builder
    • customerGroup

      public CartDraftBuilder customerGroup(@Nullable CustomerGroupResourceIdentifier customerGroup)

      ResourceIdentifier to the Customer Group of the Customer that the Cart belongs to. Used for Line Item price selection.

      It is automatically set if the Customer referenced in customerId belongs to a Customer Group. It can also be set explicitly when no customerId is present.

      Parameters:
      customerGroup - value to be set
      Returns:
      Builder
    • anonymousId

      public CartDraftBuilder anonymousId(@Nullable String anonymousId)

      Anonymous session associated with the Cart.

      Parameters:
      anonymousId - value to be set
      Returns:
      Builder
    • businessUnit

      ResourceIdentifier to the Business Unit the Cart should belong to. When the customerId of the Cart is also set, the Customer must be an Associate of the Business Unit.

      Parameters:
      builder - function to build the businessUnit value
      Returns:
      Builder
    • withBusinessUnit

      ResourceIdentifier to the Business Unit the Cart should belong to. When the customerId of the Cart is also set, the Customer must be an Associate of the Business Unit.

      Parameters:
      builder - function to build the businessUnit value
      Returns:
      Builder
    • businessUnit

      public CartDraftBuilder businessUnit(@Nullable BusinessUnitResourceIdentifier businessUnit)

      ResourceIdentifier to the Business Unit the Cart should belong to. When the customerId of the Cart is also set, the Customer must be an Associate of the Business Unit.

      Parameters:
      businessUnit - value to be set
      Returns:
      Builder
    • store

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

      Parameters:
      builder - function to build the store value
      Returns:
      Builder
    • withStore

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

      Parameters:
      builder - function to build the store value
      Returns:
      Builder
    • store

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

      Parameters:
      store - value to be set
      Returns:
      Builder
    • lineItems

      public CartDraftBuilder lineItems(@Nullable LineItemDraft... lineItems)

      Line Items to add to the Cart.

      Parameters:
      lineItems - value to be set
      Returns:
      Builder
    • lineItems

      public CartDraftBuilder lineItems(@Nullable List<LineItemDraft> lineItems)

      Line Items to add to the Cart.

      Parameters:
      lineItems - value to be set
      Returns:
      Builder
    • plusLineItems

      public CartDraftBuilder plusLineItems(@Nullable LineItemDraft... lineItems)

      Line Items to add to the Cart.

      Parameters:
      lineItems - value to be set
      Returns:
      Builder
    • plusLineItems

      Line Items to add to the Cart.

      Parameters:
      builder - function to build the lineItems value
      Returns:
      Builder
    • withLineItems

      Line Items to add to the Cart.

      Parameters:
      builder - function to build the lineItems value
      Returns:
      Builder
    • addLineItems

      Line Items to add to the Cart.

      Parameters:
      builder - function to build the lineItems value
      Returns:
      Builder
    • setLineItems

      Line Items to add to the Cart.

      Parameters:
      builder - function to build the lineItems value
      Returns:
      Builder
    • customLineItems

      public CartDraftBuilder customLineItems(@Nullable CustomLineItemDraft... customLineItems)

      Custom Line Items to add to the Cart.

      Parameters:
      customLineItems - value to be set
      Returns:
      Builder
    • customLineItems

      public CartDraftBuilder customLineItems(@Nullable List<CustomLineItemDraft> customLineItems)

      Custom Line Items to add to the Cart.

      Parameters:
      customLineItems - value to be set
      Returns:
      Builder
    • plusCustomLineItems

      public CartDraftBuilder plusCustomLineItems(@Nullable CustomLineItemDraft... customLineItems)

      Custom Line Items to add to the Cart.

      Parameters:
      customLineItems - value to be set
      Returns:
      Builder
    • plusCustomLineItems

      Custom Line Items to add to the Cart.

      Parameters:
      builder - function to build the customLineItems value
      Returns:
      Builder
    • withCustomLineItems

      Custom Line Items to add to the Cart.

      Parameters:
      builder - function to build the customLineItems value
      Returns:
      Builder
    • addCustomLineItems

      Custom Line Items to add to the Cart.

      Parameters:
      builder - function to build the customLineItems value
      Returns:
      Builder
    • setCustomLineItems

      Custom Line Items to add to the Cart.

      Parameters:
      builder - function to build the customLineItems value
      Returns:
      Builder
    • taxMode

      public CartDraftBuilder taxMode(@Nullable TaxMode taxMode)

      Determines how Tax Rates are set.

      Parameters:
      taxMode - value to be set
      Returns:
      Builder
    • externalTaxRateForShippingMethod

      public CartDraftBuilder externalTaxRateForShippingMethod(Function<ExternalTaxRateDraftBuilder,ExternalTaxRateDraftBuilder> builder)

      External Tax Rate for the shippingMethod if the Cart has External TaxMode.

      Parameters:
      builder - function to build the externalTaxRateForShippingMethod value
      Returns:
      Builder
    • withExternalTaxRateForShippingMethod

      public CartDraftBuilder withExternalTaxRateForShippingMethod(Function<ExternalTaxRateDraftBuilder,ExternalTaxRateDraft> builder)

      External Tax Rate for the shippingMethod if the Cart has External TaxMode.

      Parameters:
      builder - function to build the externalTaxRateForShippingMethod value
      Returns:
      Builder
    • externalTaxRateForShippingMethod

      public CartDraftBuilder externalTaxRateForShippingMethod(@Nullable ExternalTaxRateDraft externalTaxRateForShippingMethod)

      External Tax Rate for the shippingMethod if the Cart has External TaxMode.

      Parameters:
      externalTaxRateForShippingMethod - value to be set
      Returns:
      Builder
    • taxRoundingMode

      public CartDraftBuilder taxRoundingMode(@Nullable RoundingMode taxRoundingMode)

      Determines how monetary values are rounded when calculating taxes for taxedPrice.

      Parameters:
      taxRoundingMode - value to be set
      Returns:
      Builder
    • taxCalculationMode

      public CartDraftBuilder taxCalculationMode(@Nullable TaxCalculationMode taxCalculationMode)

      Determines how taxes are calculated for taxedPrice.

      Parameters:
      taxCalculationMode - value to be set
      Returns:
      Builder
    • inventoryMode

      public CartDraftBuilder inventoryMode(@Nullable InventoryMode inventoryMode)

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

      Parameters:
      inventoryMode - value to be set
      Returns:
      Builder
    • billingAddress

      Billing address associated with the Cart.

      Parameters:
      builder - function to build the billingAddress value
      Returns:
      Builder
    • withBillingAddress

      public CartDraftBuilder withBillingAddress(Function<BaseAddressBuilder,BaseAddress> builder)

      Billing address associated with the Cart.

      Parameters:
      builder - function to build the billingAddress value
      Returns:
      Builder
    • billingAddress

      public CartDraftBuilder billingAddress(@Nullable BaseAddress billingAddress)

      Billing address associated with the Cart.

      Parameters:
      billingAddress - value to be set
      Returns:
      Builder
    • shippingAddress

      Shipping address for a Cart with Single ShippingMode. Determines eligible ShippingMethod rates and Tax Rates of Line Items. Must be one of the itemShippingAddresses when that field is also provided.

      Parameters:
      builder - function to build the shippingAddress value
      Returns:
      Builder
    • withShippingAddress

      public CartDraftBuilder withShippingAddress(Function<BaseAddressBuilder,BaseAddress> builder)

      Shipping address for a Cart with Single ShippingMode. Determines eligible ShippingMethod rates and Tax Rates of Line Items. Must be one of the itemShippingAddresses when that field is also provided.

      Parameters:
      builder - function to build the shippingAddress value
      Returns:
      Builder
    • shippingAddress

      public CartDraftBuilder shippingAddress(@Nullable BaseAddress shippingAddress)

      Shipping address for a Cart with Single ShippingMode. Determines eligible ShippingMethod rates and Tax Rates of Line Items. Must be one of the itemShippingAddresses when that field is also provided.

      Parameters:
      shippingAddress - value to be set
      Returns:
      Builder
    • shippingMethod

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

      Parameters:
      builder - function to build the shippingMethod value
      Returns:
      Builder
    • withShippingMethod

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

      Parameters:
      builder - function to build the shippingMethod value
      Returns:
      Builder
    • shippingMethod

      public CartDraftBuilder shippingMethod(@Nullable ShippingMethodResourceIdentifier shippingMethod)

      Shipping Method for a Cart with Single ShippingMode. 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
      Returns:
      Builder
    • shippingRateInput

      public CartDraftBuilder shippingRateInput(@Nullable ShippingRateInputDraft shippingRateInput)

      Used as an input to select a ShippingRatePriceTier. The data type of this field depends on the shippingRateInputType.type configured in the Project:

      • If CartClassification, it must be ClassificationShippingRateInputDraft.
      • If CartScore, it must be ScoreShippingRateInputDraft.
      • If CartValue, it cannot be set.
      Parameters:
      shippingRateInput - value to be set
      Returns:
      Builder
    • shippingRateInput

      Used as an input to select a ShippingRatePriceTier. The data type of this field depends on the shippingRateInputType.type configured in the Project:

      • If CartClassification, it must be ClassificationShippingRateInputDraft.
      • If CartScore, it must be ScoreShippingRateInputDraft.
      • If CartValue, it cannot be set.
      Parameters:
      builder - function to build the shippingRateInput value
      Returns:
      Builder
    • shippingMode

      public CartDraftBuilder shippingMode(@Nullable ShippingMode shippingMode)
      • If set to Single, only a single Shipping Method can be added to the Cart.
      • If set to Multiple, multiple Shipping Methods can be added to the Cart.
      Parameters:
      shippingMode - value to be set
      Returns:
      Builder
    • customShipping

      public CartDraftBuilder customShipping(@Nullable CustomShippingDraft... customShipping)

      Custom Shipping Methods for a Cart with Multiple ShippingMode.

      Parameters:
      customShipping - value to be set
      Returns:
      Builder
    • customShipping

      public CartDraftBuilder customShipping(@Nullable List<CustomShippingDraft> customShipping)

      Custom Shipping Methods for a Cart with Multiple ShippingMode.

      Parameters:
      customShipping - value to be set
      Returns:
      Builder
    • plusCustomShipping

      public CartDraftBuilder plusCustomShipping(@Nullable CustomShippingDraft... customShipping)

      Custom Shipping Methods for a Cart with Multiple ShippingMode.

      Parameters:
      customShipping - value to be set
      Returns:
      Builder
    • plusCustomShipping

      Custom Shipping Methods for a Cart with Multiple ShippingMode.

      Parameters:
      builder - function to build the customShipping value
      Returns:
      Builder
    • withCustomShipping

      Custom Shipping Methods for a Cart with Multiple ShippingMode.

      Parameters:
      builder - function to build the customShipping value
      Returns:
      Builder
    • addCustomShipping

      Custom Shipping Methods for a Cart with Multiple ShippingMode.

      Parameters:
      builder - function to build the customShipping value
      Returns:
      Builder
    • setCustomShipping

      Custom Shipping Methods for a Cart with Multiple ShippingMode.

      Parameters:
      builder - function to build the customShipping value
      Returns:
      Builder
    • shipping

      public CartDraftBuilder shipping(@Nullable ShippingDraft... shipping)

      Shipping Methods for a Cart with Multiple ShippingMode.

      Parameters:
      shipping - value to be set
      Returns:
      Builder
    • shipping

      public CartDraftBuilder shipping(@Nullable List<ShippingDraft> shipping)

      Shipping Methods for a Cart with Multiple ShippingMode.

      Parameters:
      shipping - value to be set
      Returns:
      Builder
    • plusShipping

      public CartDraftBuilder plusShipping(@Nullable ShippingDraft... shipping)

      Shipping Methods for a Cart with Multiple ShippingMode.

      Parameters:
      shipping - value to be set
      Returns:
      Builder
    • plusShipping

      Shipping Methods for a Cart with Multiple ShippingMode.

      Parameters:
      builder - function to build the shipping value
      Returns:
      Builder
    • withShipping

      Shipping Methods for a Cart with Multiple ShippingMode.

      Parameters:
      builder - function to build the shipping value
      Returns:
      Builder
    • addShipping

      Shipping Methods for a Cart with Multiple ShippingMode.

      Parameters:
      builder - function to build the shipping value
      Returns:
      Builder
    • setShipping

      Shipping Methods for a Cart with Multiple ShippingMode.

      Parameters:
      builder - function to build the shipping value
      Returns:
      Builder
    • itemShippingAddresses

      public CartDraftBuilder itemShippingAddresses(@Nullable 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.

      For Carts with Single ShippingMode: eligible Shipping Methods or applicable Tax Rates are determined by the address shippingAddress, and not itemShippingAddresses.

      Parameters:
      itemShippingAddresses - value to be set
      Returns:
      Builder
    • itemShippingAddresses

      public CartDraftBuilder itemShippingAddresses(@Nullable 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.

      For Carts with Single ShippingMode: eligible Shipping Methods or applicable Tax Rates are determined by the address shippingAddress, and not itemShippingAddresses.

      Parameters:
      itemShippingAddresses - value to be set
      Returns:
      Builder
    • plusItemShippingAddresses

      public CartDraftBuilder plusItemShippingAddresses(@Nullable 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.

      For Carts with Single ShippingMode: eligible Shipping Methods or applicable Tax Rates are determined by the address shippingAddress, and not itemShippingAddresses.

      Parameters:
      itemShippingAddresses - value to be set
      Returns:
      Builder
    • plusItemShippingAddresses

      public CartDraftBuilder plusItemShippingAddresses(Function<BaseAddressBuilder,BaseAddressBuilder> builder)

      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.

      For Carts with Single ShippingMode: eligible Shipping Methods or applicable Tax Rates are determined by the address shippingAddress, and not itemShippingAddresses.

      Parameters:
      builder - function to build the itemShippingAddresses value
      Returns:
      Builder
    • withItemShippingAddresses

      public CartDraftBuilder withItemShippingAddresses(Function<BaseAddressBuilder,BaseAddressBuilder> builder)

      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.

      For Carts with Single ShippingMode: eligible Shipping Methods or applicable Tax Rates are determined by the address shippingAddress, and not itemShippingAddresses.

      Parameters:
      builder - function to build the itemShippingAddresses value
      Returns:
      Builder
    • addItemShippingAddresses

      public CartDraftBuilder addItemShippingAddresses(Function<BaseAddressBuilder,BaseAddress> builder)

      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.

      For Carts with Single ShippingMode: eligible Shipping Methods or applicable Tax Rates are determined by the address shippingAddress, and not itemShippingAddresses.

      Parameters:
      builder - function to build the itemShippingAddresses value
      Returns:
      Builder
    • setItemShippingAddresses

      public CartDraftBuilder setItemShippingAddresses(Function<BaseAddressBuilder,BaseAddress> builder)

      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.

      For Carts with Single ShippingMode: eligible Shipping Methods or applicable Tax Rates are determined by the address shippingAddress, and not itemShippingAddresses.

      Parameters:
      builder - function to build the itemShippingAddresses value
      Returns:
      Builder
    • discountCodes

      public CartDraftBuilder discountCodes(@Nullable String... discountCodes)

      code of the existing DiscountCodes to add to the Cart.

      Parameters:
      discountCodes - value to be set
      Returns:
      Builder
    • discountCodes

      public CartDraftBuilder discountCodes(@Nullable List<String> discountCodes)

      code of the existing DiscountCodes to add to the Cart.

      Parameters:
      discountCodes - value to be set
      Returns:
      Builder
    • plusDiscountCodes

      public CartDraftBuilder plusDiscountCodes(@Nullable String... discountCodes)

      code of the existing DiscountCodes to add to the Cart.

      Parameters:
      discountCodes - value to be set
      Returns:
      Builder
    • country

      public CartDraftBuilder country(@Nullable String country)

      Used for Line Item 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
      Returns:
      Builder
    • locale

      public CartDraftBuilder locale(@Nullable String locale)

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

      Parameters:
      locale - value to be set
      Returns:
      Builder
    • origin

      public CartDraftBuilder origin(@Nullable CartOrigin origin)

      Indicates how the Cart was created.

      Parameters:
      origin - value to be set
      Returns:
      Builder
    • deleteDaysAfterLastModification

      public CartDraftBuilder deleteDaysAfterLastModification(@Nullable Long deleteDaysAfterLastModification)

      Number of days after which an active Cart 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
      Returns:
      Builder
    • custom

      Custom Fields for the Cart.

      Parameters:
      builder - function to build the custom value
      Returns:
      Builder
    • withCustom

      Custom Fields for the Cart.

      Parameters:
      builder - function to build the custom value
      Returns:
      Builder
    • custom

      Custom Fields for the Cart.

      Parameters:
      custom - value to be set
      Returns:
      Builder
    • getCurrency

      public String getCurrency()

      Currency the Cart uses.

      Returns:
      currency
    • getKey

      @Nullable public String getKey()

      User-defined unique identifier for the Cart.

      Returns:
      key
    • getCustomerId

      @Nullable public String getCustomerId()

      id of the Customer that the Cart belongs to.

      Returns:
      customerId
    • getCustomerEmail

      @Nullable public String getCustomerEmail()

      Email address of the Customer that the Cart belongs to.

      Returns:
      customerEmail
    • getCustomerGroup

      @Nullable public CustomerGroupResourceIdentifier getCustomerGroup()

      ResourceIdentifier to the Customer Group of the Customer that the Cart belongs to. Used for Line Item price selection.

      It is automatically set if the Customer referenced in customerId belongs to a Customer Group. It can also be set explicitly when no customerId is present.

      Returns:
      customerGroup
    • getAnonymousId

      @Nullable public String getAnonymousId()

      Anonymous session associated with the Cart.

      Returns:
      anonymousId
    • getBusinessUnit

      @Nullable public BusinessUnitResourceIdentifier getBusinessUnit()

      ResourceIdentifier to the Business Unit the Cart should belong to. When the customerId of the Cart is also set, 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

      @Nullable public List<LineItemDraft> getLineItems()

      Line Items to add to the Cart.

      Returns:
      lineItems
    • getCustomLineItems

      @Nullable public List<CustomLineItemDraft> getCustomLineItems()

      Custom Line Items to add to the Cart.

      Returns:
      customLineItems
    • getTaxMode

      @Nullable public TaxMode getTaxMode()

      Determines how Tax Rates are set.

      Returns:
      taxMode
    • getExternalTaxRateForShippingMethod

      @Nullable public ExternalTaxRateDraft getExternalTaxRateForShippingMethod()

      External Tax Rate for the shippingMethod if the Cart has External TaxMode.

      Returns:
      externalTaxRateForShippingMethod
    • getTaxRoundingMode

      @Nullable public RoundingMode getTaxRoundingMode()

      Determines how monetary values are rounded when calculating taxes for taxedPrice.

      Returns:
      taxRoundingMode
    • getTaxCalculationMode

      @Nullable public TaxCalculationMode getTaxCalculationMode()

      Determines how taxes are calculated for taxedPrice.

      Returns:
      taxCalculationMode
    • getInventoryMode

      @Nullable public InventoryMode getInventoryMode()

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

      Returns:
      inventoryMode
    • getBillingAddress

      @Nullable public BaseAddress getBillingAddress()

      Billing address associated with the Cart.

      Returns:
      billingAddress
    • getShippingAddress

      @Nullable public BaseAddress getShippingAddress()

      Shipping address for a Cart with Single ShippingMode. Determines eligible ShippingMethod rates and Tax Rates of Line Items. Must be one of the itemShippingAddresses when that field is also provided.

      Returns:
      shippingAddress
    • getShippingMethod

      @Nullable public ShippingMethodResourceIdentifier getShippingMethod()

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

      Returns:
      shippingMethod
    • getShippingRateInput

      @Nullable public ShippingRateInputDraft getShippingRateInput()

      Used as an input to select a ShippingRatePriceTier. The data type of this field depends on the shippingRateInputType.type configured in the Project:

      • If CartClassification, it must be ClassificationShippingRateInputDraft.
      • If CartScore, it must be ScoreShippingRateInputDraft.
      • If CartValue, it cannot be set.
      Returns:
      shippingRateInput
    • getShippingMode

      @Nullable public ShippingMode getShippingMode()
      • If set to Single, only a single Shipping Method can be added to the Cart.
      • If set to Multiple, multiple Shipping Methods can be added to the Cart.
      Returns:
      shippingMode
    • getCustomShipping

      @Nullable public List<CustomShippingDraft> getCustomShipping()

      Custom Shipping Methods for a Cart with Multiple ShippingMode.

      Returns:
      customShipping
    • getShipping

      @Nullable public List<ShippingDraft> getShipping()

      Shipping Methods for a Cart with Multiple ShippingMode.

      Returns:
      shipping
    • getItemShippingAddresses

      @Nullable public List<BaseAddress> 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.

      For Carts with Single ShippingMode: eligible Shipping Methods or applicable Tax Rates are determined by the address shippingAddress, and not itemShippingAddresses.

      Returns:
      itemShippingAddresses
    • getDiscountCodes

      @Nullable public List<String> getDiscountCodes()

      code of the existing DiscountCodes to add to the Cart.

      Returns:
      discountCodes
    • getCountry

      @Nullable public String getCountry()

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

      Returns:
      country
    • getLocale

      @Nullable public String getLocale()

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

      Returns:
      locale
    • getOrigin

      @Nullable public CartOrigin getOrigin()

      Indicates how the Cart was created.

      Returns:
      origin
    • getDeleteDaysAfterLastModification

      @Nullable public Long getDeleteDaysAfterLastModification()

      Number of days after which an active Cart 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

      @Nullable public CustomFieldsDraft getCustom()

      Custom Fields for the Cart.

      Returns:
      custom
    • build

      public CartDraft build()
      builds CartDraft with checking for non-null required values
      Specified by:
      build in interface Builder<CartDraft>
      Returns:
      CartDraft
    • buildUnchecked

      public CartDraft buildUnchecked()
      builds CartDraft without checking for non-null required values
      Returns:
      CartDraft
    • of

      public static CartDraftBuilder of()
      factory method for an instance of CartDraftBuilder
      Returns:
      builder
    • of

      public static CartDraftBuilder of(CartDraft template)
      create builder for CartDraft instance
      Parameters:
      template - instance with prefilled values for the builder
      Returns:
      builder