Hi,
I’m trying to utilize the Cart GraphQL API to create a cart with selected products and display all available shipping methods. I’ve made the appropriate query, everything is generating, however, there’s a discrepancy between the methods in the API and the methods in the Checkout.
The Cart API doesn’t return shipments from the Carrier Service API. How can this be worked around?
Query:
mutation cartCreate($input: CartInput) {
cartCreate(input: $input) {
cart {
id
createdAt
checkoutUrl
deliveryGroups(first: 100) {
nodes {
deliveryOptions {
code
deliveryMethodType
title
description
estimatedCost {
amount
currencyCode
}
}
}
}
}
userErrors {
field
message
}
}
}
Response:
{
"data": {
"cart": {
"id": "gid://shopify/Cart/c1-455ed6f80eea2bf872c08d7cb5419128",
"createdAt": "2024-03-31T19:39:11Z",
"deliveryGroups": {
"nodes": [
{
"deliveryOptions": [
{
"code": "Test",
"deliveryMethodType": "SHIPPING",
"title": "Test",
"description": "",
"estimatedCost": {
"amount": "1.0",
"currencyCode": "PLN"
}
}
]
}
]
}
}
}
}
Screen from Checkout:
