#sunnylbk
1 messages ยท Page 1 of 1 (latest)
stripeInvoice.setAmountDue(10000L)
Where is this method coming from? I don't know whatsetAmountDueis.
Java 17 ๐
there's no amount field in invoiceParams
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ah, right sorry. I would think you would need to create a Price object to handle the amount for your Invoice in this case. This guide has a better explanation than I could give: https://stripe.com/docs/invoicing/integration/quickstart?lang=java
Can we not create invoice with custom line items without the price objects?
Hi there
You should be able to create invoice items only specifying amount. See this endpoint: https://stripe.com/docs/api/invoiceitems/create#create_invoiceitem-amount
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I created this, and I also attached to the invoice. But the invoice due is still o
Can you share invoice id? And invoice item id that you created?
Actually, I was able to create the invoice and it's showing the right amount now. Here is ths snippet ``` Invoice stripeInvoice = Invoice.create(invoiceParams, requestOptions);
var invoiceItemCreateParams = InvoiceItemCreateParams.builder()
.setAmount(100L)
.setCurrency("inr")
.setDescription("Product A")
.setInvoice(stripeInvoice.getId())
.setCustomer(customerId)
.build();
InvoiceItem.create(invoiceItemCreateParams, requestOptions);
var finalized = stripeInvoice.finalizeInvoice(requestOptions);```
Thanks!
Awesome