Represents a shopping cart, the customer's in-progress or completed order for one or more products. Holds the shipping and billing addresses, the ordered product line items, fulfilment and payment state, and loyalty point redemption details for a single order. A cart moves through ShoppingCartState, starting as PENDING while the customer is still shopping, through to COMPLETED once the order is submitted, or CANCELLED if it is abandoned by an administrator.

Group: Database Entities

Implements: Serializable, Auditable, ISale


Properties

PropertyReturnsDescription
activatedPromotionsSet<Reward>The promotional rewards that have been activated against this cart.
addressLine1StringFirst line of the cart's delivery street address.
addressLine2StringSecond line of the cart's delivery street address, such as a unit or suite number.
addressStateStringState or province of the cart's delivery address.
adminOrgOrganisationThe Kademi account holder organisation this cart belongs to.
auditOrgOrganisationThe organisation that audit entries for changes to this cart are recorded against, per the Auditable interface.
billingAddressAddressThe billing address recorded for this order, separate from the delivery address.
billingCompanyStringCompany name of the billing contact for this order.
billingFirstNameStringFirst name of the billing contact for this order.
billingPhoneStringPhone number of the billing contact for this order.
billingSurNameStringSurname of the billing contact for this order.
cartIdStringA UUID set from the cookie to allow the final cart to be connected to activity prior to the cart being created.
cartStateShoppingCartStateWhere this cart is in the checkout lifecycle: PENDING while still being shopped, COMPLETED once submitted, or CANCELLED if abandoned by an administrator.
cityStringCity or suburb of the cart's delivery address.
companyStringCompany name of the shipping contact for this order.
countryStringCountry of the cart's delivery address.
customerBaseEntityAlias of getProfile, for compatibility with the ISale interface.
deliveryNotesStringCourier or delivery instructions for this order, such as gate codes or drop-off preferences.
firstNameStringFirst name of the shipping contact for this order.
fulfilmentCompletebooleanTrue if the order's fulfilment state is FULFILMENT_COMPLETE.
fulfilmentStateStringThe order's fulfilment status code, such as FULFILMENT_NOT_FULFILED, FULFILMENT_COMPLETE or FULFILMENT_DELETED.
idlongThe cart's unique database identifier.
ipAddressStringThe client IP the order was placed from. Recorded so that fraud rules can ask how many orders have come from one address recently, which is not answerable from anything else on this record.
modifiedByProfileThe profile who last modified this cart.
modifiedDateDateDate this cart was last modified.
numPointsBigDecimalNumber of loyalty points being redeemed against this cart.
orderedDateDateDate the cart was created, ie when the order was placed.
orderedForOrgOrganisationThe organisation this order was placed on behalf of, when the ordering profile is buying for an organisation rather than themselves.
orderNotesStringFree text notes attached to the order.
paymentMethodStringIdentifies the checkout method used, either "cash" or "points".
paymentProviderIdStringIdentifier of the PaymentProviderApplication used to process payment for this cart, whether for a standard ecommerce payment or a points-plus-pay payment.
paymentStateDataStringIntermediate state data stored by the payment provider handling this cart, such as tokens needed to resume or confirm a payment.
pendingbooleanTrue if this cart has not been submitted yet, ie the customer is still shopping. False once the customer has submitted the order.
phoneStringPhone number of the shipping contact for this order.
pointsParticipantBaseEntityThe entity the redeemed points came from. This may be the purchasing profile itself, or an organisation they have permission to redeem points from.
poNumberStringPurchase order number supplied by the customer for this order.
postcodeStringPostal or zip code of the cart's delivery address.
productOrdersList<ProductOrder>The line items in this cart, each representing a product and quantity ordered.
profileProfileThe profile who placed this order.
promoCodesCsvStringComma-separated list of promotional or voucher codes applied to this cart.
selectedPointsBucketRewardThe loyalty points reward bucket selected for this cart, when the order is being paid for with points.
shippingAddressCartShippingAddressA read-only view of this cart's delivery address, exposed as a plain IReadableAddress for use by payment provider and shipping integrations.
shippingProviderIdStringIdentifier of the shipping provider used to deliver this order.
sourceStringWhere the customer said they heard about the store, captured at checkout.
storeECommerceStoreThe ecommerce store this cart's order was placed through, taken from the first line item that has one.
submittedbooleanTrue if the shopping cart has been submitted, ie the customer has placed the order.
surNameStringSurname of the shipping contact for this order.
totalCostBigDecimalSums the grand total of every line item in the cart. Note that this conventionally returns the ex-tax total.
totalIncTaxBigDecimalThe cart's total cost including tax, ie the sum of getTotalCost and getTotalTax.
totalListPriceBigDecimalAlias for getTotalCost, for compatibility with the ISale interface.
totalQuantityBigDecimalSums the ordered quantity across every line item in the cart.
totalTaxBigDecimalSums the tax amount of every line item in the cart.
trackingCodeStringShipment tracking code issued by the shipping provider for this order.
vendorBaseEntityAlias for getAdminOrg, for compatibility with the ISale interface.
websiteWebsiteThe website the order was placed on.

