Skip to main content

New Shipping Capabilities in Storefront API Draft

warning

This document is a draft and what it contains is not available yet in any environment, and is subject to change.

This page covers the new shipping fields and mutations available in the Storefront API — enriched shipping method data, pickup locations, updated set mutations, and session-level shipping metadata.


Get Shipping Methods

ShippingMethod

ShippingMethod is available on checkout.shippingMethods and checkout.deliveryGroups[].shippingMethods (the list of available options), and on checkout.shippingMethod and checkout.deliveryGroups[].shippingMethod (the currently selected method).

FieldTypeDescription
idInt!Unique identifier for the shipping method
nameString!Human-readable name shown to the customer
priceMonetaryValue!Effective price of this shipping method
originalPriceMonetaryValuePre-discount price — use to display a crossed-out original price
selectedBoolean!Whether this method is currently selected on the checkout
commentStringOptional commentary about the shipping method
carrierNameStringName of the shipping carrier
serviceCodeStringCarrier service identifier
deliveryTypeStringFulfillment method — recommended values: TO_DOOR, PICKUP, LOCKER, MAILBOX, STANDARD_SHIPMENT
descriptionStringAdditional details about the option
iconUrlStringURL to the carrier's icon
etdShippingETDEstimated time of delivery. At least one of relative, absolute, or custom is provided — custom takes precedence when present
labels[ShippingLabel]Visual indicators attached to the option (e.g. sustainability badge, signature required). Each has type, displayName, description, and iconUrl
customerChoices[CustomerChoice]Customer-configurable selections — INPUT (text entry), CHECKBOX (toggle), or CHOICE (dropdown with sub-options)
hasLocationBoolean!Whether this method supports selectable pickup/drop-off locations
locations[ShippingMethodLocation]Pre-populated pickup/drop-off locations based on the current shipping address
selectedLocationShippingMethodLocationThe location currently attached to this method, or null if none has been set

Full fragment:

fragment ShippingMethodFields on ShippingMethod {
id
name
selected
comment
hasLocation
carrierName
serviceCode
deliveryType
description
iconUrl
price { value currency }
originalPrice { value currency }
etd {
relative { min max units }
absolute { from to }
custom
}
labels {
type
displayName
description
iconUrl
}
customerChoices {
id
displayName
description
type
default
price { value currency }
options { key displayName description price { value currency } }
}
selectedLocation {
id
displayName
address { address1 city zipCode country { name } }
latitude
longitude
distanceMeters
openingHours { dayOfWeek opens closes }
openingHoursText
brickAndMortar
}
locations {
id
displayName
address { address1 city zipCode country { name } }
latitude
longitude
distanceMeters
openingHours { dayOfWeek opens closes }
openingHoursText
brickAndMortar
}
}

ShippingMethodLocation

Represents a physical pickup or drop-off location. Appears on ShippingMethod.locations, ShippingMethod.selectedLocation, and as the return type of getShippingMethodLocations.

FieldTypeDescription
idInt!Unique identifier for this location
displayNameString!Human-readable name of the location
addressAddressPhysical address
latitudeFloatGeographic latitude
longitudeFloatGeographic longitude
distanceMetersFloatDistance in meters from the shipping address to this location
openingHours[OpeningHoursEntry]Opening hours per day of week — each entry has dayOfWeek, opens, and closes
openingHoursTextStringHuman-readable opening hours summary
brickAndMortarIntID of a Centra brick-and-mortar store associated with this location, or null if none. When present, indicates the order may be fulfilled by that physical store

ShippingMethod.locations is pre-populated when shipping methods are fetched. Use getShippingMethodLocations to search at a different address, retrieve more results, or when locations came back empty. Only call it when hasLocation is true.

# Search by address
query {
getShippingMethodLocations(
shippingMethodId: 42
address: { address1: "14 Downing Street", city: "London", zipCode: "SW1A 2AA", country: "GB" }
) {
id
displayName
address { address1 city zipCode country { name } }
openingHours { dayOfWeek opens closes }
distanceMeters
}
}

# Search by coordinates
query {
getShippingMethodLocations(shippingMethodId: 42, latitude: 51.5033, longitude: -0.1276) {
id
displayName
address { address1 city zipCode country { name } }
distanceMeters
}
}

# Default to the selection's current shipping address
query {
getShippingMethodLocations(shippingMethodId: 42) {
id
displayName
address { address1 city zipCode country { name } }
distanceMeters
}
}

