---
title: "Handle Apple Pay errors"
description: "Troubleshoot common Apple Pay errors."
url: "https://docs.adyen.com/payment-methods/apple-pay/handle-apple-pay-errors"
source_url: "https://docs.adyen.com/payment-methods/apple-pay/handle-apple-pay-errors.md"
canonical: "https://docs.adyen.com/payment-methods/apple-pay/handle-apple-pay-errors"
last_modified: "2023-07-05T06:24:00+02:00"
language: "en"
---

# Handle Apple Pay errors

Troubleshoot common Apple Pay errors.

It is possible that sometimes you run into an error when you submit a request or get a response for an Apple Pay payment, or when you are integrating Apple Pay in your website, store, or app. In the following error scenarios, you can read more about what some of the [Apple Pay error codes](/development-resources/error-codes#apple-pay-error-codes) mean, how to troubleshoot those errors.

## API errors

In this section we give you some examples of API errors that can occur when you submit a payment request.

### 5\_001 Apple Pay token amount-mismatch

#### What it means

The amount that was authorised in Apple Pay is not the same as the amount that was authorised by the Adyen payments platform.

#### How to troubleshoot

Verify the amounts in the transaction. Note that transactions made with Discover cards (test) and American Express cards (test) support only **USD** as currency.

### 5\_002 Invalid Apple Pay token

#### What it means

The Apple Pay token that was sent in the API request does not conform to the specification.

#### How to troubleshoot

Make sure that the Apple Pay token is retrieved, formed, and passed on correctly.\
For example, for a [/payments](https://docs.adyen.com/api-explorer/Checkout/latest/post/payments) request, make sure that you stringify and base64 encode the `payment.token.paymentData` from Apple Pay and submit it in the request as the `applePayToken` value. For examples and more information about custom integrations, see [Apple Pay for API only](/payment-methods/apple-pay/api-only#make-payment).

### 5\_004 Could not find Merchant Private Key

#### What it means

The Apple Pay key is correct, but the key that was used to encrypt the data isn't configured for your Adyen API credential.

#### How to troubleshoot

There are several things you can do to troubleshoot this error.

* **Check the payment processing certificate**\
  Make sure that:

  * You are using the same API credential as you did when creating the [payment processing certificate](/payment-methods/apple-pay/apple-pay-certificate/web#create-payment-processing-certificate).
  * You have configured your website or app to use the same [merchant identifier](/payment-methods/apple-pay/apple-pay-certificate/web#create-merchant-identifiers) as the one that was used to create the payment processing certificate.
  * You have activated the latest payment processing certificate in the Apple Developer Portal after you received a confirmation that Adyen added the certificate to your API credential.

* **Check the merchant identifier**\
  Make sure that:

  * You have updated the test merchant identifier to the live merchant identifier when you moved your website or app to production.

* **Check the card**\
  Make sure that:

  * The payment isn't made with a test card in a live environment. You can only use production cards in your live environment.

## An error occurred. CSR algorithm/size incorrect. Expected: RSA(2048)

### What it means

You see this error in the Apple Developer Portal when you are creating the merchant identity to enable Apple Pay on the web. You're most likely using an incorrect Certificate Signing Request (CSR) file.

### How to troubleshoot

Make sure that you are not using the CSR file that you received from Adyen to generate the merchant identity certificate. To enable Apple Pay on the web, generate a CSR file following the steps to [create a merchant identity certificate](/payment-methods/apple-pay/apple-pay-certificate/web#create-merchant-identity-certificate).

## Payment Not Processed

### What it means

An Apple Pay payment cannot be processed. The Apple Pay payment sheet on your website displays the error message "Payment Not Processed".

### How to troubleshoot

Make sure that:

* You have [validated your domain](/payment-methods/apple-pay/apple-pay-certificate/web#register-merchant-domain).
* You have linked a verified domain to your merchant identity certificate in the Apple Developer Portal.
* You have defined your `onValidateMerchant` function correctly and send a valid payload to the `validationUrl`. See [Providing Merchant Validation](https://developer.apple.com/documentation/apple_pay_on_the_web/apple_pay_js_api/providing_merchant_validation) for more information.
* You send in the correct `initiativeContext` in the body of the AJAX request to the `validationUrl`. The request and the `initiativeContext` have to be in the same verified domain.
* Your server meets the [requirements](https://developer.apple.com/documentation/apple_pay_on_the_web/setting_up_your_server) set by Apple.
* You check and fix any errors that show up in the [Safari Web Inspector](https://developer.apple.com/safari/tools/).

## Can't process Apple Pay payments using Adobe Commerce

### What it means

There is an issue with processing Apple Pay payments from websites using Adobe Commerce, and errors appear in the logs.

### How to troubleshoot

Check the **adyen\_exception.log** for the error messages `Error Apple, API HTTP Status is:` and `Network error`. If you find any, make sure that:

* The path to the location of your PEM file is correct.
* The merchant identifier, the domain name, and the PEM file are correct.
* The network status is healthy.

## 422 Unauthorized to process transactions on behalf of merchantId

### What it means

There is an issue with requesting your merchant session token from the `/applePay/sessions` endpoint.

### How to troubleshoot

Make sure that you are using SDK version [3.18.0](/online-payments/release-notes#releaseNote=2020-11-09-web-componentsdrop-in-3.18.0) or later and API version 65 or later.

First, check whether the [/paymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) contains a [`configuration` object](/payment-methods/apple-pay/api-only#build-your-payment-form-for-apple-pay) with a `merchantId`. The `merchantId` is required for the `/applePay/sessions` request.

### Tab: Drop-in/Components

When using Drop-in or Components, also make sure that you:

* Pass the full [/paymentMethods](https://docs.adyen.com/api-explorer/Checkout/latest/post/paymentMethods) response when creating an instance of `AdyenCheckout`.
* Added in your [Customer Area](https://ca-test.adyen.com/) all the domains you use for your shop website, for example `https://www.mystore1.com`, or `https://www.mystore2.com`.

Drop-in or Components uses the information above to pass the required values to `/applePay/sessions`.

If you still get the 422 error message after that, contact our [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other) and provide the full request that Drop-in or Components sent in the `/applePay/sessions` endpoint. You can get the request from your browser's **Developer Tools** > **Network** tab. We will then check if the URL is enrolled and if your `merchantIdentifier` is correct.

### Tab: API only

When using the API-only integration, also make sure that your `/applePay/sessions` includes all the [required parameters](/payment-methods/apple-pay/api-only?tab=adyen-certificate-validation_1).

If you still get the 422 error message after that, contact [Support Team](https://ca-test.adyen.com/ca/ca/contactUs/support.shtml?form=other) and provide the full request you have sent in the `/applePay/sessions` endpoint. We will then check if the URL is enrolled and if your `merchantIdentifier` is correct.
