#Sharvari96
1 messages · Page 1 of 1 (latest)
Retrieve the PamentIntent, and looks at its associated Invoice: https://stripe.com/docs/api/payment_intents/object#payment_intent_object-invoice
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
thanks!
Are events ordered in some way?
Can I take a given event Id and look for the next/previous event associated with it?
webhook events
They are on time order, but it's quite common you can have mutltiple events triggered by same action, and we can't guarantee their order in that case
Ok
How do I add another line item to this invoice with its own price?
This is how I am creating invoice and sending it currently:
product = stripe.Product.create(
name=f"invoice product {invoice_request.order_id}",
metadata={"project_id": invoice_request.order_id},
default_price_data={"currency": "USD", "unit_amount": amount},
)
# Get the default price of the product
price = product.default_price
# Create an invoice with the customer ID and days until due
invoice = stripe.Invoice.create(
customer=invoice_request.customer_id,
collection_method="send_invoice",
days_until_due=invoice_request.days_until_due,
)
# Create an invoice item with the price and invoice ID
stripe.InvoiceItem.create(
customer=invoice_request.customer_id,
price=price,
invoice=invoice.id,
)
# Send the invoice
invoice = stripe.Invoice.send_invoice(invoice.id)
Your code looks fine to me, and if you want to have more line item, you can call more of stripe.InvoiceItem.create( function
You can have an Invoice with 5 different InvoiceItem, each from different price
But this is only before finalizing the Invoice
ok
got it
thanks!
will try it and ask if I have follow up questions
that worked thank you!
now I will be looking into Stripe Identiy to setup the identity verification for connect accounts.
I will have questions on that probably later on. You can close the thread if you want.