Omitting both address and coordinates defaults to the selection's current shipping address. Providing both is an error.

ShippingETD

Estimated time of delivery. At least one field is provided. If custom is present, it takes precedence and is shown to the customer in place of any derived label from relative or absolute.

FieldTypeDescription
relativeShippingETDRelativeRange with min, max, and units. Valid units: HOURS, DAYS, BUSINESS_DAYS, WEEKS
absoluteShippingETDAbsoluteDate range with from and to datetimes
customStringFree-form text (e.g. "Delivered by Christmas")

ShippingLabel

Visual indicators attached to a shipping option — sustainability badges, signature-required notices, and similar.

FieldTypeDescription
typeString!Machine-readable label type
displayNameString!Human-readable label name
descriptionStringAdditional detail about the label
iconUrlStringURL to the label's icon

CustomerChoice

Customer-configurable selections attached to a shipping method. Three interaction types are supported: INPUT (text entry), CHECKBOX (toggle), and CHOICE (dropdown with sub-options).

FieldTypeDescription
idString!Identifier for this choice
displayNameString!Label shown to the customer
descriptionStringExplanatory text
typeString!INPUT, CHECKBOX, or CHOICE
defaultStringDefault value. For INPUT: shown in the input box, defaults to empty. For CHOICE: the option with the matching key is pre-selected, defaults to the first option. For CHECKBOX: "1" means checked, defaults to unchecked
priceMonetaryValueAdditional cost for selecting a non-default value
options[CustomerChoiceOption]Sub-options for CHOICE type — required when type is CHOICE

CustomerChoiceOption

FieldTypeDescription
keyString!Choice identifier
displayNameString!Customer-facing label
descriptionStringExplanatory text
priceMonetaryValueOverrides the price on the parent CustomerChoice if set

Set Shipping Method

setShippingMethod now accepts an optional locationId parameter. When provided, the chosen pickup or drop-off location is attached to the method in the same call. The selected location is then readable on checkout.shippingMethod.selectedLocation.

# Without a location
mutation {
setShippingMethod(id: 12) {
selection {
checkout {
shippingMethod { id name }
}
}
}
}

# With a location
mutation {
setShippingMethod(id: 12, locationId: 7) {
selection {
checkout {
shippingMethod {
id
name
selectedLocation {
id
displayName
address { address1 city zipCode country { name } }
}
}
}
}
}
}

When the checkout has multiple delivery groups, use setDeliveryGroupShippingMethod instead. The locationId parameter works the same way.

# Without a location
mutation {
setDeliveryGroupShippingMethod(deliveryGroupId: 1, shippingMethodId: 12) {
selection {
checkout {
deliveryGroups {
id
shippingMethods { id name selected }
}
}
}
}
}

# With a location
mutation {
setDeliveryGroupShippingMethod(deliveryGroupId: 1, shippingMethodId: 12, locationId: 7) {
selection {
checkout {
deliveryGroups {
id
shippingMethods {
id
name
selected
selectedLocation { id displayName }
}
}
}
}
}
}
warning

Use setShippingMethod only when the selection has no delivery groups, and setDeliveryGroupShippingMethod only when it does. Using the wrong mutation for the selection's structure will result in an error.


External Provider Shipping Metadata

shippingProviderMetadata is a new field on Session — an array of entries that a shipping provider integration can attach to the session server-side. The frontend does not need to do anything to populate it; Centra stores and exposes it automatically whenever it receives metadata from the provider.

Each entry has the following fields:

FieldTypeDescription
keyString!Metadata key, defined by the provider
valueString!Metadata value, defined by the provider
providerString!Identifier of the shipping provider that set this entry
versionString!Version of the provider integration
query {
session {
shippingProviderMetadata {
key
value
provider
version
}
}
}

Keys and values are defined by the provider — Centra passes them through without interpretation. Typical contents include:

  • Delivery window tokens — identifiers the provider uses to track a promised delivery slot
  • Widget initialization data — a session token or config blob a third-party shipping widget can use to bootstrap itself on the frontend, without requiring a separate authentication step
  • Delivery promises — human-readable strings such as "Delivered by Tuesday"
  • Session correlation IDs — references the provider backend uses to look up the corresponding session on their side

This makes shippingProviderMetadata a general-purpose side-channel between the shipping provider's backend and your frontend: the provider writes to it, and the frontend reads it back from the session.


Express Checkout

note

The impact of new shipping capabilities on express checkout flows (e.g. Shop Pay, Apple Pay) is still under discussion.