#davidang_api

1 messages ¡ Page 1 of 1 (latest)

frozen ferryBOT
#

👋 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/1220035717967642694

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

sage radishBOT
ember nymph
#

When you look at my screenshot, you can see the item is created as archived already and I think this is why the item never gets added to the invoice

quick sierra
ember nymph
#

Request POST body

  "description": "item-example",
  "quantity": "1",
  "unit_amount": "2900",
  "currency": "USD",
  "customer": "cus_PlFttDw39XI3EW"
}```
quick sierra
#

And what's the Invoice ID of the Invoice you expected this line item to show up on?

ember nymph
#

not sure but I would imagine it should show up in this invoice? in_1Ovjx9Ff2Z4mvxYRxCV1HaJv

#

that invoice id is assigned to the same customer id cus_PlFttDw39XI3EW

#

goal is to be able to create a non-zero invoice with invoice items

quick sierra
#

I recommend you create the Invoice first, then explicitly add line items to it.

ember nymph
#

I actually tried this, and i get an error when i try to assign an invoice id

#

this is how i create the invoice, by default exclude is set right? according to the docs

#

args = { customer: customer, metadata: metadata, collection_method: 'send_invoice', days_until_due: @store.stripe_invoice_terms } invoice = ::Stripe::Invoice.create(args, store_options)

#

moment...

quick sierra
#

That's the default on the current API version, but if you're using an older API version it's not the default. Can you give me the request ID showing the error?

frozen ferryBOT
ember nymph
#

Hi Rubeus, I think it does work now, was able to attach the invoice item to the new invoice i just created. Can you give me up-to tomorrow to conclude I have solve my issue and just keep this line open for now?