Skip to content

cartSetDeliveryPreference

Mutationin Delivery options

Choose whether the cart ships complete or split, and the date the buyer asks to receive it on. The date has to be one the cart can be delivered on and, for a complete delivery, no earlier than every line is in stock. Pass null to drop a requested date.

Arguments

ArgumentTypeDescription
idID!
versionString
deliverySplitDeliverySplitType!
requestedDeliveryDateDate

Returns

CartSetDeliveryPreferenceResponse!

FieldTypeDescription
cartCartThe cart with the preference set
cartErrors[CartSetDeliveryPreferenceError!]Error details if the preference could not be set

Example

mutation CartSetDeliveryPreference(
$id: ID!
$version: String
$deliverySplit: DeliverySplitType!
$requestedDeliveryDate: Date
) {
cartSetDeliveryPreference(
id: $id
version: $version
deliverySplit: $deliverySplit
requestedDeliveryDate: $requestedDeliveryDate
) {
cart {
id
version
createdAt
lastModifiedAt
currency
customerEmail
isGuest
totalQuantity
deliveryRemarks
vatNumber
purchaseOrderNumber
deliverySplit
requestedDeliveryDate
earliestCompleteDeliveryDate
name
defaultName
status
}
cartErrors {
__typename
... on ValidationError {
message
}
... on CartError {
message
code
}
... on DeliveryError {
message
code
}
}
}
}

The query selects the return type's fields two levels deep; pick the ones you need. The response shows its shape with placeholder values.

Served by

@evolve-framework/commercetoolsResolved
@evolve-framework/medusaResolved

Used by

The storefront packages that send it, in these GraphQL documents: