Skip to content
WooCommerce

[SOLVED] WooCommerce “Error retrieving payment details” (PayPal Payments)

You open the PayPal settings in WooCommerce and, instead of your options, small black pop-ups appear at the bottom of the screen: “Error retrieving payment details.” and right behind it “Error retrieving PayPal Settings details.”. The page looks normal at first glance, but the payment methods and settings never load, and saving does nothing. In this tutorial, we will learn how to fix the WooCommerce “Error retrieving payment details” error in the WooCommerce PayPal Payments plugin: find out which request fails, read the real reason behind it, and remove what is blocking it.

Previously, I published a guide on how to install and set up WooCommerce on WordPress. This post picks up from there, once you install PayPal Payments and its settings screen refuses to load.

What causes the WooCommerce “Error retrieving payment details” message

The PayPal Payments settings screen (the new React interface in version 3.x and 4.x of the plugin) does not get its data from the page HTML. When the screen opens, it calls a series of WordPress REST API endpoints in the background, all under /wp-json/wc/v3/wc_paypal/:

  • /wc_paypal/payment → if this request fails, you get “Error retrieving payment details.”
  • /wc_paypal/settings → if this one fails, you get “Error retrieving PayPal Settings details.”
  • Other endpoints have their own messages: “Error retrieving onboarding details.”, “Error retrieving plugin details.”, “Error retrieving Styling details.” and so on.

I confirmed this by reading the plugin’s own settings script (PayPal Payments 4.2.2): each message is shown in the catch block of one REST call. So the message never comes from PayPal’s servers. It means your own WordPress site did not return a valid answer to the plugin. The usual reasons are:

  • A security plugin, web application firewall (ModSecurity, Cloudflare WAF rules) or host rule blocks some /wp-json/ requests with a 403.
  • A page or object cache serves an old admin page, so the REST nonce is expired (rest_cookie_invalid_nonce).
  • The logged-in user does not have the manage_woocommerce capability.
  • PHP warnings are printed into the response, so the JSON is broken.
  • A PHP fatal error inside the endpoint returns a 500.

To get real screenshots for this post, I reproduced the error on a fresh test store (WordPress 7.1, WooCommerce 11.3.1, PayPal Payments 4.2.2). I added a tiny test plugin that blocks two of the PayPal Payments routes with a 403, the same way an over-strict firewall rule does. This is the code, so you can reproduce it on a staging site if you want to practice:

<?php
/**
 * Plugin Name: Simulated firewall rule (magentip test)
 * Description: Test-only plugin: blocks two PayPal Payments REST routes with a 403.
 */
add_filter( 'rest_pre_dispatch', function ( $result, $server, $request ) {
	if ( in_array( $request->get_route(), array( '/wc/v3/wc_paypal/payment', '/wc/v3/wc_paypal/settings' ), true ) ) {
		return new WP_Error( 'rest_forbidden', 'Sorry, you are not allowed to do that.', array( 'status' => 403 ) );
	}
	return $result;
}, 10, 3 );

With that plugin active, opening WooCommerce > Settings > Payments > PayPal gives exactly the error people report:

WooCommerce PayPal Payments settings screen showing the Error retrieving payment details message

The two pop-ups appear on top of each other. Click the first one (“Error retrieving PayPal Settings details.”) to dismiss it and you will see “Error retrieving payment details.” underneath. They disappear on their own after a few seconds, so take a screenshot quickly if you need to send it to support.

Step 1: Find out which request fails

Stay on the PayPal settings screen, open your browser’s developer tools (F12, or right-click > Inspect) and go to the Network tab. Reload the page and type wc_paypal in the filter box. You will see one request per endpoint. The ones in red are the ones that failed, and the Status column tells you why (403, 401, 404, 500…).

If you prefer the Console tab, paste this snippet. It runs the same call the settings screen makes, with your login cookie and nonce:

wp.apiFetch( { path: '/wc/v3/wc_paypal/payment' } )
	.then( ( res ) => console.log( 'OK', res ) )
	.catch( ( err ) => console.error( 'Failed', err ) );

“OK” followed by an object means the endpoint works. “Failed” followed by an object with a code and a message gives you the reason.

Step 2: Open the REST endpoint directly and read the status code

The fastest way to see the full answer is to open the endpoint in the browser tab itself. Still on the PayPal settings screen, run this in the Console. It builds the URL with your current REST nonce and opens it:

location.href = ( window.wpApiSettings ? wpApiSettings.root : '/wp-json/' ) + 'wc/v3/wc_paypal/payment?_wpnonce=' + wp.apiFetch.nonceMiddleware.nonce;

On my broken test store, the browser shows the JSON error returned by WordPress:

PayPal Payments REST endpoint returning a 403 rest_forbidden response

Here is how to read what you get:

  • JSON with "status":403 or an HTML “Forbidden” / “Access denied” page: something is blocking the request before PayPal Payments can answer. If the page is HTML (a firewall or hosting error page) instead of JSON, the block happens at the server or CDN level. Go to Step 3.
  • rest_cookie_invalid_nonce (“Cookie check failed”): the nonce on the page is stale, usually because of caching. See Step 4.
  • rest_forbidden with "status":401: WordPress does not see you as a user who can manage WooCommerce. See Step 4.
  • rest_no_route or a 404 page: the route is not registered or /wp-json/ is not reachable. See Step 4.
  • A 500 error, or PHP warnings printed before the JSON: a PHP problem. See Step 4.

