#stixxs_api
1 messages ยท Page 1 of 1 (latest)
๐ 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. Thank you for your patience!
โฑ๏ธ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime! If this thread is closed and you have another question you'll need to start a new thread.
๐ 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/1213004741974691891
๐ Have more to share? You can add more detail below, including code, screenshots, videos, etc.
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.
- stixxs_webhooks, 17 hours ago, 7 messages
- stixxs_webhooks, 1 day ago, 14 messages
- stixxs_api, 2 days ago, 10 messages
hello! can you share more about what you mean by resuming their subscriptions?
Hi Alex,
So when a subscription recurring payment fails, the sign in to our platform is immediately blocked.
What we want to do next is stop all payment retries and simple send an email to the customer with a payment link that allows them to pay the outstanding amount for the subscription, not start a new one.
We will then automatically renable their account once the subscription status changs back to active
so i assume the subscription is probably in past_due state at this point?
Um, I would assume so.
If a recurring payment for a subscription fails, is the subscription status automatically set to past_due in your platform? Or do we need to programmatically change this ourselves?
it should move to past_due, but it depends on your Billing settings too. For simplicity's sake, lets just take it that it's past_due
i think you would want to use the Subscription's latest invoice's : https://docs.stripe.com/api/subscriptions/object#subscription_object-latest_invoice hosted invoice url and send that to your customer to pay : https://docs.stripe.com/api/invoices/object#invoice_object-hosted_invoice_url
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
you don't have to make two requests, you can expand latest_invoice https://stripe.com/docs/api/expanding_objects when retrieving the Subscription
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Perfect mate thank you!
I will give this a go
Oh sorry I also had another question
We've found that customers records don't seem to use email as their unique identifier for upserting.
So for example, if a customer cancelled their subscription 6 months ago and then creates a new one, it seems to create a new customer record in the stripe dashboard.
Is there anyway to control this behaviour?
We programmatically create azure B2C user accounts when a subscription is created and paid, we then store the user object ID against the customer record in stripe... If it creates a new customer record in stripe, then we lose the ability of tracking the object Id.
hello! that's expected behavior, Stripe doesn't de-duplicate customers with the same email for you at the moment, so you'll need to implement the logic for that yourself
generally, you can check if a Customer already exists with that email : https://docs.stripe.com/api/customers/list#list_customers-email
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Nice! Is there a merging tool on the API?
If not, this should suffice anyway as I can obtain the object id from the previous record and apply it to the new one.
no, unfortunately it's not possible to merge Customers ๐
you could consider creating the Subscription again on another Customer and then cancelling and deleting the old Subscription and duplicate Customer
Yeah that's all good, we build the logic for the rest! Thank you very much ๐
Have a good day/evening! Whichever it is for you ๐
feel free to reach out again in case you run into any other issues!
Hi Alex, not sure if you're still online.
Quick question, if a subscription payment fails and we do use the smart retry policy, will it recognise if a user has made payment manually using an invoice link we send them?
it will yes
you can totally try this out. in case you haven't seen this yet, you can use test clocks to mimic the passing of time : https://stripe.com/docs/billing/testing/test-clocks
^^ that is awesome