#bennn

1 messages · Page 1 of 1 (latest)

weak pondBOT
sonic zephyr
#

Do you have the Invoice Id? inv_xxx

opal talon
sonic zephyr
#

Yes

#

It's only the Id

opal talon
opal talon
#

any idea? @sonic zephyr

sonic zephyr
#

Yeah looking. One moment

opal talon
#

thanks

sonic zephyr
#

Okie somehow that Invoice is $0 and it didn't pick up the previous Invoice Item

opal talon
#

oh

#

thats not good

#

oh i think i see the problewm

#
        invoice_item = stripe.InvoiceItem.create(
            customer=customer.id,
            price="price_1MrC5ZDFiZUD1t6WtR2ughZA",  # Replace with your Stripe price ID
        )

        invoice = stripe.Invoice.create(
            customer=customer.id,
            auto_advance=True,
        )```
#

the second line here is wrong right?

#

bc it doesnt include any items

sonic zephyr
#

If invoice items are created before an invoice is created, set the pending_invoice_items_behavior to include when creating the invoice so that all pending invoice items are automatically added to the invoice. In this case, only add invoice items to a single customer at a time to avoid adding them to the wrong customer.

opal talon
#

okay thanks

#

ill do it the way they do in the example

#
        invoice_item = stripe.InvoiceItem.create(
            customer=customer.id,
            price="price_1MrC5ZDFiZUD1t6WtR2ughZA",  # Replace with your Stripe price ID
        )

        invoice = stripe.Invoice.create(
            customer=customer.id,
            auto_advance=True,
            pending_invoice_items_behavior="include",
        )```
#

so the invoice works now

#

the item is added

#

but its still a draft so the url doesnt exist

#

isnt auto_advance=True supposed to automatically finalize it?

#

I want to avoid emailing the customer, rather send the link via discord

weak pondBOT
teal roost
#

auto_advance=true will finalize it after a while. It's not immediate. Do you have the invoice id? I can take a quick look

opal talon
#

thanks for the help

#

also not rlly related to the api

#

but stripe seems to be really buggy on macos safari lately

#

u kniow anything abt that?

#

like half the time pages fail to load and i cant even open these invoices, have to send them to my phone