Fetch available shipping methods and carriers
Retrieve the shipping methods and carriers available for the current cart.
Query
query GetShippingOptions($cartId: String!) {
cart(id: $cartId) {
shippingMethods {
name
code
}
carriers {
id
name
logo
price
}
postageData {
method
price
priceNet
carrier
}
}
}
Variables
{
"cartId": "019c77b7-565f-7ea0-8660-42bc63a7f728"
}
Response
{
"data": {
"cart": {
"shippingMethods": [
{ "name": "Delivery", "code": "DELIVERY" },
{ "name": "Pickup", "code": "PICKUP" }
],
"carriers": [
{ "id": 1, "name": "Default delivery", "logo": null, "price": 10 },
{ "id": 8, "name": "DHL", "logo": null, "price": 2.36 },
{ "id": 25, "name": "DPD", "logo": null, "price": 0 },
{ "id": 26, "name": "GLS", "logo": null, "price": 0 },
{ "id": 2, "name": "PostNL", "logo": null, "price": 4.5 }
],
"postageData": {
"method": "DELIVERY",
"price": 300,
"priceNet": 363,
"carrier": null
}
}
}
}
How it works
shippingMethods lists the available methods (typically Delivery and Pickup). carriers lists the available carriers with their indicative prices — actual shipping costs are calculated through business rules and reflected in postageData. The postageData object shows the currently selected method and the calculated shipping costs. Use cartUpdate with postageData.method and optionally a carrier to set the shipping choice.