updateCartSelectedShippingOptions

updateCartSelectedShippingOptions is used to set a shipping method for a specific store

Arguments

input : UpdateCartSelectedShippingOptionsInput!

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


Returns

CartResponse.*: CartResponse

Any requested field from the CartResponse object.

Examples

{
    "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
        }
    }
}