#koidestroyer

1 messages ยท Page 1 of 1 (latest)

untold cloudBOT
sudden phoenix
#

How are you creating the Invoice?

thorn rover
#

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

#

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"

sudden phoenix
#

Can you provide the Request ID so I can dig further?

thorn rover
#

req_71z3akmkUkLm4r

sudden phoenix
#

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

thorn rover
#

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)

static vine
#

(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

thorn rover
#

Cool, I should upgrade the Stripe package if it's available

#

is dotnet usually far behind?

static vine
#

Ah right, dotnet is strong typed, so the builder for that param won't exist without upgrading

thorn rover
#

I seem to recall that there is an ExtraParams or some such specifically for this cases

static vine
#

Yes that's right

thorn rover
#

There is a new version already so no need to do this

#

๐Ÿ‘