#RHSDev-InvoiceItem
1 messages · Page 1 of 1 (latest)
What do you mean by using Invoice Item in PaymentIntent? InvoiceItem is for creating an Invoice
I'm trying to buy products prom stripe
I want to buy products bud don't want to open webpage for it
Can you elaborate on your business use case? Why do you buy products "from Stripe"?
const price = await stripe.prices.retrieve("price_1LXVDCGhV9qlpej3DU5bGSXH");
const customer = await stripe.customers.create({
name: "Jenny Rosen",
email: "jenny.rosen@example.com",
description: "My first customer",
});
const invoiceItem = await stripe.invoiceItems.create({
customer: customer.id,
price: price.id,
quantity: quantity,
});
This is how I create invoice in node
How can I link the invoice with a payment?
That's only creating an Invoice Item You still need to create an Invoice
When you have an Invoice and finalized it, you will have the PaymentIntent inside
And I can use that to make payment?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yes
confirm it client-side
When I try to use that invoice item and finalize it it givems me error "StripeInvalidRequestError: No such invoice: 'ii_1LYNaWGhV9qlpej34amoKWWG'"
Invoice Item != Invoice
const invoice = await stripe.invoices.finalizeInvoice(invoiceItem.id);
You only created an Invoice Item. You haven't created an Invoice
Okay
No, before that: https://stripe.com/docs/invoicing/integration#create-invoice-code
there is a step to create an Invoice
And did you finalize it successfully?
What page is that? Customer or Invoice?
Payments > Payment Links
I don't follow. How is Payment Links related to your Invoice Item?
For Payment Links yes, latest payments would show there if that's what you are asking
Yes, I have made a payment through paymentIntent of invoice
They are visible here
But not here
Is there any delay?
Well because Invoice is not really related to Payment Links. Why would you expect it shows up in Payment Link?
Payment Link is a different product, when you provide the customer just an URL and they pay on that Stripe hosted page
Client want's it to show up there
So it's not possible without opening that page right?
opening the Stripe hosted page? Yes