#timothy_api

1 messages ยท Page 1 of 1 (latest)

vernal zenithBOT
ebon krakenBOT
#

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.

vernal zenithBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1257301579896455192

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

prisma sphinx
#

request id = req_peaUZaDVT5n8wr

#

AUG 1 - SEP 1, 2024
Additional Category' qty is still 2. I want it to be 1.

stuck pendant
#

Hi, let me help you with this.

#

Apparently in the current phase it's still quantity: "2", since it's not August.

prisma sphinx
#

A user buys a basic subscription ($30) and then buys 2 add-on (2 x $5). And immediately or in a few days he cancels 1 add-on, which will be canceled on 8/1. So after 8/1, there should only be 1 basic membership adn 1 add-on.

#

I use the subscription update API to decrease the add-on qty.

#

He pays $30 immediately. On 8/1, he will be charged with $30 + prorated $10. On 9/1, he should be charged for $30 + $5.

vernal zenithBOT
wraith osprey
#

Well the schedule currently only has to phases 2. The current phase for 1/7-1/8, and then the 2nd phase for 1/8-1/9 which would be billed on 1/8

#

Not really sure what your expectation is here? You can't see beyond the next period which is 1/8-1/9

prisma sphinx
#
  1. I want the phase 2 to be infinite. Is there a way to do that?
  2. I don't know why there will be a $50 charge.
    I want the charge to be
    7/1 $30 (membership)
    8/1 $45 (membership + 2 add-on for July + 1 add-on for Aug)
    9/1 $35 (membership + 1 add-on)
    How do I do that? I use the subscription schedule update. Is it not correct?
#

From the screenshot, my subscription schedule update API that reduces the add-on qty from 2 to 1 doesn't seem be reflected anywhere. Thus the $50 charge for Aug1 (membership + 2 add-on for July + 2 add-on for Aug)

wraith osprey
#
  1. I want the phase 2 to be infinite. Is there a way to do that?
    That's the default behaviour for a schedule once it 'releases' (i.e. at the end of the phases, assuming you have end_behavior: 'release' set)
  2. I don't know why there will be a $50 charge.
    You likely need to disable prorations in your phase: https://docs.stripe.com/api/subscription_schedules/update#update_subscription_schedule-phases-proration_behavior
prisma sphinx
#
  1. yes

I have problems adding proration behavior on the top level or phases level.
Received unknown parameter: proration_behavior
https://dashboard.stripe.com/test/logs/req_CxGie2txfDg2P6?t=1719837410
Invalid array
https://dashboard.stripe.com/test/logs/req_OirLX2uy8uaM4Y?t=1719837282

wraith osprey
#

Well you're passing it inside the phases array, but not into an actual index. Should be phases[1][proration_behavior]

prisma sphinx
#

that seems to work, thanks

#

So I have 2 subscriptions here. There are 2 subscription id. This is confusing.
sub_1PXjjGArrDNbBkjG3miQYxp9 ($50 on Aug 1)
sub_1PXjkUArrDNbBkjGt3oIMm7r ($35 on Aug 1)
In my DB, I am keeping the 1st ID, sub_1PXjjGArrDNbBkjG3miQYxp9.

  1. Would this be a problem? Does the subscription schedule update APi returns a new subscription ID?
  2. Do I need to delete the 1st subscripition?
#

Without the proration, a $40 invoice will be finalized and charged in 1 hour. That doesn't sound right because the user has already paid $30. See the draft section.

#

here is the request id = req_JihcUAiHQOYvYZ

dawn mason
#

Hi there ๐Ÿ‘‹ I'm jumping in as my teammate needed to step away. I'm taking a closer look at the request you shared.

#

What are you trying to do here? It looks like the request that was made was trying to create a Subscription Schedule from scratch.

prisma sphinx
#

Here is the use case.
A user buys a basic subscription ($30) and then buys 2 add-on (2 x $5). And immediately or in a few days he cancels 1 add-on, which will be canceled on 8/1. So after 8/1, there should only be 1 basic membership and 1 add-on. He pays $30 immediately. On 8/1, he should be charged with $30 + $10. On 9/1, he should be charged for $30 + $5. (no proration)

#

I am trying to use the subscription schedule update to reduce the add-on item qty.

#

But your question makes sense.

#

I didn't pass in a schedule id. So a new one is created.

dawn mason
#

When you're updating Subscription Schedules, you will want to pass in all values within phases that currently have values. The problem with this request is that it doesn't know whether you're trying to change the timing of the phases or not, so it isn't sure what to do. You'll want to include the start_date and supporting end_date or iterations for the phases so they can be timed accordingly.

#

That second request still has a phase missing a start_date, which is why you're seeing that same error.

prisma sphinx
#

'When you're updating Subscription Schedules, you will want to pass in all values within phases that currently have values. "
I don't understand what "within phases" mean.
If I put a start date in phase 0, it says I can't change the start date of current phase.
I have passed a start date to in phase 1. but I don't want a end date or iterations to it . The new item qty should be permanent every time I change the qty. Is it possible?

dawn mason
#

Before updating the Subscription Schedules, look at the contents of its phases array. When you making the request to update the Subscription Schedule, pass back in all values you found in phases that were set, adjusting the ones that you want to change.

For start_date in phase[0] specifically, pass back in the existing value there. Don't try to change it, but still pass it in. Let me know if the error persists from that.

prisma sphinx
#

I am using Bubble. It is very difficult to set a API that takes in dynamic input and return dynamic response. I need to know what the fields are and pass in a valid values to initialize a API connection. Then Bubble will get the response and parse it into a structure to be available to the app before I can actually use the API in the app. So I need to guess the fields and values and call the API and hope it works.

#

It doens't make senses that I need to pass in all the existing fields. the API doc doesn't mention that.

dawn mason
#

Oh, I didn't realize you were using a no-code approach for making these API requests. Unfortunately it's not a framework I've used before, so I can't really make suggestions on how to better leverage it here. Subscription Schedules do require somewhat complex integrations, they may not be well suited for that platform, but I'm not entirely sure.