W
Wasp4mo ago
csbk

I am getting the following error using OpenSaas, when trying to make a Stripe test payment

{ "error": { "message": "Unrecognized request URL (GET: /). If you are trying to list objects, remove the trailing slash. If you are trying to retrieve an object, make sure you passed a valid (non-empty) identifier in your code. Please see https://stripe.com/docs or we can help at https://support.stripe.com/.", "type": "invalid_request_error" } } This was working not 5 minutes ago and I have not changed anything (I don't think)
5 Replies
kapa.ai
kapa.ai4mo ago
Hi @csbk. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- The error message from Stripe—"Unrecognized request URL (GET: /). If you are trying to list objects, remove the trailing slash..."—suggests that your backend is making a request to Stripe with an incorrect URL, likely with an unexpected trailing slash or a missing identifier. Based on the knowledge sources, this kind of issue can happen if there is a trailing slash at the end of a URL used for API requests. For example, if your backend server URL or an endpoint is set with a trailing slash, it can result in malformed requests like //auth/me or similar, which can confuse the Stripe API or your own backend routing logic. This has been reported as a common pitfall in Wasp/OpenSaas deployments, especially when configuring environment variables like REACT_APP_API_URL or WASP_WEB_CLIENT_URL with a trailing slash, leading to invalid API calls and CORS issues When building the client for deployment, API requests are invalid if wasp dev puts / at the end of the backend server URL, Ensure the REACT_APP_API_URL and WASP_WEB_CLIENT_URL env vars are valid URLs. What you should check: 1. Review your environment variables (such as REACT_APP_API_URL, WASP_WEB_CLIENT_URL, and any Stripe-related URLs) and ensure none of them end with a trailing slash. 2. Check your Stripe integration code to make sure you are not accidentally adding a trailing slash to any Stripe API endpoint. 3. If you recently changed branches, updated code, or pulled new changes, verify that your .env files and any configuration files are still correct and consistent. Why this can happen suddenly:
Sometimes, even if you haven't changed code, a restart or a change in environment (like switching branches or updating dependencies) can cause environment variables to be reloaded or reset, exposing issues with trailing slashes or misconfigured URLs that were previously masked. If you fix any trailing slashes in your URLs and the problem persists, double-check the exact request being made to Stripe (you can log it in your backend) to ensure it's well-formed and matches Stripe's API expectations. If you need more detailed debugging steps, let me know what your current environment variable values are (with sensitive info redacted), and I can help you further! ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @csbk, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
csbk
csbkOP4mo ago
@kapa.ai Fixed. The solution was, because I was signed in as a test user that had already subscribed to a plan, it needed me ot create a test customer portal link. I pasted this into the env.server and now it works again. Once a user has paid for a plan, you must use he customer portal for them to update it. I presume if i created another test user, and logged in as that, it would go back to default.
kapa.ai
kapa.ai4mo ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- Yes, your understanding aligns with the information found in the knowledge sources. When using OpenSaas (built with Wasp), once a user has subscribed to a plan, further subscription management (such as updating or canceling the plan) is typically handled through the Stripe Customer Portal. You need to provide a valid customer portal link, which is often set as an environment variable (e.g., STRIPE_CUSTOMER_PORTAL_LINK) in your server environment. If this link is missing, you may encounter errors or be unable to manage subscriptions for users who have already paid. If you log in as a new test user who hasn't subscribed yet, the default subscription flow (e.g., checkout) will be available again, and you won't be redirected to the customer portal until after subscribing. This behavior is consistent with the intended flow described in the community discussions, where the customer portal link is required for managing existing subscriptions, and its absence can cause issues for users who have already paid Discord: STRIPE_CUSTOMER_PORTAL_LINK is not defined. If you need to set up the customer portal, you may need to create the link in Stripe and then add it to your environment variables as described in the relevant documentation and community threads. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ---------------------- Sorry @csbk, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist: Perhaps try again in 15mins?
Filip
Filip4mo ago
Thanks for sharing the problem @csbk, it helps the bot learn 🙂
csbk
csbkOP4mo ago
You're welcome!

Did you find this page helpful?