Skip to content

Cart types

The types the cart domain defines, with the fields other domains add to them.

Objects

AddressSuggestion

An address offered while the buyer types, to be resolved once chosen

FieldTypeDescription
idID!Opaque; pass it to addressResolve
labelString!The address as the buyer reads it in a list
cityString
countryCountryCode
streetNumberString
streetNumberSuffixString
postalCodeString
streetNameString

AddressValidationResult

FieldTypeDescription
validBoolean!
suggestions[AddressSuggestion]

AppliedDiscount

A discount applied to a cart or one of its lines, by the name it is known by.

FieldTypeDescription
idID!Identifier of the discount
nameStringThe discount's name in the store's language. Null where it has none.
amountMoney!What the discount takes off, as a positive amount.
validUntilDateTimeThe last moment the discount applies, where it ends. Null where it does not end, or the engine does not tell.

Cart

Fields added by Delivery options, Multiple carts and Order approval

Shopping cart containing line items and checkout information

FieldTypeDescription
idID!Unique identifier of the cart. Stable for the cart's whole life, so a client may key a cache on it.
versionStringOpaque optimistic-concurrency token, present only for engines that version their resources. Pass it back verbatim; never parse or compare it.
createdAtDateTime!Creation date of the cart
lastModifiedAtDateTime!Last modified date of the cart
currencyCurrency!The currency used in the cart
customerEmailStringCustomer email
isGuestBoolean!Indicates if the cart is a guest cart
lineItems[CartLineItem!]!Line items in the cart
totalQuantityInt!Total quantity of all line items
changes[CartLineChange!]!What changed since the session last acknowledged the cart, oldest first: sold-out lines, price changes against the price at the time of adding, and lowered quantities. Listed until cartChangesAcknowledge, so a notice shows them once.
unavailableLineItems[CartLineItem!]!Lines that cannot be ordered now, such as sold out. They are kept out of the totals and out of the order. Empty where the engine cannot keep them: those are removed instead, and listed in changes as REMOVED.
subTotalTaxedTotalPrice!Sum of all line items (i.e. price excluding all shipping and payment costs)
totalTaxedTotalPrice!Sum of all line items (i.e. price including all shipping and payment costs)
discountTotalTaxedPriceDiscount applied to the cart total, on top of any discount already reflected in the line items. A positive magnitude: subtract it, never add it. Showing it as a negative amount is a presentation choice, not a property of the data. Taxed like the amounts it has to be arithmetic with, so a summary reconciles in one basis: subTotal minus this plus shippingCosts equals total. The rate is the effective rate over the discounted goods -- exact for a single-rate basket, a blend where the basket mixes rates.
discountCodes[CartDiscountCode!]!Discount codes that are applied to the cart
appliedDiscounts[AppliedDiscount!]Every discount the cart applies, on its total, its lines or its shipping, with what it takes off in all: the names a summary explains the price with. A reduced price the product itself carries is not one of them. A discount reached through a code is also in discountCodes; the rest are automaticDiscounts. Null where the engine does not report its discounts.
automaticDiscounts[AppliedDiscount!]The discounts the cart gets without a code, such as an automatic promotion, each with what it takes off: the entries of appliedDiscounts that no code brought, so adding the two lists counts these twice. Together with discountCodes they explain discountTotal row by row. Null where the engine does not report its discounts.
billingAddressAddressCustomer billing address
shippingAddressAddressCustomer shipping address
shippingCostsTaxedPriceShipping costs, if any
estimatedShippingCostsTaxedPriceWhat shipping will likely cost while no shipping method is set, so a summary can show a total before checkout. An estimate: null once shippingCosts is known, and where the engine has nothing to base one on.
freeDeliveryCartFreeDeliveryHow far the cart is from free delivery: the goods total at which shipping becomes free, and how much is still to add. Read from the chosen shipping method's rate, or the default method's for the store's country while none is chosen. Null where that rate has no free threshold, and where the cart ships outside the store's country without a method chosen.
complementaryProducts[ProductVariant!]!Products to suggest alongside what is in the cart, such as below its lines: the complementary products of its lines, the most recently added line's first, without those already in the cart, and only what can be sold in the store and is in stock. At most limit of them, and never more than 10.Arguments: limit
selectedShippingMethodShippingMethodSelected shipping method for the cart
preselectedShippingMethodShippingMethodThe shipping method the delivery step starts on: the selected one once there is one, otherwise the default method for the shipping address's country or, before there is an address, the store's. Its price is what the cart is charged for it, after the rate's tiers and free threshold, and with the delivery options composed its carrier and deliveryEstimate say who brings it and when. Null when no method ships there.
selectedPaymentMethodPaymentMethodSelected payment method for the cart
amountToPayMoney!What the buyer still has to pay: the gross total less everything the cart's payments have reserved or collected. Equal to the gross total while no payment holds anything. A partial payment such as a gift card lowers this and never total, subTotal, discountTotal or any tax: the price of the goods is the same whoever pays for it.
payments[CartPayment!]!The payments on the cart, oldest first. A cart can carry several: partial payments such as gift cards, and the payment that pays the rest.
availableShippingMethods[ShippingMethod!]!Shipping methods that are available for the cart
deliveryRemarksStringNote for whoever delivers the goods, as the buyer typed it -- "please leave it under the shelter". Carried to the order. Null until someone records one.
vatNumberStringThe VAT number of the company the buyer orders for, as recorded at checkout. Carried to the order. Null until someone records one. A verified number can make the cart reverse-charged; see vatOutcome.
vatShiftingMoneyThe amount of a reverse-charge line, negative and already reflected in total, where one is carried. A reverse-charged cart is taxed at 0% and gets no such line, so this is null on it.Deprecated: A reverse-charged cart is taxed at 0%; read vatOutcome and the taxed totals.
vatExemptionMoneyThe amount of an export line, negative and already reflected in total, where one is carried. An exported cart is taxed at 0% and gets no such line, so this is null on it.Deprecated: An exported cart is taxed at 0%; read vatOutcome and the taxed totals.
vatOutcomeVatOutcomeWhich VAT rule the cart's amounts follow, and why, so a checkout can explain them. Decided by the delivery country and the buyer's VAT number, or for a cart bought for a business unit, the company's VAT registrations; the billing country never counts. Null until the cart has a delivery address or a pickup at the seller, and where the engine does not decide VAT itself. The rules are the standard EU rules for goods and have not been reviewed by a tax advisor.
purchaseOrderNumberStringThe buyer's own reference for this purchase, usually a purchase order number. Carried to the resulting order so a finance team can match it against their own paperwork. Null until someone records one, which only an associate of the cart's business unit can, through cartSetPurchaseOrderNumber.
minimumOrderB2BCartMinimumOrderThe business unit's minimum order value. Null when the unit has none, when it is set in another currency than the cart's, and for a cart that is not a business unit's. Below it orderPlace is refused; requesting a quote is not.
availablePaymentMethods[PaymentMethod!]!Payment methods that are available for the cartArguments: device
deliveryDates[DeliveryDate!]!The dates the cart can be delivered on, each with its time slots, starting at from (today when absent) and covering the given number of days. Every date in the range is listed, including those with nothing to offer, so a date picker can show them disabled with their reason. Empty while the cart has no shipping address to deliver to.Arguments: from, days
deliverySlotDeliverySlotThe delivery slot chosen for the cart. Null until one is chosen.
pickupPoints[PickupPoint!]!Pickup points the cart can be collected from, nearest first, including those that cannot be chosen. Searched around near, or the shipping address when near is absent; empty when there is neither. carrierKeys narrows the list to those carriers.Arguments: near, carrierKeys, limit
pickupPointPickupPointThe pickup point chosen for the cart. Null until one is chosen.
deliverySplitDeliverySplitType!Whether the cart ships once, when every line is in stock, or ships what is in stock now and the backordered rest later. COMPLETE until chosen.
requestedDeliveryDateDateThe date the buyer asked to receive the delivery on. Null until asked.
earliestCompleteDeliveryDateDateThe first date every line is in stock, which is when a complete delivery can leave at the earliest. Null when nothing is backordered, or when a backordered line has no expected date; the lines say which.
nameStringBuyer-given name, to tell one cart from another. Null until a cart is named.
defaultNameStringWhat to call the cart while it has no name: its first product, then a plus and the number of further products, such as "Accuboormachine + 2". Language-neutral, so a storefront needs no wording for it. Given whether or not the cart is named; null for an empty cart, where a storefront shows its own label.
previewImages[ProductImage!]!Images of the cart's first products, one per line in the order they were added and none repeated, so a cart list shows what each cart holds. Add-ons are left out, as is a line without an image. At most 10, whatever the limit asks for; empty for an empty cart.Arguments: limit
ownerCustomerThe person whose cart this is. Null for a guest cart, which belongs to a session rather than to anyone.
statusCartStatusType!Whether the cart is in use or archived. A cart nobody has touched for 60 days, or the period the service configures, is archived: it leaves the unit's cart list unless that is asked for. The caller's current cart is never archived, so choosing one with cartSetCurrent makes it read ACTIVE.
approvalRequirementCartApprovalRequirementWhat placing the cart now waits for. Null when it needs no approval, and for a cart that is not a business unit's.

