#vincent_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/1293840322211872791
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
hello
Thanks for waiting! Discord is busy now and will take time to respond
Could you share the request ID (req_xxx) that you attempted to lis the credit note by invoice?
no because i dont have it
hello vanya
Do you have the Credit Note ID that you expect to see?
yes i can have it, but with the way i need to use it on my application i cant have it i only have invoice id
and sorry no id ont have the id from credit note juste the number
I understand. Could you please share the code that you use to fetch it, the Invoice ID, and the Credit Note number? Are you sure you're calling the API for the same Stripe account?
const invoice = await getInvoiceById(invoiceId);
const AllLines = invoice.lines.data;
const Allproduct = AllLines.map((line) => line.price.product);
const product = await getProductFromInvoice(Allproduct);
if (!invoice) {
return res.status(404).send("Facture non trouvée");
}
console.log(invoiceId);
const credit_note = await stripe.creditNotes.list({
invoice: invoiceId,
});
is just a part of my code, but until i use the api on the website i make return an empty array lik data[]
Could you please share the Invoice ID?
yes
in_1Q7wT0FcrsMaCbELmt1WLXDv
its realise with the test mode , i hope that still ok ?
There's no Credit Notes on this Invoice
yes and i dont know why becasue suppose to have it , i have a receipt pdf
Why do you expect to have it?
because its suppose to be paied also its in test mode
so if im client i suppose to have a credit note where writing payed 100 euros for exemple
Did you add a credit note?
what do you mean add credit note ? on parameter in stripe ?
Hey! Taking over for my colleague. Let me catch up.
ok
Ok let's start from the beginning, what you want to achieve exactly ?
You have a paid invoice in_1Q7wT0FcrsMaCbELmt1WLXDv, why you are looking for a credit note? and what do you expect from a Credit Note ?
ok i use the api from stripe, im on test mode and i make a website where i can buy something ok. when i buy in test i have an invoice but on the invoice is not wrinting its payed so my boss want for the client that writing its paied so that exist but on the credit note
Wait let's forget about the credit note for now.
After the invoice is paid, you want to display that the invoice is paid ?
in your website ?
i want i can download it for send to my client for exemple and just printer for me
You can download the invoice pdf from this field
https://docs.stripe.com/api/invoices/object#invoice_object-invoice_pdf
yes i know that but its the credit note or receipt i want can download
because on invoice its writing need paied this sum but the client are alreday paied
Can you share a screenshot of what you are referring to as a credit note ?
Can you share the invoice Id ?
Could you please share that invoice Id ?
OK I see, let me check further..
ok thanks you
Sorry for the late update.
Actually, this is how Stripe invoicing works
The invoice doesn't update for post-payments update
so you'll need to download the receipt
ok and with api can i download it ?
And the bad news, is you can't download the receipt with Stripe APIs
Ah wait
Sorry, actually you can download the receipt from the related Charge:
https://docs.stripe.com/api/charges/object#charge_object-receipt_url
So you need to check the Invoice => PaymentIntent => Charge => receipt url