Secure context
This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The PaymentRequest interface of the Payment Request API manages the process of making a payment between a web application and a end user.


PaymentRequest() Secure context
Creates a new PaymentRequest object.

Properties Read only  Secure context
Returns an identifier (UUID) generated by PaymentResponse() constructor, or a custom identifier set via
PaymentRequest.shippingAddress Read only Secure context
If requested via payment options, returns the shipping address chosen by the user for the purposes of calculating shipping. This property is only populated if the constructor is called with the requestShipping flag set to true. Additionally, in some browsers, the parts of the address will be redacted for privacy until the user indicates they are ready to complete the transaction (i.e., they hit "Pay").  
PaymentRequest.shippingOption Read only Secure context
Returns the identifier of the selected shipping option. This property is only populated if the constructor is called with therequestShipping flag set to true.
PaymentRequest.shippingType Read only Secure context
Returns the type of shipping used to fulfill the transaction. This will be one of 'shipping', 'delivery', 'pickup', or null if a value was not provided in the constructor.

Event Handlers

PaymentRequest.onshippingaddresschange Secure context
Dispatched whenever the user changes their shipping address.
PaymentRequest.onshippingoptionchange Secure context
Dispatched whenever the user changes a shipping option.
PaymentRequest.onpaymentmethodchange Secure context
With some payment handlers (e.g., ApplePay), dispatched whenever the user changes payment instrument, like swiching from a credit card to a debit card.


PaymentRequest.canMakePayment() Secure context
Indicates whether the PaymentRequest object can make a payment before calling show(). Secure context
Causes the user agent to begin the user interaction for the payment request.
PaymentRequest.abort() Secure context
Causes the user agent to end the payment request and to remove any user interface that might be shown.


Specification Status Comment
Payment Request API
The definition of 'PaymentRequest' in that specification.
Candidate Recommendation Initial definition.

Browser Compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support61 Yes551 No No ?
PaymentRequest constructor61 Yes551 No No ?
requestId61 Yes551 No No ?
shippingAddress6115551 No No ?
shippingOption6115551 No No ?
shippingType6115551 No No ?
onshippingaddresschange6115551 No No ?
onshippingoptionchange6115551 No No ?
canMakePayment6116551 No No ?
show6115551 No No ?
abort6115551 No No ?
id ? ? ? ? ? ?
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support No53 Yes551 No ?6.0
PaymentRequest constructor No53 Yes551 No ?6.0
requestId No60 Yes551 No ? No
shippingAddress No53 Yes551 No ?6.0
shippingOption No53 Yes551 No ?6.0
shippingType No56 Yes551 No ?6.0
onshippingaddresschange No53 Yes551 No ?6.0
onshippingoptionchange No53 Yes551 No ?6.0
canMakePayment No56 Yes551 No ?6.0
show No53 Yes551 No ?6.0
abort No53 Yes551 No ?6.0
id ? ? ? ? ? ? ?

1. From version 55: this feature is behind the dom.payments.request.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.