Hi there!
Thank you for providing details about the issue with the express checkout payment methods (Gpay, Apple Pay, and Link). I understand how important it is for your customers to have a smooth checkout experience without confusing errors like “The response is not a valid JSON response,” especially when the order is successfully placed but the thank you page doesn’t load correctly.
Just to better understand the issue, could you please confirm the following:
- Does the “The response is not a valid JSON response” error only appear when a customer pays using Express Checkout options (like Apple Pay, Google Pay, or Link)?
- Or does the error also occur when using other payment methods (such as card payments or local gateways)?
- Are you using a custom thank you page, or are you using the default WooCommerce thank you page?
Also, I’d like to understand your site properly. Please share with us the necessary information below for us to investigate the issue further:
- System Status Report which you can find via WooCommerce > Status
- Fatal error logs (if any) under WooCommerce > Status > Logs.
Please use https://pastebin.com/ or https://gist.github.com/ and share a link to that paste in reply here. Once we have more information, we’ll be able to assist you further.
Hi Shahzeen, thank you for your reply.
Please see the answers to you questions in-line:
- Does the “The response is not a valid JSON response” error only appear when a customer pays using Express Checkout options (like Apple Pay, Google Pay, or Link)?
Yes this is only on express checkouts.
- Or does the error also occur when using other payment methods (such as card payments or local gateways)?
Debit / card payments work fine and thank you page shows.
- Are you using a custom thank you page, or are you using the default WooCommerce thank you page?
Yes we are using a custom blocksy thank you page
I have also dug into the error logs and looked at the what the browser DevTools ▸ Network tab shows to watch for the failing call:
The “invalid JSON” message we are seeing in the Stripe overlay appears to just be a symptom.
The browser is actually receiving a 502 Bad Gateway HTML error page from
POST /wp-json/wc/store/v1/checkout
Since the Stripe script expects pure JSON, any HTML it gets back triggers the generic “response is not a valid JSON response” notice.
Any assistance here would be appreciated.
Thank you
Hi @johnstone97,
Thanks for digging into this, the details you shared are super helpful.
Based on what you described, it seems the error is triggered when the Stripe overlay sends a request to /wp-json/wc/store/v1/checkout, but instead of getting a JSON response, it’s receiving a 502 Bad Gateway HTML error. This usually means the server failed to respond properly.
To move forward, here are a few things we recommend:
- Temporarily disable the custom thank you page and revert to the default WooCommerce thank you page. This will help determine if the custom page is interfering with the express checkout redirect.
- Enable WP_DEBUG in your wp-config.php file and check your PHP error logs to see if anything is failing during that request.
- Since the error is server-related, it would be a good idea to share the 502 error details with your hosting provider. They’ll be able to check for server-level issues like proxy timeouts, firewall blocks, or resource limits that could be interfering with the Stripe checkout response.
Let us know what you find!
Hi there,
Since we haven’t heard back in a while, we’ll go ahead and mark this as resolved for now. If anything else comes up, we’re more than happy to continue the conversation.
If our support was helpful, we’d be truly grateful if you could leave us a review. It really helps:
https://ww.wp.xz.cn/support/plugin/woocommerce-gateway-stripe/reviews/#new-post