#manuel_api

1 messages · Page 1 of 1 (latest)

opaque wyvernBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1428125927388221643

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

gloomy turtle
#

Hi there

#

Generally, the answer is webhook events. Probably invoice.paid - let me look at your example

modern basin
#

ok

#

what happens in my case is that when the payment fails, I have to check whether it is an update or a subscription renewal in order to carry out the rest of my project logic.

#

im using the "payment_intent.payment_failed" event btw

gloomy turtle
#

Do you have an example of such a failure? For the Subscription that relates to the request you provided above, the webhook events are out of rention so I can't view them

modern basin
#

yes, let me look for a failed paymetn

#

this is a payment intent failed: evt_3SIFQMDtLlgoCDIr1aWT14DH

gloomy turtle
#

well on that event there's description: "Subscription update",

modern basin
#

Yes, I see that. But I'm curious to know if the renewal and update use the same description

#

or I can continue to use “billing_reason”

gloomy turtle
#

I don't think so but I'm looking through the events.

Invoice events have billing_reason:

#

ah it seems like this customer is on an annual plan. Let me look at an example on my own account

modern basin
#

ok great

gloomy turtle
#

yeah, for the first Invoice's payment, the payment_intent.xxx events will have description: "Subscription creation",

#

and invoice.xxx events will have billing_reason: "subscription_create",

modern basin
#

ok

#

And when do customers renew?

#

or update?

#

subscription_cycle and subscription_update?

gloomy turtle
#

What do you mean by "renew"?

modern basin
#

when a subscription advanced into a new period

gloomy turtle
#

I guess I'm not clear on what you mean when you're asking when Customers renew. Customers don't "renew" - I think you're asking something else about the Subscription but I'm not sure exactly what. Could you give me a more verbose explanation of what you want to know, please?

modern basin
#

I am referring to when a customer's subscription expires and they renew/pay their subscription for a new period. Whether it is annual or monthly.

gloomy turtle
#

That depends on the interval of the Price on their Subscription

#

When Charges occur, absent updates that cut a new Invoice, are defined by the interval on the Price, whether monthly, yearly, or something else

modern basin
#

I just want to know if it is possible that in Invoice objects, the billing_reason for subscription updates can be used for expiration/renewal😮‍💨

#

I see that the customer's payment is to pay for the subscription period again, and the billing_reason on the invoice says "subscription_update" and not "subscription_update"

gloomy turtle
#

ah so like what are the possible values for billing_reason

modern basin
#

y e s

#

I would like to confirm whether the payment that was canceled is an update or a payment for a new subscription period

#

using the billing_reason

modern basin
#

then for a subscription renewal, the “subscription_cycle” is used.

#

?*

gloomy turtle
#

I think so but it would be good to test to confirm. I doubt that we distinguish since we don't have a value for billing_reason that provides an obvious answer in the api reference.

By the way, are you aware of our test clocks feature? https://docs.stripe.com/billing/testing/test-clocks

I highly recommend it; you can advance time on a subscription, make changes as you go, and create the scenario you want to know about

modern basin
#

So, was the invoice I sent you that was canceled a subscription update or a payment for a new period?

I see that it says “subscription_update,” but I don't understand why it appears if it's a payment for a new subscription period since it expired.

gloomy turtle
#

You're referring to in_1SIZyMDtLlgoCDIrCxm0wm7r?

modern basin
#

in_1SIFQ7DtLlgoCDIrDQdx24gU
in_1SH3KJDtLlgoCDIrKmfQGcVV

gloomy turtle
#

for in_1SH3KJDtLlgoCDIrKmfQGcVV - I see subscription_cycle on the invoice events, which makes sense because it is not the first Invoice on the Subscription