#Roopa

1 messages ยท Page 1 of 1 (latest)

copper saffronBOT
scenic ginkgo
halcyon kelp
#

req_9rWBuKh8a7SPcb

scenic ginkgo
#

That invoice is paid. You can't voided. What you want to achieve exactly ? to refund the customer ?

halcyon kelp
#

We are still in the development phase, in certain condition i want to make invoice 'void'.

#

I am using a test clock is it problem?

scenic ginkgo
scenic ginkgo
halcyon kelp
#

I am trying to do it when invoice is in the finalised status and still getting that error.

scenic ginkgo
#

can you share the requestId ?

halcyon kelp
#

same request_id 'req_9rWBuKh8a7SPcb'

#

As soon as it passes above web hook block invoice is becoming 'paid' state.

scenic ginkgo
#

Why you want to void the invoice? may I understand the use case ?

halcyon kelp
#

We want to add 2 yearly subscription to our system.

#

and as we cannot create 2 yearly using stripe we thought of creating yearly subscription and make alternative year invoice as void.

scenic ginkgo
#

What you can do is to create a yearly subscription with the price of two year. and for the second year you downgrade the subscription to a 0$ subscription.

halcyon kelp
#

what about next to next year? we have to again update it to original price?

scenic ginkgo
#

yes

halcyon kelp
#

ok. I will try that.

#

what was the issue with 'void' above?

#

and is there any other alternative option than downgrading the subscription?

scenic ginkgo
#

Your integration is trying to void an already paid invoice.

halcyon kelp
#

yes I got it, but will not be any gap between finalised invoice become a paid?

scenic ginkgo
#

Stripe finalize and send the invoice after one hour from being created. In this hour you can void, edit the invoice...

halcyon kelp
#

you mean I have to try voiding it in the InvoiceCreated webhook?

halcyon kelp
#

Let me try that now.

#

I am getting the same error, even though invoice status is 'draft'.

#

request id is :
req_Wnk22BzBtXVXZo

scenic ginkgo
halcyon kelp
#

you mean: we have to move draft invoice to finalize through api and void it?

scenic ginkgo
#

Yes try that.

halcyon kelp
#

I tried it but still the same error.

scenic ginkgo
#

Could you please share the requestId?

#

Is it paid too ?

#

once the invoice was finalized ?

halcyon kelp
#

req_VF2wro8odmvMXo

#

yes, it is showing paid.

scenic ginkgo
#

OK, so the invoice collection_method is charge_automatically as it was created from a subscription. So once it's finalized, its paid directly.

#

So can't do this with automatic invoice.

#

You need to change your logic for designing the 2 years subscription.

#

You can use the 1st option I mentioned. or you create a free yearly subscription, and each two year you charge the customer a manual invoice.

halcyon kelp
#

Is there any option where we can make invoice amount has '0' ?

icy shell
halcyon kelp
#

I tried the above and getting error: "This value must be greater than or equal to 0 (it currently is '-0.35e4')."

icy shell
#

-0.35e4 indicates you're not passing an integer

#

I don't know .NET as well as you likely do, but I imagine you want to do Math.Round(-35 * 100) or something like that

halcyon kelp
#

ah! sorry I hard coded value and did not realis it.

#

Thank you for your help. I will try it and let you know later.

halcyon kelp
#

It is taking only positive values not nagative value.

exotic thunder
#

Hi there ๐Ÿ‘‹ you cannot pass a negative amount via price_data. The price_data hash is used to create a Price object adhoc, and those cannot have a negative amount associated with them. To create an InvoiceItem with a negative amount, you will need to use the amount parameter instead:
https://stripe.com/docs/api/invoiceitems/create#create_invoiceitem-amount

halcyon kelp
#

yes, I tried using the amount and I am getting error related to tax.

exotic thunder
#

Can you share the ID of the request that returned that error?

halcyon kelp
#

req_VHdi7ajEtHkNNr

exotic thunder
#

Thank you, pulling that up.

halcyon kelp
#

InvoiceItemCreateOptions object does not have tax_behavior property

exotic thunder
halcyon kelp
#

Yes, I am on 40.8.0