#emak_api

1 messages ยท Page 1 of 1 (latest)

weak gullBOT
#

๐Ÿ‘‹ 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/1266408607226789890

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

past cobaltBOT
#

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

foggy quartz
#

Hi there ๐Ÿ‘‹ can you share the ID of a Subscription where you saw this behavior, so I can take a closer look at it and what settings it used?

sage hazel
#

Sure, one moment

#

sub_1PgpU3CXFZDNk018TnUqIX3q

#

This is under testing

foggy quartz
#

Thank you, taking a closer look at that.

sage hazel
#

Let me double check as well -- I'am seeing a direct event on going from trial to pause which is what I would expect.

#

Yeh I do see that when I send a update on trial ends at to 5 seconds from now it makes it look like the subscription is "Active" for a moment and then goes into "Pause"

#

Ahh that is a horrible first snapshot, but it was under "Boom" and showed Active for a moment then turned to "Paused" + "Trial ended Jul 26"

#

This subscription id is = sub_1PgpcKCXFZDNk0183JOLmKb8

foggy quartz
sage hazel
#

Yes, I do see that but maybe the UI takes a moment to update?

#

If I may, I can record a quick video illustrating this

foggy quartz
#

Sure! I do want to warn you though my teammates and I focus more on the API side of these flows in this forum, so I'm not quite as familiar with how the dashboard may represent these changing states.

sage hazel
#

Ohh okay, well I think its fine because I think the API or the webhooks aren't telling our side that they are active

#

Just a strange intermediate state I think

foggy quartz
#

Agreed, if the dashboard is showing something different than the API, I do think that's worth having our teams look into. Even if it doesn't actually impact your integration.

sage hazel
#

Sounds good, I'll continue to record it then

#

To recap, what I do is:

  1. Create subscription on trial
  2. Mark it to be expiring in 5 seconds from now
  3. It says "Active" on the UI until a little bit then it says "Paused" (which is what I expect from my cancelation behaviour)
#

May I get your review on the flow we've got for handling customers that end their trial and then they pay us which should resume their subscription? I just want to make sure that we are making good use of the API and not making silly mistakes somewhere.

foggy quartz
#

Hm, the Loom controls aren't rendering correctly to let pause and focus on certain spots. Can you share the ID of the Subscription from that video?

sage hazel
#

sub_1PgprrCXFZDNk018slpCLjlk is the ID of the subscription in that video

#

On the flow:

  1. We create a subscription with the end_behaviour as "pause"
  2. When the trial ends we get a webhook response that tells us it is paused, we do what we do in our product to handle that.
  3. When they input their payment information after trial ended and they are paused, we call "resume" with proration "create_prorations" and billing cycle to "now" so that we can generate a invoice of the current # of users (they pay against that number)
  4. Next we call pay_invoice because in order for them to resume fully into active, they have to pay the invoice I just created from the previous step. After this, they are now active.
  5. Sync with Stripe and all is good.

This works right now for us, but I wonder if there was a need to do step 4 in which I call the API to pay the open invoice.

foggy quartz
#

Yeah, that's very strange, I'm not seeing anything in the history of that Subscription that would cause it to go into an active state. I'd suggest writing into our Support team, and provide them with that video, so they can have the right term further investigate that dashboard behvior.
https://support.stripe.com/?contact=true

#

Taking a look at the flow you described

sage hazel
#

Thanks!

foggy quartz
#

Looking at the state of the Invoice, I do believe some action needs to be done for Step 4. But, I think you may have some flexibility there around what action you take. Explicitly making a request to pay the Invoice works, but you may also be able to update the Invoice and set auto_advance to true which allows our automatic processes to progress the Invoice lifecycle.