CartChangesAcknowledgeResponse

Response for acknowledging a cart's changes

FieldTypeDescription
cartCartThe cart, with no changes listed
cartErrors[CartChangesAcknowledgeError!]Error details if the changes could not be acknowledged

CartCreateResponse

Response for creating a cart

FieldTypeDescription
cartCartThe cart that was created
cartErrors[CartCreateError!]Error details if the cart could not be created

CartDiscountCode

A CartDiscountCode represents a discount that is applied to the cart

FieldTypeDescription
idID!Unique identifier for the discount code
codeString!The discount code string used
amountMoney!The discount amount applied
nameStringWhat the code is called in the store's language, to label its row. Null where neither the code nor its discount is named, or the engine does not tell.
validUntilDateTimeThe last moment the code applies, where it ends. Null where it does not end, or the engine does not tell.

CartDiscountCodeAddResponse

Response for adding discount code to cart

FieldTypeDescription
cartCartCart information after discount code is added
cartErrors[CartDiscountCodeAddError!]Error details if discount code addition failed

CartDiscountCodeRemoveResponse

Response for removing discount code from cart

FieldTypeDescription
cartCartCart information after discount code is removed
cartErrors[CartDiscountCodeRemoveError!]Error details if discount code removal failed

CartFreeDelivery

