## Update a PaymentRequest object `PaymentRequest` instances can be updated with an options object. Available options are documented below. `paymentRequest.update` can only be called when the browser payment interface is not showing. Listen to the [click](/js/element/events.md) and [cancel](/js/element/events.md) events to detect if the payment interface has been initiated. To update the `PaymentRequest` right before the payment interface is initiated, call `paymentRequest.update` in your click event handler. **Syntax:** `paymentRequest.update(...)` - `options` (object) **required** A set of options to update this PaymentRequest instance with. - `currency` (string) Three character currency code (e.g., `usd`). - `total` (object) A [PaymentItem](#payment_item_object) object. This `PaymentItem` is shown to the customer in the browser’s payment interface. - `displayItems` (array) An array of [PaymentItem](#payment_item_object) objects. These payment items are shown as line items in the browser’s payment interface. Note that the sum of the line item amounts does not need to add up to the `total` amount above. - `shippingOptions` (array) An array of [ShippingOption](/js/appendix/shipping_option.md) objects. The first shipping option listed appears in the browser payment interface as the default option. - `applePay` (object) Specify Apple Pay specific options. These are passed through to the Apple Pay API. - `recurringPaymentRequest` (object) Specify a request to set up a recurring payment. See the [Apple Pay documentation](https://developer.apple.com/documentation/apple_pay_on_the_web/applepayrecurringpaymentrequest) for more details. - `paymentDescription` (string) **required** - `managementURL` (string) **required** - `regularBilling` (object) **required** - `amount` (number) **required** - `label` (string) **required** - `recurringPaymentStartDate` (Date) - `recurringPaymentEndDate` (Date) - `recurringPaymentIntervalUnit` ('year' | 'month' | 'day' | 'hour' | 'minute') - `recurringPaymentIntervalCount` (number) - `trialBilling` (object) - `amount` (number) **required** - `label` (string) **required** - `recurringPaymentStartDate` (Date) - `recurringPaymentEndDate` (Date) - `recurringPaymentIntervalUnit` ('year' | 'month' | 'day' | 'hour' | 'minute') - `recurringPaymentIntervalCount` (number) - `billingAgreement` (string) - `deferredPaymentRequest` (object) Specify a request to set up a deferred payment. See the [Apple Pay documentation](https://developer.apple.com/documentation/apple_pay_on_the_web/applepaydeferredpaymentrequest) for more details. - `paymentDescription` (string) **required** - `managementURL` (string) **required** - `deferredBilling` (object) **required** - `amount` (number) **required** - `label` (string) **required** - `deferredPaymentDate` (Date) **required** - `billingAgreement` (string) - `freeCancellationDate` (Date) If set, you must also supply a freeCancellationDateTimeZone. - `freeCancellationDateTimeZone` (string) If set, you must also supply a freeCancellationDate. These are [tz](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) timezones such as `America/Los_Angeles`, `Europe/Dublin`, and `Asia/Singapore`. - `automaticReloadPaymentRequest` (object) Specify a request to set up an automatic reload payment. See the [Apple Pay documentation](https://developer.apple.com/documentation/apple_pay_on_the_web/applepayautomaticreloadpaymentrequest) for more details. - `paymentDescription` (string) **required** - `managementURL` (string) **required** - `automaticReloadBilling` (object) **required** - `amount` (number) **required** - `label` (string) **required** - `automaticReloadPaymentThresholdAmount` (number) **required** - `billingAgreement` (string) - `cardFunding` ('supportsDebit' | 'supportsCredit') By default, Apple Pay allows both credit and debit cards. You can specify if you only want to support one type of card with either 'supportsDebit' or 'supportsCredit'. ### Update a PaymentRequest ```js paymentRequest.update({ total: { label: 'Demo total', amount: 2000, }, shippingOptions: [ { id: 'basic', label: 'Ground shipping', detail: 'Ground shipping via UPS or FedEx', amount: 995, }, ], }); ``` ```es_next paymentRequest.update({ total: { label: 'Demo total', amount: 2000, }, shippingOptions: [ { id: 'basic', label: 'Ground shipping', detail: 'Ground shipping via UPS or FedEx', amount: 995, }, ], }); ```