Methods

getId() · getProfile() · setProfile(Profile profile) · getOrderedForOrg() · setOrderedForOrg(Organisation orderedForOrg) · getCartId() · setCartId(String cartId) · getFirstName() · setFirstName(String firstName) · getSurName() · setSurName(String surName) · getCompany() · setCompany(String company) · getPhone() · setPhone(String phone) · getOrderedDate() · setOrderedDate(Date orderedDate) · getProductOrders() · setProductOrders(List<ProductOrder> productOrders) · getAdminOrg() · setAdminOrg(Organisation adminOrg) · getWebsite() · setWebsite(Website website) · getAddressLine1() · setAddressLine1(String addressLine1) · getAddressLine2() · setAddressLine2(String addressLine2) · getCity() · setCity(String city) · getPostcode() · setPostcode(String postcode) · getAddressState() · setAddressState(String state) · getCountry() · setCountry(String country) · getCartState() · setCartState(ShoppingCartState cartState) · getFulfilmentState() · setFulfilmentState(String fulfilmentState) · getModifiedBy() · setModifiedBy(Profile modifiedBy) · getModifiedDate() · setModifiedDate(Date modifiedDate) · getOrderNotes() · setOrderNotes(String orderNotes) · getPromoCodesCsv() · setPromoCodesCsv(String promoCodesCsv) · getShippingProviderId() · setShippingProviderId(String shippingProviderId) · getTrackingCode() · setTrackingCode(String trackingCode) · getIpAddress() · setIpAddress(String ipAddress) · getBillingAddress() · setBillingAddress(Address billingAddress) · getBillingFirstName() · setBillingFirstName(String billingFirstName) · getBillingSurName() · setBillingSurName(String billingSurName) · getBillingCompany() · setBillingCompany(String billingCompany) · getBillingPhone() · setBillingPhone(String billingPhone) · getSelectedPointsBucket() · setSelectedPointsBucket(Reward selectedPointsBucket) · getNumPoints() · setNumPoints(BigDecimal numPoints) · getPointsParticipant() · setPointsParticipant(BaseEntity pointsParticipant) · getDeliveryNotes() · setDeliveryNotes(String deliveryNotes) · getSource() · setSource(String source) · getPaymentProviderId() · setPaymentProviderId(String paymentProviderId) · getPoNumber() · setPoNumber(String poNumber) · getPaymentMethod() · setPaymentMethod(String paymentMethod) · getPaymentStateData() · setPaymentStateData(String paymentStateData) · getTotalCost() · getTotalTax() · getTotalIncTax() · item(Product product) · item(Long orderItemId) · numItems() · getShippingAddress() · isPending() · isSubmitted() · getActivatedPromotions() · getTotalQuantity() · isFulfilmentComplete() · addProductOrder() · getStore() · getAuditOrg() · getCustomer() · getTotalListPrice() · getVendor()

getId()

Returns: long

The cart's unique database identifier.

getProfile()

Returns: Profile

The profile who placed this order.

setProfile(Profile profile)

Returns: void

Sets the profile who placed this order.

ParameterDescription
profilethe ordering profile, or null to leave the cart unassigned

getOrderedForOrg()

Returns: Organisation

The organisation this order was placed on behalf of, when the ordering profile is buying for an organisation rather than themselves.

setOrderedForOrg(Organisation orderedForOrg)

Returns: void

Sets the organisation this order is placed on behalf of, for a buyer purchasing for an organisation rather than for themselves.

ParameterDescription
orderedForOrgthe organisation the order is for, or null for a personal order

getCartId()

Returns: String

A UUID set from the cookie to allow the final cart to be connected to activity prior to the cart being created.

setCartId(String cartId)

