#marcin_stonly
1 messages · Page 1 of 1 (latest)
Hi there!
Can you share the request ID (req_xxx) where you see this error? You can find it here https://dashboard.stripe.com/test/logs
Also can you share the documentation link that says that you can use negative values?
Here is the part of documentation:
here's the link: https://stripe.com/docs/api/invoiceitems/create
It's under "Create an invoice item" > "unit_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.
Here's the error I get:
the request id is req_JJXwxuJ2laE7xj
Thanks! Give me a few minutes to look into this.
sure
The documentation says that amount may be negative. But in the request you shared you are using unit_amount_decimal, so it's not the same.
Sorry but I have to disagree. It says "Passing in a negative unit_amount will reduce the amount_due on the invoice."
And later for unit_amount_decimal it says "Same as unit_amount..."
But in the request you shares you are using this parameter
yes, cause the documentation says unit_amount_decimal is the same as unity_amount. I've also tried unit_amount and got the same error.
So it seems like both unit_amount and unit_amount_decimal are not supporting negative values actually
This is what I see in the documentation for price_data. I see no mention of negative amount:
Can you share the exact documentation link where you see that price_data.unit_amount_decimal can be negative?
Ok, so seems like it differs between price_data and the invoiceItem property unit_amount. My fault.
The question is how should I approach the case where I need to have a negative value for the invoice item ? Should I set it in price_details or only on the top level of the object?
No worries!
The question is how should I approach the case where I need to have a negative value for the invoice item ?
Then don't useprice_dataand useamountdirectly: https://stripe.com/docs/api/invoiceitems/create#create_invoiceitem-amount
Got it. Thanks a lot for claryfing. I appreciate your help. Have a great day!