Closed pjgg closed 1 year ago
@pjgg Github issues are limited to bugs with the library itself and can't be used for support questions like yours. I recommend working directly with our support team for help instead if you have further questions after the advice I'll give below. You can contact them here: https://support.stripe.com/contact
The error message explains that you have to pass the quantity
parameter so that's what you need to do here. Your code is passing line_items[0][price_data]
and not line_items[0][quantity]
. For some reason you have the code there but commented out and that parameter is required.
If you want usage-based billing you should read this doc first and make sure that the Price you create is properly configured for metered billing. For that, you can't just use price_data
in that case and need to create the Price upfront and pass the usage_type: 'metered'
parameter.
Describe the bug
I am trying to create a programmatic
SessionCreateParams.LineItem.PriceData
as a part of checkoutForm in Java and I am getting the following exceptioncom.stripe.exception.InvalidRequestException: Quantity is required. Add
quantityto
line_items[0]``Snippet
Looks like that is required to have a "Quantity".
The problem is that I am looking for a
Billed monthly based on usage
price and based on the Doc looks like we should not provide a "Quantity" on those cases.So my question is, is this a bug? or I am missing something else?
To Reproduce
Expected behavior
I would expect to be able to create a Product with a monthly metering price.
Code snippets
No response
OS
macOS
Java version
17
stripe-java version
latest
API version
latest
Additional context
No response