How far a cart is from free delivery

FieldTypeDescription
thresholdMoney!The goods total at which shipping becomes free
remainingMoney!What is still to add to the goods total; zero once it is reached

CartLineChange

One change to a line since the buyer last acknowledged the cart

FieldTypeDescription
typeCartLineChangeType!
lineItemCartLineItemThe line as it is now; null for REMOVED, whose line is gone
skuString!The SKU when the change happened, for a REMOVED line that has none to read
productNameString!The product name when the change happened, for a REMOVED line
previousUnitPriceTaxedPriceThe unit price when the line was added, for PRICE_CHANGED
unitPriceTaxedPriceThe unit price now, for PRICE_CHANGED
previousQuantityIntWhat the buyer had, for QUANTITY_REDUCED

CartLineItemAddResult

The outcome for one requested line.

FieldTypeDescription
skuString!The SKU as requested.
quantityInt!The quantity as requested.
failureCartLineItemAddFailureTypeWhy the line was not added. Null when it was.
messageStringDeveloper/debug description of the failure. Not localized and never shown to end users. Null when the line was added.

CartLineItemBackorder

The part of a cart line that cannot ship now.

FieldTypeDescription
backorderedQuantityInt!How many of the line's items are not in stock.
expectedAvailableDateDateWhen they are expected back in stock. Null when nobody knows.

CartLineItemsAddResponse

Response for adding line items to cart

FieldTypeDescription
cartCartCart information after line items are added
lineResults[CartLineItemAddResult!]One result per requested line, in the order requested: added, or why not. Lines that can be added are added even when others cannot. Null when the request failed as a whole, which cartErrors then says.
addedQuantityIntHow many items were added in total, counted by quantity.
addedAmountMoneyWhat the added lines add to the cart total. Null when the request failed as a whole.
cartErrors[CartLineItemsAddError!]Error details if line item addition failed

