## Shipping option change event The `shippingoptionchange` event is emitted from a [PaymentRequest](/js/payment_request.md) whenever the customer selects a new shipping option in the browser's payment interface. **Syntax:** `paymentRequest.on(...)` - `event` (string) **required** The name of the event. In this case, `shippingoptionchange`. - `handler` (function) **required** `handler(event) => void` is a **callback function** that you provide that will be called when the event is fired. When called it will be passed an event object with the following properties: - `updateWith` (function) `updateWith(updateDetails) => void` is a Stripe.js provided function that is called with an [UpdateDetails](/js/appendix/update_details.md) object to merge your updates into the current `PaymentRequest` object. Note that if you subscribe to `shippingoptionchange` events, then you must call `updateWith` within 30 seconds. - `shippingOption` (ShippingOption) The customer's selected [ShippingOption](/js/appendix/shipping_option.md). ### Handle 'shippingoptionchange' event ```js paymentRequest.on('shippingoptionchange', function(event) { var updateWith = event.updateWith; var shippingOption = event.shippingOption; // handle shippingoptionchange event // call event.updateWith within 30 seconds updateWith(updateDetails); }); ``` ```es_next paymentRequest.on('shippingoptionchange', (event) => { const {updateWith, shippingOption} = event; // handle shippingoptionschange event // call event.updateWith within 30 seconds updateWith(updateDetails); }); ```