Returns: void

Sets the cart's UUID, which is normally taken from the cookie so the cart can be connected to browsing activity from before the cart existed.

ParameterDescription
cartIdthe UUID to identify this cart by

getFirstName()

Returns: String

First name of the shipping contact for this order.

setFirstName(String firstName)

Returns: void

Sets the first name of the shipping contact for this order.

ParameterDescription
firstNamethe shipping contact's first name

getSurName()

Returns: String

Surname of the shipping contact for this order.

setSurName(String surName)

Returns: void

Sets the surname of the shipping contact for this order.

ParameterDescription
surNamethe shipping contact's surname

getCompany()

Returns: String

Company name of the shipping contact for this order.

setCompany(String company)

Returns: void

Sets the company name of the shipping contact for this order.

ParameterDescription
companythe shipping contact's company name

getPhone()

Returns: String

Phone number of the shipping contact for this order.

setPhone(String phone)

Returns: void

Sets the phone number of the shipping contact for this order.

ParameterDescription
phonethe shipping contact's phone number

getOrderedDate()

Returns: Date

Date the cart was created, ie when the order was placed.

setOrderedDate(Date orderedDate)

Returns: void

Sets the date the order was placed. This column is not nullable, so a cart cannot be saved without it.

ParameterDescription
orderedDatethe date the order was placed

getProductOrders()

Returns: List<ProductOrder>

The line items in this cart, each representing a product and quantity ordered.

setProductOrders(List<ProductOrder> productOrders)

Returns: void

Replaces the cart's list of line items. Prefer addLineItem for adding a single product, which also saves the new line item.

ParameterDescription
productOrdersthe list of line items to hold on this cart

getAdminOrg()

Returns: Organisation

The Kademi account holder organisation this cart belongs to.

setAdminOrg(Organisation adminOrg)

Returns: void

Sets the Kademi account holder organisation this cart belongs to.

ParameterDescription
adminOrgthe owning account organisation

getWebsite()

Returns: Website

The website the order was placed on.

setWebsite(Website website)

Returns: void

Sets the website the order was placed on.

ParameterDescription
websitethe website the cart was created on

getAddressLine1()

Returns: String

First line of the cart's delivery street address.

setAddressLine1(String addressLine1)

Returns: void

Sets the first line of the cart's delivery street address.

ParameterDescription
addressLine1the first line of the delivery address

getAddressLine2()

Returns: String

Second line of the cart's delivery street address, such as a unit or suite number.

setAddressLine2(String addressLine2)

Returns: void

Sets the second line of the cart's delivery street address, such as a unit or suite number.

ParameterDescription
addressLine2the second line of the delivery address

getCity()

Returns: String

City or suburb of the cart's delivery address.

setCity(String city)

Returns: void

Sets the city or suburb of the cart's delivery address.

ParameterDescription
citythe delivery city or suburb

getPostcode()

Returns: String

Postal or zip code of the cart's delivery address.

setPostcode(String postcode)

Returns: void

Sets the postal or zip code of the cart's delivery address.

ParameterDescription
postcodethe delivery postcode

getAddressState()

Returns: String

State or province of the cart's delivery address.

setAddressState(String state)

Returns: void

Sets the state or province of the cart's delivery address.

ParameterDescription
statethe delivery state or province

getCountry()

Returns: String

Country of the cart's delivery address.

setCountry(String country)

Returns: void

Sets the country of the cart's delivery address.

ParameterDescription
countrythe delivery country

getCartState()

Returns: ShoppingCartState

Where this cart is in the checkout lifecycle: PENDING while still being shopped, COMPLETED once submitted, or CANCELLED if abandoned by an administrator.

setCartState(ShoppingCartState cartState)

Returns: void

Moves the cart to a different point in the checkout lifecycle. Setting this directly only changes the stored state, it does not run any checkout or cancellation processing.

ParameterDescription
cartStatethe state to put the cart in: PENDING, COMPLETED or CANCELLED

getFulfilmentState()

Returns: String

The order's fulfilment status code, such as FULFILMENT_NOT_FULFILED, FULFILMENT_COMPLETE or FULFILMENT_DELETED.

setFulfilmentState(String fulfilmentState)

Returns: void

Sets the order's fulfilment status code. Use the FULFILMENT_NOT_FULFILED, FULFILMENT_COMPLETE and FULFILMENT_DELETED constants rather than literal strings.

