## Shipping address change event

`paymentRequest.on(event: string, handler: function)`

The `shippingaddresschange` event is emitted from a [PaymentRequest](https://docs.stripe.com/js/payment_request.md) whenever the customer selects a new address in the browser's payment interface.

- `event` The name of the event. In this case, `shippingaddresschange`.
- `handler` `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` `updateWith(updateDetails) => void` is a Stripe.js provided function that is called with an [UpdateDetails](https://docs.stripe.com/js/appendix/update_details.md) object to merge your updates into the current `PaymentRequest` object. Note that if you subscribe to `shippingaddresschange` events, then you must call `updateWith` within 30 seconds.
  - `shippingAddress` The customer's selected shipping address. To maintain privacy, browsers may anonymize the shipping address by removing sensitive information that is not necessary to calculate shipping costs. Depending on the country, some fields can be missing or partially redacted. For example, the shipping address in the U.S. may only contain a city, state, and ZIP code. The full shipping address appears in the [PaymentResponse](https://docs.stripe.com/js/appendix/payment_response.md) object after the purchase is confirmed in the browser’s payment interface
    - `country` Two-letter country code, capitalized. Valid two-letter country codes are specified by ISO3166 alpha-2.
    - `addressLine` An array of address line items. For example, `185 Berry St.`, `Suite 500`, `P.O. Box 12345`, etc.
    - `region` The most coarse subdivision of a country. Depending on the country, this might correspond to a state, a province, an oblast, a prefecture, or something else along these lines.
    - `city` The name of a city, town, village, etc.
    - `postalCode` The postal code or ZIP code, also known as PIN code in India.
    - `recipient` The name of the recipient. This might be a person, a business name, or contain "care

### Example

```title
Handle 'shippingaddresschange' event
```