#leoordio_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/1364168688168599552
đ 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.
- leoordio_best-practices, 6 days ago, 6 messages
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
Are you trying this API ?
https://docs.stripe.com/api/invoices/void
I am sorry for switching the background to my test account. But i get the following error trying to void in_1REoadIBlWedxMGUqIypdeUW in my test account.
Thats my req_RrneeooCbHyyxY
But i get an API answer from my live acc..
I am trying to do it via a Zapier Custom Action, thats my Code:
export async function cancelInvoiceRelatedToDispute(
{ invoiceId }: { invoiceId: string }
): Promise<object> {
// Construct the URL with the provided invoice ID
const url = https://api.stripe.com/v1/invoices/${invoiceId}/void;
// Make a POST request to the Stripe API to void the invoice
const response = await fetchWithZapier(url, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
// No body is needed for this request as per the API specification
});
// Check if the response is not OK and throw an error if so
await response.throwErrorIfNotOk();
// Return the JSON response from the API
return response.json();
}
Thats my error:
{
"error": {
"code": "resource_missing",
"doc_url": "https://stripe.com/docs/error-codes/resource-missing",
"message": "No such invoice: 'in_1REoadIBlWedxMGUqIypdeUW'; a similar object exists in test mode, but a live mode key was used to make this request.",
"param": "id",
"request_log_url": "https://dashboard.stripe.com/acct_1Iw3K1IBlWedxMGU/logs/req_RrneeooCbHyyxY?t=1745315159",
"type": "invalid_request_error"
}
}
You are using a live key to access a test mode object
You need to double check your Stripe API key used
sk_test_51Iw3K1IBlWedxMGUi7gEKBhdBP3RBNzTg9tlEts8NR2b05cMHaV5zWbuyhqgj8FKOup57gre93YO5MYsNPaOuFl200rHGBvaIi
thats my key and i double checked it