public interface Order extends CartLike<Order>
An order can have custom fields.
| Modifier and Type | Method and Description |
|---|---|
Address |
getBillingAddress()
The billing address.
|
Reference<Cart> |
getCart()
Set when this order was created from a cart.
|
ZonedDateTime |
getCompletedAt() |
com.neovisionaries.i18n.CountryCode |
getCountry() |
CustomFields |
getCustom() |
String |
getCustomerEmail()
The email of the customer which should be used for this cart/order.
|
Reference<CustomerGroup> |
getCustomerGroup()
In the order context the customer group can only be expanded if the customer was in a group before creating the order.
|
String |
getCustomerId()
The ID of the customer to which this cart/order belongs to.
|
List<CustomLineItem> |
getCustomLineItems()
Custom goods, fees or discounts added to the cart.
|
List<DiscountCodeInfo> |
getDiscountCodes()
Discount codes belonging to this cart.
|
InventoryMode |
getInventoryMode() |
List<Address> |
getItemShippingAddresses() |
Long |
getLastMessageSequenceNumber() |
List<LineItem> |
getLineItems()
Snapshots of the products added to the cart.
|
String |
getOrderNumber()
String that uniquely identifies an order.
|
OrderState |
getOrderState()
State of this order.
|
PaymentInfo |
getPaymentInfo()
Get associated payments.
|
PaymentState |
getPaymentState()
Payment state of this order.
|
List<Reference<CartDiscount>> |
getRefusedGifts()
The refused gifts of this cart.
|
List<ReturnInfo> |
getReturnInfo() |
ShipmentState |
getShipmentState()
Shipment state of this order.
|
Address |
getShippingAddress()
The shipping address.
|
OrderShippingInfo |
getShippingInfo()
Information about shipping set by the backend once the shipping method is set.
|
ShippingRateInput |
getShippingRateInput()
The shippingRateInput is used as an input to select a shipping rate price tier
|
Reference<State> |
getState()
Returns this state of this Order.
|
KeyReference<Store> |
getStore() |
Set<SyncInfo> |
getSyncInfo()
Sync info of this order.
|
TaxedPrice |
getTaxedPrice()
The taxed price.
|
javax.money.MonetaryAmount |
getTotalPrice() |
static Reference<Order> |
referenceOfId(String id)
Creates a reference for one item of this class by a known ID.
|
static String |
referenceTypeId()
A type hint for references which resource type is linked in a reference.
|
static String |
resourceTypeId()
An identifier for this resource which supports
CustomFields. |
default Reference<Order> |
toReference()
Creates a reference to this resource, the reference may not be filled.
|
static com.fasterxml.jackson.core.type.TypeReference<Order> |
typeReference()
Creates a container which contains the full Java type information to deserialize this class from JSON.
|
calculateSubTotalPrice, calculateTotalAppliedTaxes, findCustomLineItem, findLineItem, getAnonymousId, getCurrency, getLocale, getOrigin, getTaxCalculationMode, getTaxMode, getTaxRoundingModegetCreatedAt, getId, getLastModifiedAt, getVersionhasSameIdAs, toResourceIdentifierstatic String resourceTypeId()
CustomFields.TypeDraft.getResourceTypeIds(),
Customstatic String referenceTypeId()
Reference.getTypeId()static com.fasterxml.jackson.core.type.TypeReference<Order> typeReference()
default Reference<Order> toReference()
ReferenceabletoReference in interface Referenceable<Order>toReference in interface Resource<Order>@Nullable String getOrderNumber()
InventoryMode getInventoryMode()
OrderState getOrderState()
ChangeOrderState@Nullable ShipmentState getShipmentState()
ChangeShipmentState@Nullable PaymentState getPaymentState()
ChangePaymentState@Nullable OrderShippingInfo getShippingInfo()
CartLikegetShippingInfo in interface CartLike<Order>SetShippingMethod,
SetCustomShippingMethod,
AddDeliverySet<SyncInfo> getSyncInfo()
UpdateSyncInfoList<ReturnInfo> getReturnInfo()
Long getLastMessageSequenceNumber()
@Nullable Address getBillingAddress()
getBillingAddress in interface CartLike<Order>SetBillingAddress,
OrderBillingAddressSetMessage@Nullable com.neovisionaries.i18n.CountryCode getCountry()
getCountry in interface CartLike<Order>@Nullable String getCustomerEmail()
CartLikeCustomer.getEmail().getCustomerEmail in interface CartLike<Order>SetCustomerEmail@Nullable Reference<CustomerGroup> getCustomerGroup()
CartLikegetCustomerGroup in interface CartLike<Order>@Nullable String getCustomerId()
CartLikegetCustomerId in interface CartLike<Order>CustomerSignInCommand,
SetCustomerIdList<CustomLineItem> getCustomLineItems()
CartLikegetCustomLineItems in interface CartLike<Order>AddCustomLineItem,
RemoveCustomLineItemList<LineItem> getLineItems()
CartLikegetLineItems in interface CartLike<Order>AddLineItem,
ChangeLineItemQuantity,
RemoveLineItem@Nullable Address getShippingAddress()
getShippingAddress in interface CartLike<Order>SetShippingAddress,
OrderShippingAddressSetMessage@Nullable TaxedPrice getTaxedPrice()
CartLikeCartLike.getShippingAddress()) is used to determine tax rate of the line items.getTaxedPrice in interface CartLike<Order>javax.money.MonetaryAmount getTotalPrice()
getTotalPrice in interface CartLike<Order>ZonedDateTime getCompletedAt()
@Nullable Reference<Cart> getCart()
List<DiscountCodeInfo> getDiscountCodes()
CartLikegetDiscountCodes in interface CartLike<Order>AddDiscountCode@Nullable List<Reference<CartDiscount>> getRefusedGifts()
LineItemMode.GIFT_LINE_ITEM
is removed from this order.@Nullable CustomFields getCustom()
@Nullable Reference<State> getState()
TransitionState@Nullable PaymentInfo getPaymentInfo()
getPaymentInfo in interface CartLike<Order>AddPayment,
RemovePayment@Nullable ShippingRateInput getShippingRateInput()
getShippingRateInput in interface CartLike<Order>List<Address> getItemShippingAddresses()
getItemShippingAddresses in interface CartLike<Order>@Nullable KeyReference<Store> getStore()
static Reference<Order> referenceOfId(String id)
An example for categories but this applies for other resources, too:
final String categoryIdFromFormOrSession = "84ac4271-0fec-49d0-9fee-55586c565c58"; final Reference<Category> categoryReference = Category.referenceOfId(categoryIdFromFormOrSession); assertThat(categoryReference.getId()).isEqualTo(categoryIdFromFormOrSession);See the test code.
If you already have a resource object, then use toReference() instead:
final Category category = getCategory1(); final Reference<Category> categoryReference = category.toReference(); assertThat(category.getId()).isEqualTo(categoryReference.getId());See the test code.
id - the ID of the resource which should be referenced.