#nick_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/1278920860203356181
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- nick_api, 1 hour ago, 20 messages
- nick_webhooks-payment, 6 days ago, 21 messages
- nick_code, 6 days ago, 16 messages
Hi jack again!
Hi! Can you share the request ID (req_xxx)? Here's how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
The API wont send
Hmm, why is your frontent calling the checkout sessions API?
What's the code in Payment.html:357?
here is what i am calling
https://api.stripe.com/v1/checkout/sessions/${customerid}
No you should only retrieve the checkout session from your backend with your API key.
do you have an exmaple?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Done that.
Oh wait
Yea done that.
if you're still getting an error, can you share the request id [0]? it'd look like req_xxx
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I cant becuasse its something to do with the request
"Unrecognized request URL (POST: /v1/checkout/sessions/). 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/."
the error message seems pretty self explanatory, is there something specific that you have a question about?
Yea\
Bc the error with the api is the correct api, which i have done https://api.stripe.com/v1/checkout/sessions/${customerid}
So i am confused.
can you paste the line of code that is throwing that error here
try {
const sessionResponse = await fetch(`https://api.stripe.com/v1/checkout/sessions/${customerid}`, {
method: "GET",
headers: {
"Authorization": `Bearer sk_test_KEYHERE`,
"Content-Type": "application/x-www-form-urlencoded",
}
});
const sessionResult = await sessionResponse.json();
console.log(sessionResult);```
is there a reason why you are you using fetch, and not one of the stripe SDKs? If you try and log customerid before the try catch block, what do you get?
The log before it worked, and I am using fetch bc its javascript node.jsbit its working fine.
we have a stripe-node SDK : https://github.com/stripe/stripe-node. It's ultimately up to you, but I strongly recommend using the stripe-node library instead of rolling your own. The library is basically a wrapper for the underlying HTTP requests with some useful features like automatic retries, idempotency keys and robust error handling. You could roll your own, but you'd be reinventing the wheel and would be opening yourself up to all sorts of unhandled edge cases and increasing problems as your integration gets more complex.