## Update the selected shipping option Use this method to update the selected shipping option. See [shippingOptions](/js/custom_checkout/session_object.md#custom_checkout_session_object-shippingOptions) for a list of the available shipping options. This method returns a `Promise` that resolves with an object containing the following fields: * `type`: one of either `"success"` or `"error"` * `session`: only populated when `type` is `"success"`. Contains a [Session](/js/custom_checkout/session_object) instance representing the updated state. * `error`: only populated when `type` is `"error"`. Contains an object with a string `message` field which can be displayed to your customer. - `shippingOption` (string) The [ID](/js/custom_checkout/session_object.md#custom_checkout_session_object-shippingOptions-id) of the shipping option to select. ### Update the selected shipping option ```jsx const checkoutState = useCheckout(); if (checkoutState.type === 'success') { const {updateShippingOption} = checkoutState.checkout; updateShippingOption('SHIPPING_OPTION_ID'); } ```