<!--
{
  "availability" : [

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

# ApplePaySession

A session object for managing the payment process on the web.

```
interface ApplePaySession
```

## Overview

[`ApplePaySession`](/documentation/ApplePayontheWeb/ApplePaySession) is the entry point for Apple Pay on the web.  All the steps of the payment process for a single transaction occur in a session.

[`ApplePaySession`](/documentation/ApplePayontheWeb/ApplePaySession) belongs to the Apple Pay JS API.

## Topics

### Determining support for API and payments

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

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

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

Indicates whether the device supports Apple Pay and whether the person has an active card in Wallet that qualifies for web payments.

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

Indicates whether the device supports Apple Pay.

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

Indicates whether the device supports Apple Pay and whether the user has an active card in Wallet.

### Creating an Apple Pay session

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

The entry point for Apple Pay on the web.

### Getting merchant validation

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

Begins the merchant validation process.

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

An event handler the system calls when it displays the payment sheet.

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

Completes the validation for a merchant session.

[`ApplePayValidateMerchantEvent`](/documentation/ApplePayontheWeb/ApplePayValidateMerchantEvent)

An event object that contains the validation URL.

### Handling payment method updates

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

An event handler to call when the user selects a new payment method.

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

Completes the selection of a payment method with an update.

[`ApplePayPaymentMethodUpdate`](/documentation/ApplePayontheWeb/ApplePayPaymentMethodUpdate)

Updated transaction details to provide after the user changes the payment method in the payment sheet.

[`ApplePayPaymentMethodSelectedEvent`](/documentation/ApplePayontheWeb/ApplePayPaymentMethodSelectedEvent)

An event object that contains the payment method.

[`ApplePayPaymentMethod`](/documentation/ApplePayontheWeb/ApplePayPaymentMethod)

A dictionary that describes an Apple Pay payment method.

### Handling coupons

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

An event handler called by the system when the user enters or updates a coupon code.

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

Completes the entry of a coupon code with an update.

[`ApplePayCouponCodeChangedEvent`](/documentation/ApplePayontheWeb/ApplePayCouponCodeChangedEvent)

An event object that contains the coupon code entered by the user.

[`ApplePayCouponCodeUpdate`](/documentation/ApplePayontheWeb/ApplePayCouponCodeUpdate)

A dictionary that contains the updated transaction details for responding to a coupon changed event.

### Handling shipping contact updates

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

An event handler to call when the user selects a shipping contact in the payment sheet.

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

Completes the selection of a shipping contact with an update.

[`ApplePayShippingContactSelectedEvent`](/documentation/ApplePayontheWeb/ApplePayShippingContactSelectedEvent)

An event object that contains the shipping address the user selects.

[`ApplePayShippingContactUpdate`](/documentation/ApplePayontheWeb/ApplePayShippingContactUpdate)

Updated transaction details that result from a change in shipping contact, including any errors.

### Handling shipping method updates

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

An event handler to call when the user selects a shipping method.

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

Completes the selection of a shipping method with an update.

[`ApplePayShippingMethodSelectedEvent`](/documentation/ApplePayontheWeb/ApplePayShippingMethodSelectedEvent)

An event object that contains the shipping method.

[`ApplePayShippingMethodUpdate`](/documentation/ApplePayontheWeb/ApplePayShippingMethodUpdate)

Updated transaction details that result from a change in shipping method.

### Handling payment authorization

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

An event handler the system calls when the user has authorized the Apple Pay payment with Touch ID, Face ID, or a passcode.

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

Completes the payment authorization with a result.

[`ApplePayPaymentAuthorizedEvent`](/documentation/ApplePayontheWeb/ApplePayPaymentAuthorizedEvent)

An event object that contains the token used to authorize a payment.

[`ApplePayPayment`](/documentation/ApplePayontheWeb/ApplePayPayment)

The result of authorizing a payment request that contains payment information.

[`ApplePayPaymentAuthorizationResult`](/documentation/ApplePayontheWeb/ApplePayPaymentAuthorizationResult)

The result of payment authorization, including status and errors.

### Ending the session

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

An event handler that is automatically called when the payment UI is dismissed.

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

Aborts the current Apple Pay session.

### Displaying an Apple Pay setup button

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

A method that displays the Set up Apple Pay button.

### Status code constants

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

The requested action failed.

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

The billing address is invalid.

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

The shipping contact information is invalid.

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

The shipping address is invalid.

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

The PIN information is not valid.

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

The maximum number of tries for a PIN has been reached and the user has been locked out.

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

The required PIN information was not provided.

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

The requested action succeeded.



---

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)