interface CartDraft {
    anonymousId?: string;
    billingAddress?: _BaseAddress;
    businessUnit?: BusinessUnitResourceIdentifier;
    country?: string;
    currency: string;
    custom?: CustomFieldsDraft;
    customLineItems?: CustomLineItemDraft[];
    customShipping?: CustomShippingDraft[];
    customerEmail?: string;
    customerGroup?: CustomerGroupResourceIdentifier;
    customerId?: string;
    deleteDaysAfterLastModification?: number;
    discountCodes?: string[];
    externalTaxRateForShippingMethod?: ExternalTaxRateDraft;
    inventoryMode?: string;
    itemShippingAddresses?: BaseAddress[];
    key?: string;
    lineItems?: LineItemDraft[];
    locale?: string;
    origin?: string;
    shipping?: ShippingDraft[];
    shippingAddress?: _BaseAddress;
    shippingMethod?: ShippingMethodResourceIdentifier;
    shippingMode?: string;
    shippingRateInput?: ShippingRateInputDraft;
    store?: StoreResourceIdentifier;
    taxCalculationMode?: string;
    taxMode?: string;
    taxRoundingMode?: string;
}

Properties

anonymousId?: string

Anonymous session associated with the Cart.

billingAddress?: _BaseAddress

Billing address associated with the Cart.

businessUnit?: BusinessUnitResourceIdentifier

ResourceIdentifier to the Business Unit the Cart should belong to. When the customerId of the Cart is also set, the Customer must be an Associate of the Business Unit.

country?: string

Used for Line Item price selection. If used for Create Cart in Store, the provided country must be one of the Store's countries.

currency: string

Currency the Cart uses.

Custom Fields for the Cart.

customLineItems?: CustomLineItemDraft[]

Custom Line Items to add to the Cart.

customShipping?: CustomShippingDraft[]

Custom Shipping Methods for a Cart with Multiple ShippingMode.

customerEmail?: string

Email address of the Customer that the Cart belongs to.

customerGroup?: CustomerGroupResourceIdentifier

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

It is automatically set if the Customer referenced in `customerId` belongs to a Customer Group.
It can also be set explicitly when no `customerId` is present.
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. If not provided, the default value for this field configured in Project settings is assigned.

Create a [ChangeSubscription](ctp:api:type:ChangeSubscription) for Carts to receive a [ResourceDeletedDeliveryPayload](ctp:api:type:ResourceDeletedDeliveryPayload) upon deletion of the Cart.
discountCodes?: string[]

code of the existing DiscountCodes to add to the Cart.

externalTaxRateForShippingMethod?: ExternalTaxRateDraft

External Tax Rate for the shippingMethod if the Cart has External TaxMode.

inventoryMode?: string

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

itemShippingAddresses?: BaseAddress[]

Multiple shipping addresses of the Cart. Each address must contain a key that is unique in this Cart. The keys are used by LineItems to reference these addresses under their shippingDetails.

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

User-defined unique identifier for the Cart.

lineItems?: LineItemDraft[]

Line Items to add 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.

shipping?: ShippingDraft[]

Shipping Methods for a Cart with Multiple ShippingMode.

shippingAddress?: _BaseAddress

Shipping address for a Cart with Single ShippingMode. Determines eligible ShippingMethod rates and Tax Rates of Line Items. Must be one of the itemShippingAddresses when that field is also provided.

Shipping Method for a Cart with Single ShippingMode. If the referenced ShippingMethod has a predicate that does not match the Cart, an InvalidOperation error is returned when creating a Cart.

shippingMode?: string
  • If set to Single, only a single Shipping Method can be added to the Cart.
    • If set to Multiple, multiple Shipping Methods can be added to the Cart.
shippingRateInput?: ShippingRateInputDraft

Used as an input to select a ShippingRatePriceTier. The data type of this field depends on the shippingRateInputType.type configured in the Project:

- If `CartClassification`, it must be [ClassificationShippingRateInputDraft](ctp:api:type:ClassificationShippingRateInputDraft).
- If `CartScore`, it must be [ScoreShippingRateInputDraft](ctp:api:type:ScoreShippingRateInputDraft).
- If `CartValue`, it cannot be set.
store?: StoreResourceIdentifier

ResourceIdentifier to the Store the Cart should belong to. Once set, it cannot be updated.

taxCalculationMode?: string

Determines how taxes are calculated for taxedPrice.

taxMode?: string

Determines how Tax Rates are set.

taxRoundingMode?: string

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