Step 3: Find and disable what blocks /wp-json/

A 403 on the PayPal routes is by far the most common case. On a live store, the blocker is usually one of these:

  • A security plugin with a firewall or “disable REST API” option.
  • A Cloudflare WAF or custom rule that challenges or blocks URLs containing /wp-json/.
  • ModSecurity on your hosting, which sometimes flags REST requests with JSON bodies.

Test for a plugin conflict the way the official PayPal Payments troubleshooting guide recommends: keep only WooCommerce and WooCommerce PayPal Payments active, switch to a default theme such as Storefront, and reload the PayPal settings screen. Do this on a staging copy if the store is live. Go to Plugins > Installed Plugins and deactivate the other plugins one by one, starting with security, firewall, caching and optimization plugins:

Deactivate the plugin that blocks the PayPal Payments REST API in WordPress

When the pop-ups stop appearing, the last plugin you deactivated is the culprit. Do not leave your store without its security plugin: turn it back on and look for its allowlist settings instead. Allow requests to /wp-json/wc/v3/wc_paypal/ for logged-in administrators, or allow /wp-json/ as a whole if the plugin only offers that. If no plugin is the cause, ask your host to check the ModSecurity log for the blocked request (give them the time and the URL from Step 2), and check the firewall events in your CDN dashboard if you use one.

Stale nonce because of caching

If Step 2 showed rest_cookie_invalid_nonce, a cache is serving an old copy of the admin page. Exclude /wp-admin/ and /wp-json/ from page caching and from your CDN cache rules, purge all caches, log out, log back in and reload the settings screen.

The user cannot manage WooCommerce

Every PayPal Payments settings endpoint checks current_user_can( 'manage_woocommerce' ). The Administrator and Shop manager roles have it. If you use a custom role or a role editor plugin, check that this capability is still assigned to your user, or log in as an administrator.

PHP warnings break the JSON response

If PHP is configured to display errors, a single warning from any plugin can be printed at the top of the REST response. The browser then receives “Warning: …” followed by JSON, which is not valid JSON, and the settings screen shows the same pop-ups. Keep logging on but hide errors from the output in wp-config.php, above the line /* That's all, stop editing! */:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
@ini_set( 'display_errors', 0 );

The warnings now go to wp-content/debug.log, where you can read them and fix the plugin that produces them.

404 on /wp-json/ (no route)

If the REST URL returns a 404 page from your theme instead of JSON, the rewrite rules are usually out of date. Go to Settings > Permalinks and click Save Changes without changing anything. This flushes the rewrite rules:

WordPress permalinks settings Save Changes button to flush rewrite rules

On Nginx, also make sure your server block passes unknown URLs to index.php (the standard try_files $uri $uri/ /index.php?$args; rule), otherwise /wp-json/ never reaches WordPress.

500 error inside the endpoint

A 500 means PHP crashed while building the answer. Open WooCommerce > Status > Logs and look at the fatal-errors source, or check debug.log. I explained how to read those logs step by step in how to find and fix the WooCommerce critical error with the error log. Most of the time, the fix is updating WooCommerce PayPal Payments (the current version on the official plugin page is 4.2.2) or the plugin named in the log.

Step 5: Check that the fix worked

Run the same check as in Step 2. After I deactivated the test plugin on my store, the exact same URL returned "success":true and the full list of PayPal payment methods:

PayPal Payments REST endpoint returning success true after the fix

Go back to WooCommerce > Settings > Payments > PayPal and reload. The pop-ups are gone and you can continue with Activate PayPal Payments to connect your PayPal account, or change your payment methods and settings if you are already connected.

Common errors

“Error retrieving PayPal Settings details” without the payment details message

Same cause, different endpoint (/wc_paypal/settings). Each part of the screen has its own route, so a firewall or cache rule can break some of them and leave the others working. Use Step 2 with settings instead of payment at the end of the URL.

The settings screen shows only a spinner

When every wc_paypal route is blocked, the screen never finishes loading and may not show any pop-up at all. I saw this on my test store when I blocked all routes. Follow the same steps: the Network tab will show all requests in red.

The error only happens for one admin user

Check that user’s role and capabilities (manage_woocommerce), then clear the browser cache and cookies for your site. Browser extensions that block “tracking” requests can also block REST calls, so test in a private window with extensions disabled.

Everything works in the admin but PayPal buttons are missing at checkout

That is a different problem, usually caching or JavaScript optimization on the cart and checkout pages. The official WooCommerce PayPal Payments troubleshooting guide lists the pages and scripts to exclude, and it also confirms that a blocked REST endpoint is a known cause of PayPal Payments errors.

Wrapping up

The WooCommerce “Error retrieving payment details” pop-up is not a PayPal outage. It means the PayPal Payments settings screen could not get an answer from your own site’s REST API. Open /wp-json/wc/v3/wc_paypal/payment with your nonce, read the status code, then remove the cause: allowlist the route in your firewall or security plugin, exclude the admin and /wp-json/ from caching, hide PHP warnings, re-save permalinks, or fix the fatal error in the log.

If your REST response shows a code that is not covered here, paste it in the comments below (without any keys or personal data) and I will help you figure it out.


Written by

Hung Tran

Hung Tran is the main editor of magentip.com, he loves to write about everything related to Magento 2