Updates shipping methods for stores in the cart
The input
object contains the unique identifier (ID
) for the cart and an array of shipping options associated with a store the shipping belongs to.
Any requested field from the CartResponse
object.
{
"input": {
"id": "{{cart_id}}",
"shippingOptions": [
{
"store": "{{store_domain}}",
"shippingId": "{{shipping_id}}}"
}
]
}
}
mutation ($input: UpdateCartSelectedShippingOptionsInput!) {
updateCartSelectedShippingOptions(input: $input) {
cart {
id
buyerIdentity {
firstName
lastName
address1
address2
city
provinceCode
countryCode
postalCode
email
phone
}
stores {
... on AmazonStore {
errors {
code
message
details {
productIds
}
}
store
cartLines {
quantity
product {
id
}
}
offer {
selectedShippingMethod {
id
label
price {
displayValue
value
currency
}
taxes {
displayValue
value
currency
}
total {
displayValue
value
currency
}
}
errors {
code
message
details {
... on AmazonOfferErrorDetails {
productIds
}
}
}
subtotal {
value
displayValue
currency
}
margin {
value
displayValue
currency
}
notAvailableIds
shippingMethods {
id
label
price {
value
displayValue
currency
}
taxes {
value
displayValue
currency
}
total {
value
displayValue
currency
}
}
}
}
... on ShopifyStore {
errors {
code
message
details {
variantIds
}
}
store
cartLines {
quantity
variant {
id
}
}
offer {
errors {
code
message
details {
... on ShopifyOfferErrorDetails {
variantIds
}
}
}
selectedShippingMethod {
id
label
price {
displayValue
value
currency
}
taxes {
displayValue
value
currency
}
total {
displayValue
value
currency
}
}
subtotal {
value
displayValue
currency
}
margin {
value
displayValue
currency
}
notAvailableIds
shippingMethods {
id
label
price {
value
displayValue
currency
}
taxes {
value
displayValue
currency
}
total {
value
displayValue
currency
}
}
}
}
}
}
errors {
code
message
}
}
}
If the provided store is not present in the cart then STORE_NOT_FOUND
error is returned
{
"data": {
"updateCartSelectedShippingOptions": {
"cart": {
"id": "0OSTHkAAhrGxr9nBN33c",
"stores": [
{
"errors": [],
"store": "rye-test-store.myshopify.com",
"cartLines": [
{
"quantity": 1,
"variant": {
"id": "39943631962199"
}
}
]
}
]
},
"errors": [
{
"code": "STORE_NOT_FOUND",
"message": "store NonExistingStore not found"
}
]
}
}
}
Was this page helpful?