CartLineItemsRemoveResponse

Response for removing line items from cart

FieldTypeDescription
cartCartCart information after line items are removed
cartErrors[CartLineItemsRemoveError!]Error details if line item removal failed

CartLineItemsUpdateResponse

Response for updating line items in cart

FieldTypeDescription
cartCartCart information after line items are updated
lineResults[CartLineItemUpdateResult!]One result per requested change, in the order requested. The changes that can be made are, even when others are refused. Null when the request failed as a whole, which cartErrors then says, and where the engine reports no result per line.
cartErrors[CartLineItemsUpdateError!]Error details if line item update failed

CartLineItemUpdateResult

The outcome for one requested quantity change. A refused line keeps the quantity it had.

FieldTypeDescription
idString!The line id as requested.
quantityInt!The quantity as requested.
failureCartLineItemUpdateFailureTypeWhy the quantity was not changed. Null when it was.
messageStringDeveloper/debug description of the failure. Not localized and never shown to end users. Null when the quantity was changed.

CartLineQuantityRule

How many of a line can be ordered. The bounds are multiples of step, so a minimum of 1 in packs of 6 is 6.

FieldTypeDescription
minimumInt!The least that can be ordered; step when the variant has no minimum.
maximumIntThe most that can be ordered now: the variant's maximum per line or the stock that can ship, whichever is lower. Null when neither limits it.
maximumReasonCartLineQuantityLimitTypeWhy maximum is what it is. Null when maximum is.
stepInt!Quantities go up in this step, the pack size; 1 when it is not sold in packs.

CartMinimumOrder

B2B only

How far a business unit's cart is from the unit's minimum order value

FieldTypeDescription
minimumB2BMoney!The unit's minimum, on the goods after discounts, before tax and shipping.
missingB2BMoney!What the cart still lacks, on the same total: before tax and excluding shipping. Zero once it reaches the minimum.

CartPayment

A payment on a cart, as far as a buyer needs to see it.

FieldTypeDescription
idID!Identifier of the payment
providerString!The provider that handles the payment, such as the gift card provider
methodString!The payment method within that provider
amountMoney!What the payment covers of the amount to pay
statusCartPaymentStatusType!How far the payment has got

CartPaymentRemoveResponse

Response for removing a payment from the cart

FieldTypeDescription
cartCartCart information after the payment is removed
cartErrors[CartPaymentRemoveError!]Error details if the payment could not be removed

CartSetDeliveryRemarksResponse

Response for recording a delivery note on a cart

FieldTypeDescription
cartCartThe cart carrying the note
cartErrors[CartSetDeliveryRemarksError!]Error details if the note could not be recorded

CartSetPurchaseOrderNumberResponse

B2B only

Response for recording the buyer's purchase reference on a cart

FieldTypeDescription
cartB2BCartThe cart carrying the reference
cartErrorsB2B[CartSetPurchaseOrderNumberError!]Error details if the reference could not be recorded

CartSetVatNumberResponse

Response for recording a VAT number on a cart

FieldTypeDescription
cartCartThe cart carrying the VAT number
cartErrors[CartSetVatNumberError!]Error details if the VAT number could not be recorded

CartSingleLineItem

Implements CartLineItem

Individual line item in a cart

FieldTypeDescription
idID!Unique identifier for the line item
productNameString!Product name for the line item
productSlugStringProduct slug for URL generation
variantProductVariant!Product variant details
quantityInt!Number of items in the line item
availableStockInt!Available stock for the product variant
priceWhenAddedMoneyThe unit price before discounts when the line was added. Null where it was not recorded, such as for a line added before the engine kept it.
priceChangedBoolean!Whether the unit price before discounts is not what it was when the line was added. A discount the buyer applied is not a change. False where the price when added is not known.
quantityRuleCartLineQuantityRule!How many of this line can be ordered and in which steps, for the quantity stepper. cartLineItemsAdd and cartLineItemsUpdate refuse a quantity outside it, per line.
roleCartLineItemRoleTypeWhat this line is to another line. Null for an ordinary line.
addOns[CartLineItem!]The lines that belong to this one, such as its add-ons. Empty when none do; null when the engine does not link lines.
backorderCartLineItemBackorderHow much of the line cannot ship now, and when it can. Null when the whole quantity is in stock, or when no stock is tracked for the variant.
appliedDiscounts[AppliedDiscount!]The cart's discounts on this line, with what each takes off the whole line. A reduced price the product itself carries is not one of them. Null where the engine does not report its discounts.
addedAtDateTimeWhen the line item was added to the cart
priceTaxedPrice!The final price for the whole line, after discounts: the unit price multiplied by the quantity. This is not a unit price -- divide by quantity at the call site if you need one, as there is no rounding-safe per-unit field.
regularPriceTaxedPrice!The regular selling price for the whole line, before any additional discount. Same basis as the final price: unit price multiplied by quantity.
listPriceTaxedPrice!The list price (MSRP) for the whole line, on the same basis as the other two. An engine that carries no separate MSRP reports the regular price here, so the two can be equal.

CartUpdateResponse

Response for cart update operations

FieldTypeDescription
cartCartCart information after update
cartErrors[CartUpdateError!]Error details if update failed

ShippingMethod

Fields added by Delivery options

A way the cart can be shipped, at the price it would be charged.

FieldTypeDescription
idID!Unique identifier of the shipping method
keyString!Unique key of the shipping method
nameString!Name of the shipping method
descriptionStringDescription of the shipping method
priceMoney!Price of the shipping method.
carrierCarrierWho delivers with this method, for the delivery step to show by name and, through its key, by logo. Null when the delivery provider does not say.
deliveryEstimateDeliveryEstimateWhen an order placed now with this method arrives, if every line is in stock. Null when the delivery provider gives no estimate. A cart with backordered lines arrives no earlier than its earliestCompleteDeliveryDate.

Input objects

CartAddOnInput

An add-on to add with a line.

FieldTypeDescription
skuString!SKU of the add-on
quantityInt!Quantity of the add-onDefault 1

CartLineItemAddInput

Input for creating a new line item

FieldTypeDescription
skuString!SKU of the product variant
quantityInt!Quantity to add
addOns[CartAddOnInput!]Add-ons for this line, such as an extra warranty: each its own line, linked to this one and removed with it.

CartLineItemUpdateInput

Input for updating an existing line item

FieldTypeDescription
idString!Line item ID to update
quantityInt!New quantity for the line item

CartSetBillingAddressInput

Input for setting billing address on cart

FieldTypeDescription
addressAddressInputCustomer billing address

CartSetCustomerEmailInput

Input for setting customer email on cart

FieldTypeDescription
emailStringCustomer email

CartSetPaymentMethodInput

Input for setting payment method on cart

FieldTypeDescription
paymentMethodPaymentMethodInputSelected payment method for the cart

CartSetShippingAddressInput

Input for setting shipping address on cart

FieldTypeDescription
addressAddressInputCustomer shipping address

CartSetShippingMethodInput

Input for setting shipping method on cart

FieldTypeDescription
shippingMethodShippingMethodInputSelected shipping method for the cart

CartUpdateAction

Union of all cart update actions

FieldTypeDescription
setCustomerEmailCartSetCustomerEmailInputSet customer email
setBillingAddressCartSetBillingAddressInputSet billing address
setShippingAddressCartSetShippingAddressInputSet shipping address
setShippingMethodCartSetShippingMethodInputSet shipping method
setPaymentMethodCartSetPaymentMethodInputSet payment method

ShippingMethodInput

Input for selecting a shipping method

FieldTypeDescription
idString!ID of the shipping method

Enums

CartLineChangeType

What happened to a line since the buyer last acknowledged the cart

SOLD_OUTSold out since; the line is now in Cart.unavailableLineItems
PRICE_CHANGEDIts unit price before discounts is not what it was when the line was added; a discount the buyer applied is not a change
QUANTITY_REDUCEDIts quantity was lowered to what can still be ordered
REMOVEDIt was taken out of the cart, by an engine that cannot keep an unavailable line

