#stixxs_api

1 messages ยท Page 1 of 1 (latest)

cunning gyroBOT
#

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

cosmic yokeBOT
#

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.

mental cave
#

hello! can you share more about what you mean by resuming their subscriptions?

sour wing
#

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

mental cave
#

so i assume the subscription is probably in past_due state at this point?

sour wing
#

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?

mental cave
#

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

sour wing
#

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.

mental cave
#

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

sour wing
#

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.

mental cave
#

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

sour wing
#

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 ๐Ÿ˜„

mental cave
#

feel free to reach out again in case you run into any other issues!

sour wing
#

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?

mental cave
#

it will yes

sour wing
#

^^ that is awesome