#davidang_api
1 messages ¡ Page 1 of 1 (latest)
đ 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.
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
Hello! Can you provide the request ID of your attempt? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Hi @quick sierra thanks for trying to help. How about this one that creates the invoice item - https://dashboard.stripe.com/logs/req_7Em4ZC6AE5pa45
Request POST body
"description": "item-example",
"quantity": "1",
"unit_amount": "2900",
"currency": "USD",
"customer": "cus_PlFttDw39XI3EW"
}```
And what's the Invoice ID of the Invoice you expected this line item to show up on?
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
I recommend you create the Invoice first, then explicitly add line items to it.
You can create an empty Invoice by setting pending_invoice_items_behavior to exclude: https://docs.stripe.com/api/invoices/create#create_invoice-pending_invoice_items_behavior
Then when you create the Invoice Item you can specify that Invoice's ID to ensure it ends up on the Invoice you expect: https://docs.stripe.com/api/invoiceitems/create#create_invoiceitem-invoice
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...
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?
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?