#min.k4501
1 messages · Page 1 of 1 (latest)
Hello! We'll be with you shortly. 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.
What do you mean by "after a successful Create Subscription API and it fails," ?
There was a translation problem, please check the text again.
Do you have the ID of the request that failed?
And what transaction do you want to ensure?
Since we have two behaviors, we need to be able to combine them into one.
The need to guarantee a transaction means two acts.
- Create Subscription Schedule (with subscriptionId)
- update Subscription Schedule (with priceId you want to change after the end of the current subscription cycle)
Then you should check the response from update Subscription Schedule API request. The error message in the response will explain why the update fails
If it's two API calls, that's a split transaction. Is there a way to talk to the stripe software developers?
You are chatting with one.
I'm talking about distributed transactions.
If we're not talking about lookups, but state-changing actions like creates, updates, and deletes, this is directly related to the distributed transaction problem.
Call flow
- Create Subscription Schedule
- Update Subscription Schedule
Since both behaviors are state-changing, if call 1 succeeds and call 2 fails due to network issues, only call 1 will be left as garbage.
Downgrading to a different product after the end of the current subscription cycle requires 2 calls to the subscription schedule API, which is directly related to the distributed transaction issue, leaving garbage behind.
It would be nice to have a single API for scheduling a product change after the end of the current cycle of a subscription, just like the one you created for the Subscription domain (cancel_at_period_end).
No, there's no atomic API to complete two actions
if your concern is about a subscription created by mistake, you can cancel it. https://stripe.com/docs/api/subscriptions/cancel
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Um, so I'd like to ask you another question.
Sure, how can I help?
Wait a minute please
I want to downgrade a subscription after the end of the current cycle.
To do this, I use the call flow below Please take a close look at the call flow.
- Create a subscription using the Checkout Session API.
- Apply a 50% off coupon that can be used indefinitely.
- call the Create Subscription Schedule API (passing the subscription identifier in the subscription field)
- call the Update Subscription Schedule API. (passing downgrade item priceId)
At this point, the discount coupon should be applied after the Update Subscription Schedule API call because the existing coupon can be used indefinitely.
However, after calling the Update Subscription Schedule API, the coupon is gone.
Q3. Should I also pass the coupon when calling the Update Subscription Schedule API? In this case, should I use the coupon identifier of the first phase, which is number 0 in the phases Array returned as a result of calling the Create Subscription Schedule API?
What's the subscription ID?
Since I'm creating, deleting, and looping through multiple subscriptions, I don't think it would be appropriate to pass a specific subscription identifier.
Do you want me to pass it on though?
Give me the subscription ID where you saw the coupon is gone.