#bhavyacodes
1 messages · Page 1 of 1 (latest)
Hi there!
If you want an Invoice, then you shouldn't be creating a PaymentIntent directly. Instead create an Invoice object.
Here's the endpoint: https://stripe.com/docs/api/invoices/create
Did you finalize the invoice? https://stripe.com/docs/api/invoices/finalize?lang=node
this is my code, its still null
const _invoice = await stripe.invoices.create({
//TODO: remove hard coded customer id
customer: "cus_OnXprU9TmuNpqM",
metadata: {
meta: "data",
},
// transfer_data: {
// }
});
const invoice = await stripe.invoices.finalizeInvoice(_invoice.id);
console.log(invoice);
Can you share the invoice ID (in_xxx)?
in_1NzxOmJG7qh0tIALX7FobfYG
The invoice amount is 0, so there's no thing to pay, which means its expected that there's no PaymentIntent.
ohhhh, let me try updating the amount
Looks like you forgot to add any line items. I recommend reading this guide to get more familiar with Invoices: https://stripe.com/docs/invoicing/integration/quickstart
Thank you so much soma, you are really helpful