<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "ApplePayontheWeb",
  "identifier" : "/documentation/ApplePayontheWeb/ApplePaySession/ApplePaySession",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "Apple Pay on the Web"
    ],
    "preciseIdentifier" : "instctr/ApplePaySession/ApplePaySession"
  },
  "title" : "ApplePaySession"
}
-->

# ApplePaySession

The entry point for Apple Pay on the web.

```
new ApplePaySession();
```

## Parameters

`version`

The Apple Pay version number your website supports. See [Apple Pay on the Web version history](/documentation/ApplePayontheWeb/apple-pay-on-the-web-version-history) for version information.

`paymentRequest`

An [`ApplePayPaymentRequest`](/documentation/ApplePayontheWeb/ApplePayPaymentRequest) object that contains the information to be displayed on the Apple Pay payment sheet.

## Discussion

Creating an `ApplePaySession` object throws a JavaScript exception if any of the following occur:

- Any Apple Pay JS API is called from an insecure page.
- You pass an invalid payment request. Payment requests are invalid if they contain missing, unknown, or invalid properties, or if the total is zero or less.
- You attempt to create [`ApplePaySession`](/documentation/ApplePayontheWeb/ApplePaySession) outside of a gesture handler.

Check [`supportsVersion`](/documentation/ApplePayontheWeb/ApplePaySession/supportsVersion) before using any Apple Pay JS API that depends on Safari to support a particular version number.

## See Also

[`begin`](/documentation/ApplePayontheWeb/ApplePaySession/begin)

Begins the merchant validation process.

[`supportsVersion`](/documentation/ApplePayontheWeb/ApplePaySession/supportsVersion)

Detects whether a web browser supports a particular Apple Pay version.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)