@gradientedge/commercetools-utils
    Preparing search index...

    Interface Cart

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

    Hierarchy (View Summary)

    Index

    Properties

    anonymousId?: string

    Anonymous session associated with the Cart.

    billingAddress?: Address

    Billing address associated with the Cart.

    Reference to a Business Unit the Cart belongs to. Only available for B2B-enabled Projects.

    cartState: CartState

    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.

    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.

    customLineItems: CustomLineItem[]

    Custom Line Items added to the Cart.

    deleteDaysAfterLastModification?: number

    Number of days after the last modification before a Cart is deleted. 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.

    discountTypeCombination?: DiscountTypeCombination

    Indicates if a combination of discount types can apply on a Cart.

    id: string

    Unique identifier of the Cart.

    inventoryMode: InventoryMode

    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: CartOrigin

    Indicates how the Cart was created.

    paymentInfo?: PaymentInfo

    Payment information related to the Cart.

    priceRoundingMode: RoundingMode

    Indicates how the total prices on LineItems and CustomLineItems are rounded when calculated. Configured in Project settings.

    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: ShippingMode

    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.
    

    Reference to a Store the Cart belongs to.

    taxCalculationMode: TaxCalculationMode

    Indicates how taxes are calculated 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 proportionally discounted value.

    taxedShippingPrice?: TaxedPrice

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

    If a discount applies on `totalPrice`, this field holds the proportionally discounted value.
    
    taxMode: TaxMode

    Indicates how Tax Rates are set.

    taxRoundingMode: RoundingMode

    Indicates how monetary values are rounded when calculating taxes for taxedPrice. Configured in Project settings.

    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.