ParameterDescription
fulfilmentStatethe fulfilment status code to record

getModifiedBy()

Returns: Profile

The profile who last modified this cart.

setModifiedBy(Profile modifiedBy)

Returns: void

Records the profile who last modified this cart. This is not maintained automatically, so a caller changing the cart is responsible for setting it.

ParameterDescription
modifiedBythe profile that made the change

getModifiedDate()

Returns: Date

Date this cart was last modified.

setModifiedDate(Date modifiedDate)

Returns: void

Records the date this cart was last modified. This is not maintained automatically, so a caller changing the cart is responsible for setting it.

ParameterDescription
modifiedDatethe date of the change

getOrderNotes()

Returns: String

Free text notes attached to the order.

setOrderNotes(String orderNotes)

Returns: void

Sets the free text notes attached to the order. The column holds up to 10000 characters.

ParameterDescription
orderNotesthe notes to attach to the order

getPromoCodesCsv()

Returns: String

Comma-separated list of promotional or voucher codes applied to this cart.

setPromoCodesCsv(String promoCodesCsv)

Returns: void

Sets the comma-separated list of promotional or voucher codes applied to this cart. Setting this records the codes only, it does not apply any discount.

ParameterDescription
promoCodesCsvthe applied promo codes as a comma-separated string

getShippingProviderId()

Returns: String

Identifier of the shipping provider used to deliver this order.

setShippingProviderId(String shippingProviderId)

Returns: void

Sets the identifier of the shipping provider used to deliver this order. The column holds up to 50 characters.

ParameterDescription
shippingProviderIdthe shipping provider's ID

getTrackingCode()

Returns: String

Shipment tracking code issued by the shipping provider for this order.

setTrackingCode(String trackingCode)

Returns: void

Sets the shipment tracking code issued by the shipping provider for this order.

ParameterDescription
trackingCodethe tracking code to record against the order

getIpAddress()

Returns: String

The client IP the order was placed from. Recorded so that fraud rules can ask how many orders have come from one address recently, which is not answerable from anything else on this record.

setIpAddress(String ipAddress)

Returns: void

Records the client IP the order was placed from, which fraud rules use to count recent orders from one address. The column holds up to 60 characters.

ParameterDescription
ipAddressthe client IP address, or null for an order placed outside a request

getBillingAddress()

Returns: Address

The billing address recorded for this order, separate from the delivery address.

setBillingAddress(Address billingAddress)

Returns: void

Sets the billing address recorded for this order, which is held separately from the delivery address on the cart itself.

ParameterDescription
billingAddressthe billing address to record

getBillingFirstName()

Returns: String

First name of the billing contact for this order.

setBillingFirstName(String billingFirstName)

Returns: void

Sets the first name of the billing contact for this order.

ParameterDescription
billingFirstNamethe billing contact's first name

getBillingSurName()

Returns: String

Surname of the billing contact for this order.

setBillingSurName(String billingSurName)

Returns: void

Sets the surname of the billing contact for this order.

ParameterDescription
billingSurNamethe billing contact's surname

getBillingCompany()

Returns: String

Company name of the billing contact for this order.

setBillingCompany(String billingCompany)

Returns: void

Sets the company name of the billing contact for this order.

ParameterDescription
billingCompanythe billing contact's company name

getBillingPhone()

Returns: String

Phone number of the billing contact for this order.

setBillingPhone(String billingPhone)

Returns: void

Sets the phone number of the billing contact for this order.

ParameterDescription
billingPhonethe billing contact's phone number

getSelectedPointsBucket()

Returns: Reward

The loyalty points reward bucket selected for this cart, when the order is being paid for with points.

setSelectedPointsBucket(Reward selectedPointsBucket)

Returns: void

Sets the loyalty points reward bucket the points for this order are redeemed from.

ParameterDescription
selectedPointsBucketthe reward bucket to redeem points from, or null if not using points

getNumPoints()

Returns: BigDecimal

Number of loyalty points being redeemed against this cart.

setNumPoints(BigDecimal numPoints)

Returns: void

Sets the number of loyalty points being redeemed against this cart. Setting this records the intent only, it does not deduct any points.

ParameterDescription
numPointsthe number of points to redeem, or null if points are not being used

getPointsParticipant()

Returns: BaseEntity

The entity the redeemed points came from. This may be the purchasing profile itself, or an organisation they have permission to redeem points from.

setPointsParticipant(BaseEntity pointsParticipant)

