All Release Notes

Multiple Shipping Methods for Carts and Orders

30 August 2022
Enhancement
CartsOrdersCustomizationGraphQL

You can now add multiple Shipping Methods to a Cart and Order. This is useful for cases where you want to have individual Shipping Methods for each Line Item ordered from a Cart.

A newly introduced shippingMode on Cart and Order controls whether Carts and Orders can have single or multiple Shipping Methods. The default ShippingMode is Single for backwards compatibility. For Carts and Orders with multiple Shipping Methods, all shipping-related information (such as address, rate, deliveries) are wrapped in a newly introduced Shipping object per Shipping Method. The Shipping object can also be extended with Custom Fields.

Additionally, you can add deliveries to Carts during Cart creation, which was previously only possible on Orders.

Changes:

  • [API] Added Shipping, ShippingDraft, CustomShippingDraft, ShippingMode, MethodTaxRate, and MethodTaxedPrice to Carts API.
  • [API] Added taxedShippingPrice, shippingMode, and shipping fields to Cart and Order.
  • [API] Added shippingMode, shipping, and customShipping fields to CartDraft.
  • [API] Added taxedPricePortions and perMethodTaxRate fields to LineItem.
  • [API] Added shippingMethodKey field to ItemShippingTarget.
  • [API] Added Add Custom ShippingMethod, Add ShippingMethod, Remove ShippingMethod, Set Shipping CustomField, and Set Shipping Custom Type update actions to Carts API.
  • [API] Added shippingKey to AddDelivery update action on Orders API.
  • [API] Added taxedPricePortions to OrderLineItemDiscountSetMessage
  • [API] Added shippingKey to DeliveryAddedMessage, DeliveryAddressSetMessage, DeliveryItemsUpdatedMessage, DeliveryRemovedMessage, ParcelAddedToDeliveryMessage, ParcelItemsUpdatedMessage, ParcelMeasurementsUpdatedMessage, ParcelRemovedFromDeliveryMessage, and ParcelTrackingDataUpdatedMessage.
  • [API] Added shippingKey to Set LineItem TaxRate and Set LineItem TaxAmount update actions to Carts API and Order Edits API.
  • [GraphQL API] Added the following types to the GraphQL schema: MethodTaxedPrice, SetCartShippingCustomField, SetCartShippingCustomType, SetOrderShippingCustomField, SetOrderShippingCustomType, SetStagedOrderShippingCustomField, SetStagedOrderShippingCustomFieldOutput, SetStagedOrderShippingCustomType, SetStagedOrderShippingCustomTypeOutput.
  • [GraphQL API] Changed the AddOrderDelivery type:
    • Input field shippingKey was added to AddOrderDelivery type
  • [GraphQL API] Changed the SetStagedOrderLineItemTaxAmountOutput type:
    • Added the shippingKey field to the SetStagedOrderLineItemTaxAmountOutput type.
  • [GraphQL API] Changed the SetCartLineItemTaxAmount type:
    • Input field shippingKey was added to SetCartLineItemTaxAmount type
  • [GraphQL API] Changed the MyCartUpdateAction type:
    • Input field setShippingCustomField was added to MyCartUpdateAction type
    • Input field setShippingCustomType was added to MyCartUpdateAction type
  • [GraphQL API] Changed the ParcelRemovedFromDelivery type:
    • Added the shippingKey field to the ParcelRemovedFromDelivery type.
  • [GraphQL API] Changed the ParcelMeasurementsUpdated type:
    • Added the shippingKey field to the ParcelMeasurementsUpdated type.
  • [GraphQL API] Changed the SetCartLineItemTaxRate type:
    • Input field shippingKey was added to SetCartLineItemTaxRate type
  • [GraphQL API] Changed the SetStagedOrderLineItemTaxRate type:
    • Input field shippingKey was added to SetStagedOrderLineItemTaxRate type
  • [GraphQL API] Changed the DeliveryAdded type:
    • Added the shippingKey field to the DeliveryAdded type.
  • [GraphQL API] Changed the ShippingTargetDraftType type:
    • Input field shippingMethodKey was added to ShippingTargetDraftType type
  • [GraphQL API] Changed the ItemShippingTarget type:
    • Added the shippingMethodKey field to the ItemShippingTarget type.
  • [GraphQL API] Changed the SetStagedOrderLineItemTaxAmount type:
    • Input field shippingKey was added to SetStagedOrderLineItemTaxAmount type
  • [GraphQL API] Changed the AddStagedOrderDeliveryOutput type:
    • Added the shippingKey field to the AddStagedOrderDeliveryOutput type.
  • [GraphQL API] Changed the SetStagedOrderLineItemTaxRateOutput type:
    • Added the shippingKey field to the SetStagedOrderLineItemTaxRateOutput type.
  • [GraphQL API] Changed the OrderLineItemDiscountSet type:
    • Added the taxedPricePortions field to the OrderLineItemDiscountSet type.
  • [GraphQL API] Changed the CartUpdateAction type:
    • Input field setShippingCustomType was added to CartUpdateAction type
    • Input field setShippingCustomField was added to CartUpdateAction type
  • [GraphQL API] Changed the ParcelTrackingDataUpdated type:
    • Added the shippingKey field to the ParcelTrackingDataUpdated type.
  • [GraphQL API] Changed the AddStagedOrderDelivery type:
    • Input field shippingKey was added to AddStagedOrderDelivery type
  • [GraphQL API] Changed the DeliveryRemoved type:
    • Added the shippingKey field to the DeliveryRemoved type.
  • [GraphQL API] Changed the StagedOrderUpdateAction type:
    • Input field setShippingCustomField was added to StagedOrderUpdateAction type
    • Input field setShippingCustomType was added to StagedOrderUpdateAction type
  • [GraphQL API] Changed the ParcelItemsUpdated type:
    • Added the shippingKey field to the ParcelItemsUpdated type.
  • [GraphQL API] Changed the DeliveryItemsUpdated type:
    • Added the shippingKey field to the DeliveryItemsUpdated type.
  • [GraphQL API] Changed the OrderUpdateAction type:
    • Input field setShippingCustomField was added to OrderUpdateAction type
    • Input field setShippingCustomType was added to OrderUpdateAction type
  • [GraphQL API] Changed the ParcelAddedToDelivery type:
    • Added the shippingKey field to the ParcelAddedToDelivery type.
  • [GraphQL API] Changed the DeliveryAddressSet type:
    • Added the shippingKey field to the DeliveryAddressSet type.

