Class StagedOrderBuilder

java.lang.Object
com.commercetools.api.models.order_edit.StagedOrderBuilder
All Implemented Interfaces:
Builder<StagedOrder>

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

     StagedOrder stagedOrder = StagedOrder.builder()
             .id("{id}")
             .version(0.3)
             .createdAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .lastModifiedAt(ZonedDateTime.parse("2022-01-01T12:00:00.301Z"))
             .plusLineItems(lineItemsBuilder -> lineItemsBuilder)
             .plusCustomLineItems(customLineItemsBuilder -> customLineItemsBuilder)
             .totalPrice(totalPriceBuilder -> totalPriceBuilder)
             .shippingMode(ShippingMode.SINGLE)
             .plusShipping(shippingBuilder -> shippingBuilder)
             .plusRefusedGifts(refusedGiftsBuilder -> refusedGiftsBuilder)
             .origin(CartOrigin.CUSTOMER)
             .orderState(OrderState.OPEN)
             .plusSyncInfo(syncInfoBuilder -> syncInfoBuilder)
             .build()
 
  • Constructor Details

    • StagedOrderBuilder

      public StagedOrderBuilder()
  • Method Details

    • id

      public StagedOrderBuilder id(String id)

      Unique identifier of the Order.

      Parameters:
      id - value to be set
      Returns:
      Builder
    • version

      public StagedOrderBuilder version(Long version)

      Current version of the Order.

      Parameters:
      version - value to be set
      Returns:
      Builder
    • createdAt

      public StagedOrderBuilder createdAt(ZonedDateTime createdAt)

      Date and time (UTC) the Order was initially created.

      Parameters:
      createdAt - value to be set
      Returns:
      Builder
    • lastModifiedAt

      public StagedOrderBuilder lastModifiedAt(ZonedDateTime lastModifiedAt)

      Date and time (UTC) the Order was last updated.

      Parameters:
      lastModifiedAt - value to be set
      Returns:
      Builder
    • orderNumber

      public StagedOrderBuilder orderNumber(@Nullable String orderNumber)

      User-defined identifier of the Order that is unique across a Project.

      Parameters:
      orderNumber - value to be set
      Returns:
      Builder
    • purchaseOrderNumber

      public StagedOrderBuilder purchaseOrderNumber(@Nullable String purchaseOrderNumber)

      User-defined identifier of a purchase Order.

      It is typically set by the Buyer and can be used with Quotes to track the purchase Order during the quote and order flow.

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

      public StagedOrderBuilder customerId(@Nullable String customerId)

      id of the Customer that the Order belongs to.

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

      public StagedOrderBuilder customerEmail(@Nullable String customerEmail)

      Email address of the Customer that the Order belongs to.

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

      Reference to the Customer Group of the Customer that the Order belongs to. Used for Line Item price selection.

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

      Reference to the Customer Group of the Customer that the Order belongs to. Used for Line Item price selection.

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

      public StagedOrderBuilder customerGroup(@Nullable CustomerGroupReference customerGroup)

      Reference to the Customer Group of the Customer that the Order belongs to. Used for Line Item price selection.

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

      public StagedOrderBuilder anonymousId(@Nullable String anonymousId)

      Anonymous session associated with the Order.

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

      Reference to a Business Unit the Order belongs to.

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

      Reference to a Business Unit the Order belongs to.

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

      public StagedOrderBuilder businessUnit(@Nullable BusinessUnitKeyReference businessUnit)

      Reference to a Business Unit the Order belongs to.

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

      Reference to a Store the Order belongs to.

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

      Reference to a Store the Order belongs to.

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

      Reference to a Store the Order belongs to.

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

      public StagedOrderBuilder lineItems(LineItem... lineItems)

      Line Items that are part of the Order.

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

      public StagedOrderBuilder lineItems(List<LineItem> lineItems)

      Line Items that are part of the Order.

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

      public StagedOrderBuilder plusLineItems(LineItem... lineItems)

      Line Items that are part of the Order.

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

      Line Items that are part of the Order.

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

      Line Items that are part of the Order.

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

      public StagedOrderBuilder addLineItems(Function<LineItemBuilder,LineItem> builder)

      Line Items that are part of the Order.

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

      public StagedOrderBuilder setLineItems(Function<LineItemBuilder,LineItem> builder)

      Line Items that are part of the Order.

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

      public StagedOrderBuilder customLineItems(CustomLineItem... customLineItems)

      Custom Line Items that are part of the Order.

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

      public StagedOrderBuilder customLineItems(List<CustomLineItem> customLineItems)

      Custom Line Items that are part of the Order.

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

      public StagedOrderBuilder plusCustomLineItems(CustomLineItem... customLineItems)

      Custom Line Items that are part of the Order.

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

      Custom Line Items that are part of the Order.

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

      Custom Line Items that are part of the Order.

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

      public StagedOrderBuilder addCustomLineItems(Function<CustomLineItemBuilder,CustomLineItem> builder)

      Custom Line Items that are part of the Order.

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

      public StagedOrderBuilder setCustomLineItems(Function<CustomLineItemBuilder,CustomLineItem> builder)

      Custom Line Items that are part of the Order.

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

      Sum of the totalPrice field of all LineItems and CustomLineItems, and if available, the price field of ShippingInfo. If a discount applies on totalPrice, this field holds the discounted value.

      Taxes are included if TaxRate includedInPrice is true for each price.

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

      Sum of the totalPrice field of all LineItems and CustomLineItems, and if available, the price field of ShippingInfo. If a discount applies on totalPrice, this field holds the discounted value.

      Taxes are included if TaxRate includedInPrice is true for each price.

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

      public StagedOrderBuilder totalPrice(CentPrecisionMoney totalPrice)

      Sum of the totalPrice field of all LineItems and CustomLineItems, and if available, the price field of ShippingInfo. If a discount applies on totalPrice, this field holds the discounted value.

      Taxes are included if TaxRate includedInPrice is true for each price.

      Parameters:
      totalPrice - value to be set
      Returns:
      Builder
    • taxedPrice

      • For Platform TaxMode, it is automatically set when a shipping address is set.
      • For External TaxMode, it is automatically set when shippingAddress and external Tax Rates for all Line Items, Custom Line Items, and Shipping Methods in the Cart are set.

      If a discount applies on totalPrice, this field holds the discounted values.

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

      public StagedOrderBuilder withTaxedPrice(Function<TaxedPriceBuilder,TaxedPrice> builder)
      • For Platform TaxMode, it is automatically set when a shipping address is set.
      • For External TaxMode, it is automatically set when shippingAddress and external Tax Rates for all Line Items, Custom Line Items, and Shipping Methods in the Cart are set.

      If a discount applies on totalPrice, this field holds the discounted values.

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

      public StagedOrderBuilder taxedPrice(@Nullable TaxedPrice taxedPrice)
      • For Platform TaxMode, it is automatically set when a shipping address is set.
      • For External TaxMode, it is automatically set when shippingAddress and external Tax Rates for all Line Items, Custom Line Items, and Shipping Methods in the Cart are set.

      If a discount applies on totalPrice, this field holds the discounted values.

      Parameters:
      taxedPrice - value to be set
      Returns:
      Builder
    • taxedShippingPrice

      public StagedOrderBuilder taxedShippingPrice(Function<TaxedPriceBuilder,TaxedPriceBuilder> builder)

      Sum of the taxedPrice field of ShippingInfo across all Shipping Methods.

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

      public StagedOrderBuilder withTaxedShippingPrice(Function<TaxedPriceBuilder,TaxedPrice> builder)

      Sum of the taxedPrice field of ShippingInfo across all Shipping Methods.

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

      public StagedOrderBuilder taxedShippingPrice(@Nullable TaxedPrice taxedShippingPrice)

      Sum of the taxedPrice field of ShippingInfo across all Shipping Methods.

      Parameters:
      taxedShippingPrice - value to be set
      Returns:
      Builder
    • discountOnTotalPrice

      Discounts that apply on the total price of the Order.

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

      Discounts that apply on the total price of the Order.

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

      public StagedOrderBuilder discountOnTotalPrice(@Nullable DiscountOnTotalPrice discountOnTotalPrice)

      Discounts that apply on the total price of the Order.

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

      public StagedOrderBuilder taxMode(@Nullable TaxMode taxMode)

      Indicates how Tax Rates are set.

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

      public StagedOrderBuilder taxRoundingMode(@Nullable RoundingMode taxRoundingMode)

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

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

      public StagedOrderBuilder taxCalculationMode(@Nullable TaxCalculationMode taxCalculationMode)

      Indicates how taxes are calculated when calculating taxes for taxedPrice.

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

      public StagedOrderBuilder inventoryMode(@Nullable InventoryMode inventoryMode)

      Indicates how stock quantities are tracked for Line Items in the Order.

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

      public StagedOrderBuilder billingAddress(Function<AddressBuilder,AddressBuilder> builder)

      Billing address associated with the Order.

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

      public StagedOrderBuilder withBillingAddress(Function<AddressBuilder,Address> builder)

      Billing address associated with the Order.

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

      public StagedOrderBuilder billingAddress(@Nullable Address billingAddress)

      Billing address associated with the Order.

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

      public StagedOrderBuilder shippingAddress(Function<AddressBuilder,AddressBuilder> builder)

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

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

      public StagedOrderBuilder withShippingAddress(Function<AddressBuilder,Address> builder)

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

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

      public StagedOrderBuilder shippingAddress(@Nullable Address shippingAddress)

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

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

      public StagedOrderBuilder shippingMode(ShippingMode shippingMode)

      Indicates whether there can be one or multiple Shipping Methods.

      Parameters:
      shippingMode - value to be set
      Returns:
      Builder
    • shippingKey

      public StagedOrderBuilder shippingKey(@Nullable String shippingKey)

      key of the ShippingMethod for Single ShippingMode.

      Parameters:
      shippingKey - value to be set
      Returns:
      Builder
    • shippingInfo

      Shipping-related information for Single ShippingMode. Automatically set when a Shipping Method is set.

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

      public StagedOrderBuilder withShippingInfo(Function<ShippingInfoBuilder,ShippingInfo> builder)

      Shipping-related information for Single ShippingMode. Automatically set when a Shipping Method is set.

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

      public StagedOrderBuilder shippingInfo(@Nullable ShippingInfo shippingInfo)

      Shipping-related information for Single ShippingMode. Automatically set when a Shipping Method is set.

      Parameters:
      shippingInfo - value to be set
      Returns:
      Builder
    • shippingRateInput

      public StagedOrderBuilder shippingRateInput(@Nullable ShippingRateInput shippingRateInput)

      Input used to select a ShippingRatePriceTier. The data type of this field depends on the shippingRateInputType.type configured in the Project:

      • If CartClassification, it is ClassificationShippingRateInput.
      • If CartScore, it is ScoreShippingRateInput.
      • If CartValue, it cannot be used.
      Parameters:
      shippingRateInput - value to be set
      Returns:
      Builder
    • shippingRateInput

      public StagedOrderBuilder shippingRateInput(Function<ShippingRateInputBuilder,Builder<? extends ShippingRateInput>> builder)

      Input used to select a ShippingRatePriceTier. The data type of this field depends on the shippingRateInputType.type configured in the Project:

      • If CartClassification, it is ClassificationShippingRateInput.
      • If CartScore, it is ScoreShippingRateInput.
      • If CartValue, it cannot be used.
      Parameters:
      builder - function to build the shippingRateInput value
      Returns:
      Builder
    • shippingCustomFields

      public StagedOrderBuilder shippingCustomFields(Function<CustomFieldsBuilder,CustomFieldsBuilder> builder)

      Custom Fields of the Shipping Method for Single ShippingMode.

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

      public StagedOrderBuilder withShippingCustomFields(Function<CustomFieldsBuilder,CustomFields> builder)

      Custom Fields of the Shipping Method for Single ShippingMode.

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

      public StagedOrderBuilder shippingCustomFields(@Nullable CustomFields shippingCustomFields)

      Custom Fields of the Shipping Method for Single ShippingMode.

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

      public StagedOrderBuilder shipping(Shipping... shipping)

      Shipping-related information for Multiple ShippingMode. Updated automatically each time a new Shipping Method is added.

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

      public StagedOrderBuilder shipping(List<Shipping> shipping)

      Shipping-related information for Multiple ShippingMode. Updated automatically each time a new Shipping Method is added.

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

      public StagedOrderBuilder plusShipping(Shipping... shipping)

      Shipping-related information for Multiple ShippingMode. Updated automatically each time a new Shipping Method is added.

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

      Shipping-related information for Multiple ShippingMode. Updated automatically each time a new Shipping Method is added.

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

      Shipping-related information for Multiple ShippingMode. Updated automatically each time a new Shipping Method is added.

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

      public StagedOrderBuilder addShipping(Function<ShippingBuilder,Shipping> builder)

      Shipping-related information for Multiple ShippingMode. Updated automatically each time a new Shipping Method is added.

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

      public StagedOrderBuilder setShipping(Function<ShippingBuilder,Shipping> builder)

      Shipping-related information for Multiple ShippingMode. Updated automatically each time a new Shipping Method is added.

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

      public StagedOrderBuilder itemShippingAddresses(@Nullable Address... itemShippingAddresses)

      Additional shipping addresses of the Order as specified by LineItems using the shippingDetails field. Eligible Shipping Methods or applicable Tax Rates are determined by the address in shippingAddress, and not itemShippingAddresses.

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

      public StagedOrderBuilder itemShippingAddresses(@Nullable List<Address> itemShippingAddresses)

      Additional shipping addresses of the Order as specified by LineItems using the shippingDetails field. Eligible Shipping Methods or applicable Tax Rates are determined by the address in shippingAddress, and not itemShippingAddresses.

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

      public StagedOrderBuilder plusItemShippingAddresses(@Nullable Address... itemShippingAddresses)

      Additional shipping addresses of the Order as specified by LineItems using the shippingDetails field. Eligible Shipping Methods or applicable Tax Rates are determined by the address in shippingAddress, and not itemShippingAddresses.

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

      public StagedOrderBuilder plusItemShippingAddresses(Function<AddressBuilder,AddressBuilder> builder)

      Additional shipping addresses of the Order as specified by LineItems using the shippingDetails field. Eligible Shipping Methods or applicable Tax Rates are determined by the address in shippingAddress, and not itemShippingAddresses.

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

      public StagedOrderBuilder withItemShippingAddresses(Function<AddressBuilder,AddressBuilder> builder)

      Additional shipping addresses of the Order as specified by LineItems using the shippingDetails field. Eligible Shipping Methods or applicable Tax Rates are determined by the address in shippingAddress, and not itemShippingAddresses.

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

      public StagedOrderBuilder addItemShippingAddresses(Function<AddressBuilder,Address> builder)

      Additional shipping addresses of the Order as specified by LineItems using the shippingDetails field. Eligible Shipping Methods or applicable Tax Rates are determined by the address in shippingAddress, and not itemShippingAddresses.

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

      public StagedOrderBuilder setItemShippingAddresses(Function<AddressBuilder,Address> builder)

      Additional shipping addresses of the Order as specified by LineItems using the shippingDetails field. Eligible Shipping Methods or applicable Tax Rates are determined by the address in shippingAddress, and not itemShippingAddresses.

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

      public StagedOrderBuilder discountCodes(@Nullable DiscountCodeInfo... discountCodes)

      Discount Codes added to the Order. An Order that has directDiscounts cannot have discountCodes.

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

      public StagedOrderBuilder discountCodes(@Nullable List<DiscountCodeInfo> discountCodes)

      Discount Codes added to the Order. An Order that has directDiscounts cannot have discountCodes.

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

      public StagedOrderBuilder plusDiscountCodes(@Nullable DiscountCodeInfo... discountCodes)

      Discount Codes added to the Order. An Order that has directDiscounts cannot have discountCodes.

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

      Discount Codes added to the Order. An Order that has directDiscounts cannot have discountCodes.

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

      Discount Codes added to the Order. An Order that has directDiscounts cannot have discountCodes.

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

      Discount Codes added to the Order. An Order that has directDiscounts cannot have discountCodes.

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

      Discount Codes added to the Order. An Order that has directDiscounts cannot have discountCodes.

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

      public StagedOrderBuilder directDiscounts(@Nullable DirectDiscount... directDiscounts)

      Direct Discounts added to the Order. An Order that has discountCodes cannot have directDiscounts.

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

      public StagedOrderBuilder directDiscounts(@Nullable List<DirectDiscount> directDiscounts)

      Direct Discounts added to the Order. An Order that has discountCodes cannot have directDiscounts.

      Parameters:
      directDiscounts - value to be set
      Returns:
      Builder
    • plusDirectDiscounts

      public StagedOrderBuilder plusDirectDiscounts(@Nullable DirectDiscount... directDiscounts)

      Direct Discounts added to the Order. An Order that has discountCodes cannot have directDiscounts.

      Parameters:
      directDiscounts - value to be set
      Returns:
      Builder
    • plusDirectDiscounts

      Direct Discounts added to the Order. An Order that has discountCodes cannot have directDiscounts.

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

      Direct Discounts added to the Order. An Order that has discountCodes cannot have directDiscounts.

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

      public StagedOrderBuilder addDirectDiscounts(Function<DirectDiscountBuilder,DirectDiscount> builder)

      Direct Discounts added to the Order. An Order that has discountCodes cannot have directDiscounts.

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

      public StagedOrderBuilder setDirectDiscounts(Function<DirectDiscountBuilder,DirectDiscount> builder)

      Direct Discounts added to the Order. An Order that has discountCodes cannot have directDiscounts.

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

      public StagedOrderBuilder refusedGifts(CartDiscountReference... refusedGifts)

      Automatically set when a Line Item with GiftLineItem LineItemMode is removed from the Order.

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

      public StagedOrderBuilder refusedGifts(List<CartDiscountReference> refusedGifts)

      Automatically set when a Line Item with GiftLineItem LineItemMode is removed from the Order.

      Parameters:
      refusedGifts - value to be set
      Returns:
      Builder
    • plusRefusedGifts

      public StagedOrderBuilder plusRefusedGifts(CartDiscountReference... refusedGifts)

      Automatically set when a Line Item with GiftLineItem LineItemMode is removed from the Order.

      Parameters:
      refusedGifts - value to be set
      Returns:
      Builder
    • plusRefusedGifts

      Automatically set when a Line Item with GiftLineItem LineItemMode is removed from the Order.

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

      Automatically set when a Line Item with GiftLineItem LineItemMode is removed from the Order.

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

      Automatically set when a Line Item with GiftLineItem LineItemMode is removed from the Order.

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

      Automatically set when a Line Item with GiftLineItem LineItemMode is removed from the Order.

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

      Payment information related to the Order.

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

      public StagedOrderBuilder withPaymentInfo(Function<PaymentInfoBuilder,PaymentInfo> builder)

      Payment information related to the Order.

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

      public StagedOrderBuilder paymentInfo(@Nullable PaymentInfo paymentInfo)

      Payment information related to the Order.

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

      public StagedOrderBuilder country(@Nullable String country)

      Used for Line Item price selection.

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

      public StagedOrderBuilder locale(@Nullable String locale)

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

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

      public StagedOrderBuilder origin(CartOrigin origin)

      Indicates the origin of the Cart from which the Order was created.

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

      Reference to the Cart for an Order created from Cart. The referenced Cart will have the Ordered CartState.

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

      Reference to the Cart for an Order created from Cart. The referenced Cart will have the Ordered CartState.

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

      Reference to the Cart for an Order created from Cart. The referenced Cart will have the Ordered CartState.

      Parameters:
      cart - value to be set
      Returns:
      Builder
    • quote

      Reference to the Quote for an Order created from Quote.

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

      Reference to the Quote for an Order created from Quote.

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

      Reference to the Quote for an Order created from Quote.

      Parameters:
      quote - value to be set
      Returns:
      Builder
    • orderState

      public StagedOrderBuilder orderState(OrderState orderState)

      Current status of the Order.

      Parameters:
      orderState - value to be set
      Returns:
      Builder
    • shipmentState

      public StagedOrderBuilder shipmentState(@Nullable ShipmentState shipmentState)

      Shipment status of the Order.

      Parameters:
      shipmentState - value to be set
      Returns:
      Builder
    • paymentState

      public StagedOrderBuilder paymentState(@Nullable PaymentState paymentState)

      Payment status of the Order.

      Parameters:
      paymentState - value to be set
      Returns:
      Builder
    • state

      State of the Order. This reference can point to a State in a custom workflow.

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

      State of the Order. This reference can point to a State in a custom workflow.

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

      State of the Order. This reference can point to a State in a custom workflow.

      Parameters:
      state - value to be set
      Returns:
      Builder
    • syncInfo

      public StagedOrderBuilder syncInfo(SyncInfo... syncInfo)

      Contains synchronization activity information of the Order (like export or import). Can only be set with Update SyncInfo update action.

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

      public StagedOrderBuilder syncInfo(List<SyncInfo> syncInfo)

      Contains synchronization activity information of the Order (like export or import). Can only be set with Update SyncInfo update action.

      Parameters:
      syncInfo - value to be set
      Returns:
      Builder
    • plusSyncInfo

      public StagedOrderBuilder plusSyncInfo(SyncInfo... syncInfo)

      Contains synchronization activity information of the Order (like export or import). Can only be set with Update SyncInfo update action.

      Parameters:
      syncInfo - value to be set
      Returns:
      Builder
    • plusSyncInfo

      Contains synchronization activity information of the Order (like export or import). Can only be set with Update SyncInfo update action.

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

      Contains synchronization activity information of the Order (like export or import). Can only be set with Update SyncInfo update action.

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

      public StagedOrderBuilder addSyncInfo(Function<SyncInfoBuilder,SyncInfo> builder)

      Contains synchronization activity information of the Order (like export or import). Can only be set with Update SyncInfo update action.

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

      public StagedOrderBuilder setSyncInfo(Function<SyncInfoBuilder,SyncInfo> builder)

      Contains synchronization activity information of the Order (like export or import). Can only be set with Update SyncInfo update action.

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

      public StagedOrderBuilder returnInfo(@Nullable ReturnInfo... returnInfo)

      Contains information regarding the returns associated with the Order.

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

      public StagedOrderBuilder returnInfo(@Nullable List<ReturnInfo> returnInfo)

      Contains information regarding the returns associated with the Order.

      Parameters:
      returnInfo - value to be set
      Returns:
      Builder
    • plusReturnInfo

      public StagedOrderBuilder plusReturnInfo(@Nullable ReturnInfo... returnInfo)

      Contains information regarding the returns associated with the Order.

      Parameters:
      returnInfo - value to be set
      Returns:
      Builder
    • plusReturnInfo

      Contains information regarding the returns associated with the Order.

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

      Contains information regarding the returns associated with the Order.

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

      public StagedOrderBuilder addReturnInfo(Function<ReturnInfoBuilder,ReturnInfo> builder)

      Contains information regarding the returns associated with the Order.

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

      public StagedOrderBuilder setReturnInfo(Function<ReturnInfoBuilder,ReturnInfo> builder)

      Contains information regarding the returns associated with the Order.

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

      @Deprecated public StagedOrderBuilder lastMessageSequenceNumber(@Nullable Long lastMessageSequenceNumber)
      Deprecated.

      Internal-only field.

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

      Custom Fields of the Order.

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

      Custom Fields of the Order.

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

      public StagedOrderBuilder custom(@Nullable CustomFields custom)

      Custom Fields of the Order.

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

      public StagedOrderBuilder completedAt(@Nullable ZonedDateTime completedAt)

      User-defined date and time (UTC) of the Order. Present only on an Order created using Order Import.

      Parameters:
      completedAt - value to be set
      Returns:
      Builder
    • lastModifiedBy

      IDs and references that last modified the Order.

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

      public StagedOrderBuilder withLastModifiedBy(Function<LastModifiedByBuilder,LastModifiedBy> builder)

      IDs and references that last modified the Order.

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

      public StagedOrderBuilder lastModifiedBy(@Nullable LastModifiedBy lastModifiedBy)

      IDs and references that last modified the Order.

      Parameters:
      lastModifiedBy - value to be set
      Returns:
      Builder
    • createdBy

      IDs and references that created the Order.

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

      public StagedOrderBuilder withCreatedBy(Function<CreatedByBuilder,CreatedBy> builder)

      IDs and references that created the Order.

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

      public StagedOrderBuilder createdBy(@Nullable CreatedBy createdBy)

      IDs and references that created the Order.

      Parameters:
      createdBy - value to be set
      Returns:
      Builder
    • getId

      public String getId()

      Unique identifier of the Order.

      Returns:
      id
    • getVersion

      public Long getVersion()

      Current version of the Order.

      Returns:
      version
    • getCreatedAt

      public ZonedDateTime getCreatedAt()

      Date and time (UTC) the Order was initially created.

      Returns:
      createdAt
    • getLastModifiedAt

      public ZonedDateTime getLastModifiedAt()

      Date and time (UTC) the Order was last updated.

      Returns:
      lastModifiedAt
    • getOrderNumber

      @Nullable public String getOrderNumber()

      User-defined identifier of the Order that is unique across a Project.

      Returns:
      orderNumber
    • getPurchaseOrderNumber

      @Nullable public String getPurchaseOrderNumber()

      User-defined identifier of a purchase Order.

      It is typically set by the Buyer and can be used with Quotes to track the purchase Order during the quote and order flow.

      Returns:
      purchaseOrderNumber
    • getCustomerId

      @Nullable public String getCustomerId()

      id of the Customer that the Order belongs to.

      Returns:
      customerId
    • getCustomerEmail

      @Nullable public String getCustomerEmail()

      Email address of the Customer that the Order belongs to.

      Returns:
      customerEmail
    • getCustomerGroup

      @Nullable public CustomerGroupReference getCustomerGroup()

      Reference to the Customer Group of the Customer that the Order belongs to. Used for Line Item price selection.

      Returns:
      customerGroup
    • getAnonymousId

      @Nullable public String getAnonymousId()

      Anonymous session associated with the Order.

      Returns:
      anonymousId
    • getBusinessUnit

      @Nullable public BusinessUnitKeyReference getBusinessUnit()

      Reference to a Business Unit the Order belongs to.

      Returns:
      businessUnit
    • getStore

      @Nullable public StoreKeyReference getStore()

      Reference to a Store the Order belongs to.

      Returns:
      store
    • getLineItems

      public List<LineItem> getLineItems()

      Line Items that are part of the Order.

      Returns:
      lineItems
    • getCustomLineItems

      public List<CustomLineItem> getCustomLineItems()

      Custom Line Items that are part of the Order.

      Returns:
      customLineItems
    • getTotalPrice

      public CentPrecisionMoney getTotalPrice()

      Sum of the totalPrice field of all LineItems and CustomLineItems, and if available, the price field of ShippingInfo. If a discount applies on totalPrice, this field holds the discounted value.

      Taxes are included if TaxRate includedInPrice is true for each price.

      Returns:
      totalPrice
    • getTaxedPrice

      @Nullable public TaxedPrice getTaxedPrice()
      • For Platform TaxMode, it is automatically set when a shipping address is set.
      • For External TaxMode, it is automatically set when shippingAddress and external Tax Rates for all Line Items, Custom Line Items, and Shipping Methods in the Cart are set.

      If a discount applies on totalPrice, this field holds the discounted values.

      Returns:
      taxedPrice
    • getTaxedShippingPrice

      @Nullable public TaxedPrice getTaxedShippingPrice()

      Sum of the taxedPrice field of ShippingInfo across all Shipping Methods.

      Returns:
      taxedShippingPrice
    • getDiscountOnTotalPrice

      @Nullable public DiscountOnTotalPrice getDiscountOnTotalPrice()

      Discounts that apply on the total price of the Order.

      Returns:
      discountOnTotalPrice
    • getTaxMode

      @Nullable public TaxMode getTaxMode()

      Indicates how Tax Rates are set.

      Returns:
      taxMode
    • getTaxRoundingMode

      @Nullable public RoundingMode getTaxRoundingMode()

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

      Returns:
      taxRoundingMode
    • getTaxCalculationMode

      @Nullable public TaxCalculationMode getTaxCalculationMode()

      Indicates how taxes are calculated when calculating taxes for taxedPrice.

      Returns:
      taxCalculationMode
    • getInventoryMode

      @Nullable public InventoryMode getInventoryMode()

      Indicates how stock quantities are tracked for Line Items in the Order.

      Returns:
      inventoryMode
    • getBillingAddress

      @Nullable public Address getBillingAddress()

      Billing address associated with the Order.

      Returns:
      billingAddress
    • getShippingAddress

      @Nullable public Address getShippingAddress()

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

      Returns:
      shippingAddress
    • getShippingMode

      public ShippingMode getShippingMode()

      Indicates whether there can be one or multiple Shipping Methods.

      Returns:
      shippingMode
    • getShippingKey

      @Nullable public String getShippingKey()

      key of the ShippingMethod for Single ShippingMode.

      Returns:
      shippingKey
    • getShippingInfo

      @Nullable public ShippingInfo getShippingInfo()

      Shipping-related information for Single ShippingMode. Automatically set when a Shipping Method is set.

      Returns:
      shippingInfo
    • getShippingRateInput

      @Nullable public ShippingRateInput getShippingRateInput()

      Input used to select a ShippingRatePriceTier. The data type of this field depends on the shippingRateInputType.type configured in the Project:

      • If CartClassification, it is ClassificationShippingRateInput.
      • If CartScore, it is ScoreShippingRateInput.
      • If CartValue, it cannot be used.
      Returns:
      shippingRateInput
    • getShippingCustomFields

      @Nullable public CustomFields getShippingCustomFields()

      Custom Fields of the Shipping Method for Single ShippingMode.

      Returns:
      shippingCustomFields
    • getShipping

      public List<Shipping> getShipping()

      Shipping-related information for Multiple ShippingMode. Updated automatically each time a new Shipping Method is added.

      Returns:
      shipping
    • getItemShippingAddresses

      @Nullable public List<Address> getItemShippingAddresses()

      Additional shipping addresses of the Order as specified by LineItems using the shippingDetails field. Eligible Shipping Methods or applicable Tax Rates are determined by the address in shippingAddress, and not itemShippingAddresses.

      Returns:
      itemShippingAddresses
    • getDiscountCodes

      @Nullable public List<DiscountCodeInfo> getDiscountCodes()

      Discount Codes added to the Order. An Order that has directDiscounts cannot have discountCodes.

      Returns:
      discountCodes
    • getDirectDiscounts

      @Nullable public List<DirectDiscount> getDirectDiscounts()

      Direct Discounts added to the Order. An Order that has discountCodes cannot have directDiscounts.

      Returns:
      directDiscounts
    • getRefusedGifts

      public List<CartDiscountReference> getRefusedGifts()

      Automatically set when a Line Item with GiftLineItem LineItemMode is removed from the Order.

      Returns:
      refusedGifts
    • getPaymentInfo

      @Nullable public PaymentInfo getPaymentInfo()

      Payment information related to the Order.

      Returns:
      paymentInfo
    • getCountry

      @Nullable public String getCountry()

      Used for Line Item price selection.

      Returns:
      country
    • getLocale

      @Nullable public String getLocale()

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

      Returns:
      locale
    • getOrigin

      public CartOrigin getOrigin()

      Indicates the origin of the Cart from which the Order was created.

      Returns:
      origin
    • getCart

      @Nullable public CartReference getCart()

      Reference to the Cart for an Order created from Cart. The referenced Cart will have the Ordered CartState.

      Returns:
      cart
    • getQuote

      @Nullable public QuoteReference getQuote()

      Reference to the Quote for an Order created from Quote.

      Returns:
      quote
    • getOrderState

      public OrderState getOrderState()

      Current status of the Order.

      Returns:
      orderState
    • getShipmentState

      @Nullable public ShipmentState getShipmentState()

      Shipment status of the Order.

      Returns:
      shipmentState
    • getPaymentState

      @Nullable public PaymentState getPaymentState()

      Payment status of the Order.

      Returns:
      paymentState
    • getState

      @Nullable public StateReference getState()

      State of the Order. This reference can point to a State in a custom workflow.

      Returns:
      state
    • getSyncInfo

      public List<SyncInfo> getSyncInfo()

      Contains synchronization activity information of the Order (like export or import). Can only be set with Update SyncInfo update action.

      Returns:
      syncInfo
    • getReturnInfo

      @Nullable public List<ReturnInfo> getReturnInfo()

      Contains information regarding the returns associated with the Order.

      Returns:
      returnInfo
    • getLastMessageSequenceNumber

      @Deprecated @Nullable public Long getLastMessageSequenceNumber()
      Deprecated.

      Internal-only field.

      Returns:
      lastMessageSequenceNumber
    • getCustom

      @Nullable public CustomFields getCustom()

      Custom Fields of the Order.

      Returns:
      custom
    • getCompletedAt

      @Nullable public ZonedDateTime getCompletedAt()

      User-defined date and time (UTC) of the Order. Present only on an Order created using Order Import.

      Returns:
      completedAt
    • getLastModifiedBy

      @Nullable public LastModifiedBy getLastModifiedBy()

      IDs and references that last modified the Order.

      Returns:
      lastModifiedBy
    • getCreatedBy

      @Nullable public CreatedBy getCreatedBy()

      IDs and references that created the Order.

      Returns:
      createdBy
    • build

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

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

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

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