#koidestroyer
1 messages ยท Page 1 of 1 (latest)
How are you creating the Invoice?
Do you have a request ID?
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
I'm using the dotnet API
I was able to create the invoice items first and then the invoices for a customer. I'm refactoring the code to create an empty invoice and assign invoice items to it
But the step mentioned here https://stripe.com/docs/invoicing/integration/quickstart to create the empty invoice is failing with the error above
var service = new InvoiceService();
var options = new InvoiceCreateOptions
{
Customer = customer,
CollectionMethod = "send_invoice",
DaysUntilDue = 30,
};
return await service.CreateAsync(options);
where customer is a test customer's Stripe customer id "cus_XXXXXXX"
The error is "Nothing to invoice for customer"
"Stripe.StripeException"
Can you provide the Request ID so I can dig further?
req_71z3akmkUkLm4r
I believe you need to add the Invoice Items to the Customer before creating the Invoice, which means our docs might be out of date. Can you try creating the Invoice Items first, then the Invoice?
I'll check in about updating the docs
But that's just what I was advised not to do, because I want to invoice specific items as they will have different destination accounts (Connect)
There's a new parameter you can include to change this behavior. @thorn rover Add this to your request:
https://stripe.com/docs/api/invoices/create#create_invoice-pending_invoice_items_behavior
pending_invoice_items_behavior=exclude
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
(This became the default with the API version 2022-08-01, but you're using an older version so must specify the exclude behavior)
This will allow you to create an empty invoice and add items to it afterward
Cool, I should upgrade the Stripe package if it's available
is dotnet usually far behind?
Ah right, dotnet is strong typed, so the builder for that param won't exist without upgrading
I seem to recall that there is an ExtraParams or some such specifically for this cases