interface Cart {
    anonymousId?: string;
    billingAddress?: Address;
    businessUnit?: BusinessUnitKeyReference;
    cartState: string;
    country?: string;
    createdAt: string;
    createdBy?: CreatedBy;
    custom?: CustomFields;
    customLineItems: CustomLineItem[];
    customerEmail?: string;
    customerGroup?: CustomerGroupReference;
    customerId?: string;
    deleteDaysAfterLastModification?: number;
    directDiscounts: DirectDiscount[];
    discountCodes: DiscountCodeInfo[];
    discountOnTotalPrice?: DiscountOnTotalPrice;
    id: string;
    inventoryMode: string;
    itemShippingAddresses: Address[];
    key?: string;
    lastModifiedAt: string;
    lastModifiedBy?: LastModifiedBy;
    lineItems: LineItem[];
    locale?: string;
    origin: string;
    paymentInfo?: PaymentInfo;
    refusedGifts: CartDiscountReference[];
    shipping: Shipping[];
    shippingAddress?: Address;
    shippingCustomFields?: CustomFields;
    shippingInfo?: ShippingInfo;
    shippingKey?: string;
    shippingMode: string;
    shippingRateInput?: ShippingRateInput;
    store?: StoreKeyReference;
    taxCalculationMode: string;
    taxMode: string;
    taxRoundingMode: string;
    taxedPrice?: TaxedPrice;
    taxedShippingPrice?: TaxedPrice;
    totalLineItemQuantity?: number;
    totalPrice: CentPrecisionMoney;
    version: number;
}

Hierarchy (view full)

Properties

anonymousId?: string

Anonymous session associated with the Cart.

billingAddress?: Address

Billing address associated with the Cart.

businessUnit?: BusinessUnitKeyReference

Reference to a Business Unit the Cart belongs to.

cartState: string

Current status of the Cart.

country?: string
createdAt: string

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

createdBy?: CreatedBy

IDs and references that created the Cart.

custom?: CustomFields

Custom Fields of the Cart.

customLineItems: CustomLineItem[]

Custom Line Items added to the Cart.

customerEmail?: string

Email address of the Customer that the Cart belongs to.

customerGroup?: CustomerGroupReference

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

customerId?: string

id of the Customer that the Cart belongs to.

deleteDaysAfterLastModification?: number

Number of days after which an active Cart is deleted since its last modification. Configured in Project settings.

directDiscounts: DirectDiscount[]

Direct Discounts added to the Cart. A Cart that has discountCodes cannot have directDiscounts.

discountCodes: DiscountCodeInfo[]

Discount Codes applied to the Cart. A Cart that has directDiscounts cannot have discountCodes.

discountOnTotalPrice?: DiscountOnTotalPrice

Discounts that apply on the Cart totalPrice.

id: string

Unique identifier of the Cart.

inventoryMode: string

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

itemShippingAddresses: Address[]

Additional shipping addresses of the Cart as specified by LineItems using the shippingDetails field.

For Carts with `Single` [ShippingMode](ctp:api:type:ShippingMode): eligible Shipping Methods or applicable Tax Rates are determined by the address in `shippingAddress`, and not `itemShippingAddresses`.
key?: string

User-defined unique identifier of the Cart.

lastModifiedAt: string

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

lastModifiedBy?: LastModifiedBy

IDs and references that last modified the Cart.

lineItems: LineItem[]

Line Items added to the Cart.

locale?: string

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

origin: string

Indicates how the Cart was created.

paymentInfo?: PaymentInfo

Payment information related to the Cart.

refusedGifts: CartDiscountReference[]

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

shipping: Shipping[]

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

shippingAddress?: Address

Shipping address for a Cart with Single ShippingMode. Determines eligible ShippingMethod rates and Tax Rates of Line Items.

shippingCustomFields?: CustomFields

Custom Fields of the Shipping Method in a Cart with Single ShippingMode.

shippingInfo?: ShippingInfo

Shipping-related information of a Cart with Single ShippingMode. Automatically set when a Shipping Method is set.

shippingKey?: string

User-defined unique identifier of the Shipping Method in a Cart with Single ShippingMode.

shippingMode: string

Indicates whether the Cart has one or multiple Shipping Methods.

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](ctp:api:type:ClassificationShippingRateInput).
- If `CartScore`, it is [ScoreShippingRateInput](ctp:api:type:ScoreShippingRateInput).
- If `CartValue`, it cannot be used.
store?: StoreKeyReference

Reference to a Store the Cart belongs to.

taxCalculationMode: string

Indicates how taxes are calculated when calculating taxes for taxedPrice.

taxMode: string

Indicates how Tax Rates are set.

taxRoundingMode: string

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

taxedPrice?: TaxedPrice
  • For a Cart with Platform TaxMode, it is automatically set when a shipping address is set. For Carts with Multiple ShippingMode, all Line Items and Custom Line Items must be fully distributed between the Shipping Methods (via shippingDetails), otherwise taxedPrice is not automatically set.

    • For a Cart with 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. For Carts with Multiple ShippingMode, all allocations must have their respective tax rates present in perMethodTaxRate, otherwise taxedPrice is not automatically set.

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

taxedShippingPrice?: TaxedPrice

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

totalLineItemQuantity?: number

Sum of all LineItem quantities, excluding CustomLineItems. Only present when the Cart has at least one LineItem.

totalPrice: CentPrecisionMoney

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](ctp:api:type:TaxRate) `includedInPrice` is `true` for each price.
version: number

Current version of the Cart.