The following changes were introduced in terms of GraphQL SDL:

extend type AddStagedOrderDeliveryOutput {
shippingKey: String
}
extend type SetStagedOrderLineItemTaxRateOutput {
shippingKey: String
}
extend type OrderLineItemDiscountSet {
taxedPricePortions: [MethodTaxedPrice!]!
}
extend type SetStagedOrderLineItemTaxAmountOutput {
shippingKey: String
}
extend type ParcelRemovedFromDelivery {
shippingKey: String
}
extend type ParcelItemsUpdated {
shippingKey: String
}
extend type ParcelMeasurementsUpdated {
shippingKey: String
}
extend type DeliveryAdded {
shippingKey: String
}
extend type ItemShippingTarget {
shippingMethodKey: String
}
extend type ParcelTrackingDataUpdated {
shippingKey: String
}
extend type DeliveryRemoved {
shippingKey: String
}
extend type DeliveryItemsUpdated {
shippingKey: String
}
extend type ParcelAddedToDelivery {
shippingKey: String
}
extend type DeliveryAddressSet {
shippingKey: String
}
extend input ShippingTargetDraftType {
shippingMethodKey: String
}
extend input SetStagedOrderLineItemTaxAmount {
shippingKey: String
}
extend input AddOrderDelivery {
shippingKey: String
}
extend input SetCartLineItemTaxAmount {
shippingKey: String
}
extend input CartUpdateAction {
setShippingCustomField: SetCartShippingCustomField
setShippingCustomType: SetCartShippingCustomType
}
extend input AddStagedOrderDelivery {
shippingKey: String
}
extend input MyCartUpdateAction {
setShippingCustomField: SetCartShippingCustomField
setShippingCustomType: SetCartShippingCustomType
}
extend input SetCartLineItemTaxRate {
shippingKey: String
}
extend input OrderUpdateAction {
setShippingCustomField: SetOrderShippingCustomField
setShippingCustomType: SetOrderShippingCustomType
}
extend input SetStagedOrderLineItemTaxRate {
shippingKey: String
}
extend input StagedOrderUpdateAction {
setShippingCustomField: SetStagedOrderShippingCustomField
setShippingCustomType: SetStagedOrderShippingCustomType
}
type MethodTaxedPrice {
shippingMethodKey: String!
taxedPrice: TaxedItemPrice
}
input SetCartShippingCustomField {
shippingKey: String
name: String!
value: String
}
input SetCartShippingCustomType {
shippingKey: String
fields: [CustomFieldInput!]
type: ResourceIdentifierInput
typeKey: String
typeId: String
}
input SetOrderShippingCustomField {
shippingKey: String
name: String!
value: String
}
input SetOrderShippingCustomType {
shippingKey: String
fields: [CustomFieldInput!]
type: ResourceIdentifierInput
typeKey: String
typeId: String
}
input SetStagedOrderShippingCustomField {
shippingKey: String
name: String!
value: String
}
type SetStagedOrderShippingCustomFieldOutput implements StagedOrderUpdateActionOutput {
type: String!
shippingKey: String
name: String!
value: Json
}
input SetStagedOrderShippingCustomType {
shippingKey: String
fields: [CustomFieldInput!]
type: ResourceIdentifierInput
typeKey: String
typeId: String
}
type SetStagedOrderShippingCustomTypeOutput implements StagedOrderUpdateActionOutput {
type: String!
shippingKey: String
custom: CustomFieldsCommand!
}