#thepharmanest_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1382647973099343872
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there!
Can you share the ID (req_xxx) of the failing API request?
https://support.stripe.com/questions/finding-the-id-for-an-api-request
In the response header of the API
๐
req_tijU2b32fP0kUd
Thanks, but this request is successful.
POST/v1/payment_methods
Request ID
HTTP status code
200
Time
Jun 12, 2025, 4:13:53 AM
IP address
68.208.88.18
API version
2020-08-27
Origin
https://buy.stripe.com/
Idempotency key
ef33a048-9df9-4697-b0d3-1afbd1751422
User agent
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36 Edg/137.0.0.0
API key
To better assist you, we need a request Id that failed with the message you've shared above: Payment processing error: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
What integration guide are you following?
We know nothing about Replit unfortunately here...
amd they are experincing issue when integrating stripe with website
you can take my desktop remote to fix this issue
ok so how we can fix let me send you exact error once clicking on pay
I've added comprehensive request tracking with unique IDs for the Stripe technician.
When you click a payment button that fails, the server will now log:
Unique Request ID (format: timestamp-randomstring)
Complete request headers
Request body details
Response status and headers
Response content
Try clicking any subscription button now and share the Request ID from the server logs with the Stripe technician - this will help them trace exactly what's happening.
this is message from their agent
Payment processing error: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
This is not enough sorry, to understand what happens behind and how Replit is interacting with Stripe APIs.
We need code snippets
kindly check their technician has shared this
did you check what is issue
he shared everything check above message
he shared you code snippets
If stripe retruns HTML instead of JSON, please share the corresponding request Id (req_...)
According to the code snippets, it returns correctly a checkout session cs_live....
I've created a debug page to capture the exact failure for the Stripe technician.
Please visit /debug-live-request.html and click "Trigger API Request". This will show:
The actual response our server sends (likely HTML instead of JSON)
The specific request ID from our server logs
The exact error message
The Stripe technician needs to see that our server endpoint is returning HTML when accessed via browser, but JSON when accessed via curl. This points to an Express routing/middleware issue, not a Stripe API problem.
You're absolutely right - let me clarify the issue. The problem is NOT that Stripe is returning HTML. The issue is that our Express server is returning HTML instead of JSON when the browser makes requests to our API endpoints.
message by website developer
You're absolutely right - let me clarify the issue. The problem is NOT that Stripe is returning HTML. The issue is that our Express server is returning HTML instead of JSON when the browser makes requests to our API endpoints.
Yeah they need to double check why your endpoint is returning HTML, it's not Stripe that is returning HTML.
can you check their server as i want this issue to fixed as soon as my clients will face issue
I can't share their server, we don't have access.
This channel is for Stripe questions only.
ok just be here
fyi i'm taking over this thread!
Yeah they need to double check why your endpoint is returning HTML, it's not Stripe that is returning HTML.
are you still here
hi! yep i'm still here. it sounds like the developer you're talking to is saying it's an issue on their end
sorry, that error looks like the one that was coming up earlier and is probably related to Replit
as ou4m37 said earlier the request ID you shared is returning JSON, so something else in between stripe's API response and your browser is causing the problem
hi! I'm taking over this thread. let me know if you have other questions.
sorry we can't review your code like this.
if you have a specific question about this code, or a specific error message you need help with, I would be happy to help.
is there any other way i can link stripe to my website
what do you mean by "link"? accept a payment?