# PayPal ApplePay JS SDK Reference
## 1. paypal.Applepay().config()
### RESPONSE
```json
{
isEligible: true, // `true` if Merchant is eligible for ApplePay, `false` otherwise.
countryCode: "<Payment settlement country code>", // For example, "US".
merchantCapabilities: ["<Payment capability supported for the ApplePay payment>"], // For example, ["supports3DS", "supportsCredit", "supportsDebit"],
supportedNetworks: ["<The payment network supported for the ApplePay payment>"] // For example, ["visa", "masterCard", "amex", "discover"]
}
```
| Response Parameter | Parameter Details |
| --- | --- |
| `isEligible` | `true` if merchant is eligible to process ApplePay payments, `false` otherwise. |
| `countryCode` | Country location where the ApplePay payment will be settled. Please send this value in the [ApplePayPaymentRequest](https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypaymentrequest). https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypaymentrequest/1916117-countrycode |
| `merchantCapabilities` | Payment capabilities supported for the ApplePay payment. Please send this value in the [ApplePayPaymentRequest](https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypaymentrequest). https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypaymentrequest/1916123-merchantcapabilities |
| `supportedNetworks` | The payment networks supported for the ApplePay payment. Please send this value in the [ApplePayPaymentRequest](https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypaymentrequest). https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypaymentrequest/1916122-supportednetworks |
### ERRORS
| Error Name | Issue | Error Details |
| --- | --- | --- |
| INTERNAL_SERVER_ERROR | | An internal server error occurred. Please try again.|
## 2. paypal.Applepay().validateMerchant()
### REQUEST
```json
{
validationUrl: "<The URL merchants must use to validate themselves and obtain a merchant session object>", // For example, "https://apple-pay-gateway-cert.apple.com/paymentservices/startSession",
displayName: "<A string of 64 or fewer UTF-8 characters containing the canonical name for your store, suitable for display>" // For example, "My Store"
}
```
| Request Parameter | Parameter Details |
| --- | --- |
| `validationUrl` | The URL merchants must use to validate themselves and obtain a merchant session object. This is a required parameter. Please read this value from [ApplePayValidateMerchantEvent](https://developer.apple.com/documentation/apple_pay_on_the_web/applepayvalidatemerchantevent). https://developer.apple.com/documentation/apple_pay_on_the_web/applepayvalidatemerchantevent |
| `displayName` | A string of 64 or fewer UTF-8 characters containing the canonical name for your store, suitable for display. This is an optional parameter. https://developer.apple.com/documentation/apple_pay_on_the_web/apple_pay_js_api/requesting_an_apple_pay_payment_session |
### RESPONSE
```json
{
merchantSession: {
// An opaque message session object, received from the Apple Pay server.
}
}
```
| Response Parameter | Parameter Details |
| --- | --- |
| `merchantSession` | ApplePay payment session. https://developer.apple.com/documentation/apple_pay_on_the_web/applepaysession/1778015-completemerchantvalidation |
### ERRORS
| Error Name | Issue | Error Details |
| --- | --- | --- |
| UNPROCESSABLE_ENTITY | NOT_ENABLED_FOR_APPLE_PAY | Merchant is not enabled for processing ApplePay payments. Please complete the required onboarding steps including domain registration.|
| INVALID_REQUEST | | Request is not well-formed, syntactically incorrect, or violates schema. Please correct the request and try again.|
| INTERNAL_SERVER_ERROR | | An internal server error occurred. Please try again.|
## 3. paypal.Applepay().confirmOrder()
### REQUEST
```json
{
orderId: "<Id of PayPal checkout order resource>", // For example, 5O190127TN364715T
token: "<ApplePayPaymentAuthorizedEvent - payment.token>",
billingContact: "<ApplePayPaymentAuthorizedEvent - payment.billingContact>"
}
```
| Request Parameter | Parameter Details |
| --- | --- |
| orderId | `id` of the order resource. This is a required parameter. https://developer.paypal.com/docs/api/orders/v2/ |
| token | ApplePay token, an object that contains the buyer's payment credentials. This is a required parameter. Please read this value from `payment` object in [ApplePayPaymentAuthorizedEvent](https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypaymentauthorizedevent). https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypayment, https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypaymenttoken |
| billingContact | The billing contact selected by the buyer for this payment. ApplePay token, an object that contains the buyer's payment credentials. This is an optional parameter. It is recommended to collect and send billing contact details wherever applicable. Please read this value from `payment` object in [ApplePayPaymentAuthorizedEvent](https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypaymentauthorizedevent). https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypayment, https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypayment/1916096-billingcontact. You can also collect billing contact details on your website and send it in the format shown [here](https://developer.apple.com/documentation/apple_pay_on_the_web/applepaypaymentcontact). |
### ERRORS
| Error Name | Issue | Error Details |
| --- | --- | --- |
| RESOURCE_NOT_FOUND | INVALID_RESOURCE_ID | Specified `orderID` does not exist. Please check the `orderId` and try again.
| UNPROCESSABLE_ENTITY | NOT_ENABLED_FOR_APPLE_PAY | Merchant is not enabled for processing ApplePay payments. Please complete the required onboarding steps including domain registration.|
| UNPROCESSABLE_ENTITY | APPLE_PAY_AMOUNT_MISMATCH | The `amount` specified in the Order should match the amount that was viewed and authorized by the payer/buyer on Apple Pay. If the amount has changed, please redirect the buyer to authorize the order again via Apple Pay. |
| INVALID_REQUEST | INVALID_DECRYPTED_TOKEN | The ApplePay token is the request is invalid. Please fix your integration to send a valid ApplePay token. |
| INVALID_REQUEST | | Request is not well-formed, syntactically incorrect, or violates schema. Please correct the request and try again.|
| INTERNAL_SERVER_ERROR | | An internal server error occurred. Please try again.|