Returns: void

Sets the entity the redeemed points come from, which may be the purchasing profile itself or an organisation they are allowed to redeem points from.

ParameterDescription
pointsParticipantthe profile or organisation the points come from, or null if not using points

getDeliveryNotes()

Returns: String

Courier or delivery instructions for this order, such as gate codes or drop-off preferences.

setDeliveryNotes(String deliveryNotes)

Returns: void

Sets the courier or delivery instructions for this order, such as gate codes or drop-off preferences. The column holds up to 2000 characters.

ParameterDescription
deliveryNotesthe delivery instructions to record

getSource()

Returns: String

Where the customer said they heard about the store, captured at checkout.

setSource(String source)

Returns: void

Records where the customer said they heard about the store. The column holds up to 1000 characters.

ParameterDescription
sourcethe order source to record

getPaymentProviderId()

Returns: String

Identifier of the PaymentProviderApplication used to process payment for this cart, whether for a standard ecommerce payment or a points-plus-pay payment.

setPaymentProviderId(String paymentProviderId)

Returns: void

Sets the identifier of the PaymentProviderApplication that processes payment for this cart, for either a standard ecommerce payment or a points-plus-pay payment.

ParameterDescription
paymentProviderIdthe payment provider app's ID

getPoNumber()

Returns: String

Purchase order number supplied by the customer for this order.

setPoNumber(String poNumber)

Returns: void

Sets the purchase order number supplied by the customer for this order.

ParameterDescription
poNumberthe customer's purchase order number

getPaymentMethod()

Returns: String

Identifies the checkout method used, either "cash" or "points".

setPaymentMethod(String paymentMethod)

Returns: void

Sets the checkout method used for this cart, either "cash" or "points".

ParameterDescription
paymentMethodthe payment method to record

getPaymentStateData()

Returns: String

Intermediate state data stored by the payment provider handling this cart, such as tokens needed to resume or confirm a payment.

setPaymentStateData(String paymentStateData)

Returns: void

Stores intermediate state data for the payment provider handling this cart, such as tokens needed to resume or confirm a payment. The column holds up to 10000 characters.

ParameterDescription
paymentStateDatathe provider's state data to store

getTotalCost()

Returns: BigDecimal

Sums the grand total of every line item in the cart. Note that this conventionally returns the ex-tax total.

getTotalTax()

Returns: BigDecimal

Sums the tax amount of every line item in the cart.

getTotalIncTax()

Returns: BigDecimal

The cart's total cost including tax, ie the sum of getTotalCost and getTotalTax.

item(Product product)

Returns: ProductOrder

Finds the line item in this cart for the given product.

ParameterDescription
productthe product to look for

item(Long orderItemId)

Returns: ProductOrder

Returns the line item with the given id.

ParameterDescription
orderItemIdthe id of the line item to look for

numItems()

Returns: int

The number of line items in this cart.

getShippingAddress()

Returns: CartShippingAddress

A read-only view of this cart's delivery address, exposed as a plain IReadableAddress for use by payment provider and shipping integrations.

isPending()

Returns: boolean

True if this cart has not been submitted yet, ie the customer is still shopping. False once the customer has submitted the order.

isSubmitted()

Returns: boolean

True if the shopping cart has been submitted, ie the customer has placed the order.

getActivatedPromotions()

Returns: Set<Reward>

The promotional rewards that have been activated against this cart.

getTotalQuantity()

Returns: BigDecimal

Sums the ordered quantity across every line item in the cart.

isFulfilmentComplete()

Returns: boolean

True if the order's fulfilment state is FULFILMENT_COMPLETE.

addProductOrder()

Returns: ProductOrder

Creates a new, empty line item, adds it to this cart's line items and returns it for the caller to populate.

getStore()

Returns: ECommerceStore

The ecommerce store this cart's order was placed through, taken from the first line item that has one.

getAuditOrg()

Returns: Organisation

The organisation that audit entries for changes to this cart are recorded against, per the Auditable interface.

getCustomer()

Returns: BaseEntity

Alias of getProfile, for compatibility with the ISale interface.

getTotalListPrice()

Returns: BigDecimal

Alias for getTotalCost, for compatibility with the ISale interface.

getVendor()

Returns: BaseEntity

Alias for getAdminOrg, for compatibility with the ISale interface.

To get full access to the Kademi Hub existing customers can login here, or new customers can register here.