CartLineItemAddFailureType

Why a requested line was not added.

NOT_FOUNDNo variant has the SKU.
NOT_FOR_SALEThe variant has no price for this store, currency and customer.
OUT_OF_STOCKThere is not enough stock for the quantity.
BELOW_MINIMUM_QUANTITYThe quantity is below the variant's minimum order quantity.
ABOVE_MAXIMUM_QUANTITYThe line's quantity would be above the variant's maximum per line.
NOT_A_MULTIPLE_OF_PACK_SIZEThe line's quantity would not be a whole number of packs.
OTHERSomething else refused the line. See the message.

CartLineItemRoleType

What a line is to another line in the cart.

ADD_ONAn add-on to its main line, such as an extra warranty, removed with it.
BUNDLE_EXTRAAn extra bought with its main line as a bundle, at the bundle's discount. It stays when the main line goes, without the discount.

CartLineItemUpdateFailureType

Why a line's quantity was not changed.

NOT_FOUNDNo line of the cart has the id.
BELOW_MINIMUM_QUANTITYThe quantity is below the variant's minimum order quantity.
ABOVE_MAXIMUM_QUANTITYThe quantity is above the line's maximum: see CartLineQuantityRule.
NOT_A_MULTIPLE_OF_PACK_SIZEThe quantity is not a whole number of packs.

CartLineQuantityLimitType

What limits the quantity of a line.

LINE_MAXIMUMThe variant's maximum per line.
STOCKThe stock that can ship; the variant takes no backorders.

CartPaymentStatusType

How far a payment on a cart has got.

RESERVEDThe money is held for the cart and has not been taken
PENDINGThe provider has not yet reported an outcome
COLLECTEDThe money has been taken
FAILEDThe payment failed or was cancelled and holds nothing

Interfaces

CartLineItem

Interface for cart line items

FieldTypeDescription
idID!Unique identifier for the line item
quantityInt!Number of items in the line item
roleCartLineItemRoleTypeWhat this line is to another line. Null for an ordinary line.
addOns[CartLineItem!]The lines that belong to this one, such as its add-ons. Empty when none do; null when the engine does not link lines.
backorderCartLineItemBackorderHow much of the line cannot ship now, and when it can. Null when the whole quantity is in stock, or when no stock is tracked for the variant.
appliedDiscounts[AppliedDiscount!]The cart's discounts on this line, with what each takes off the whole line. A reduced price the product itself carries is not one of them. Null where the engine does not report its discounts.
priceTaxedPrice!The final price for the whole line, after discounts: the unit price multiplied by the quantity. This is not a unit price -- divide by quantity at the call site if you need one, as there is no rounding-safe per-unit field.
regularPriceTaxedPrice!The regular selling price for the whole line, before any additional discount. Same basis as the final price: unit price multiplied by quantity.
listPriceTaxedPrice!The list price (MSRP) for the whole line, on the same basis as the other two. An engine that carries no separate MSRP reports the regular price here, so the two can be equal.

Implemented by CartSingleLineItem.

Unions

CartChangesAcknowledgeError

One of ValidationError or CartError.

CartCreateError

Error union for cart create

One of ValidationError or CartError.

CartDiscountCodeAddError

Error union for cart discount code add

One of ValidationError or CartError.

CartDiscountCodeRemoveError

Error union for cart discount code remove

One of ValidationError or CartError.

CartLineItemsAddError

Error union for cart line items add

One of ValidationError or CartError.

CartLineItemsRemoveError

Error union for cart line items remove

One of ValidationError or CartError.

CartLineItemsUpdateError

Error union for cart line items update

One of ValidationError or CartError.

CartPaymentRemoveError

One of ValidationError or CartError.

CartSetDeliveryRemarksError

Error union for recording a delivery note

One of ValidationError or CartError.

CartSetPurchaseOrderNumberError

B2B only

Error union for recording a purchase reference

One of ValidationError or CartError.

CartSetVatNumberError

Error union for recording a VAT number

One of ValidationError or CartError.

CartUpdateError

Error union for cart update

One of ValidationError or CartError.