#ani_subscription-trialing-behavior
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.
⏱️ 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/1505948808998289560
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there, looking into this now
req_njkQn68hnEoqj6 this is the new one please investigate
I looked at the request that you shared, it's a POST /v1/subscriptions that failed with a 404. Did you mean to share a different request?
Ah got it
My understanding is that this is expected behavior. For sub_1TYSivHIZOmrTGc0HiO2F1QD, I see three events:
- customer.subscription.created
- customer.subscription.trial_will_end
- customer.subscription.updated
All three events show the subscription status to be "trialing", because it currently is (trial ends in 3 days). Because it's a trial, nothing has been charged yet. Is there some part of this I'm misunderstanding for your use case?
the user did not enter any credit card information for his subscription, how you judge the trialing
Apologies, can you clarify what you mean by "judge the trialing"? These are our docs on creating a subscription with a trial
https://docs.stripe.com/billing/subscriptions/trials/free-trials
It states this about the payment method:
When creating a subscription with a trial period, you don’t need to add a payment method. An immediate invoice is still created, but the amount is 0 and the Invoice Line descriptions include “Free trial” verbiage.
i think based on my setting, no credit card information or any payment method should not give trial status update to me from stripe
The way free trials work, a payment method isn't required as described here:
https://docs.stripe.com/billing/subscriptions/trials/free-trials#create-free-trials-without-payment
So the subscription you provided is working as described in that documentation. If you want to make sure a payment method is collected before offering a free trial, then you would have to collect that yourself before creating the Subscription.
i think based on my setting, no credit card information or any payment method should not give trial status update to me from stripe
Can you clarify which setting you are referring to, and the exact behavior you are expecting from that setting?
this is the request sent, req_njkQn68hnEoqj6, and is it enough for force stripe collecting credit card information from user before starting trial? if not, please show me how
{
"customer": "cus_UXXo10LoHYokkd",
"expand": {
"0": "latest_invoice",
"1": "latest_invoice.confirmation_secret",
"2": "pending_setup_intent"
},
"items": {
"0": {
"price": "price_1TYLevHIZOmrTGc0qhi9kojG"
}
},
"metadata": {
"billing_cycle": "monthly",
"pharmacy_id": "37",
"pharmacy_name": "KOIKW",
"plan_code": "pro_monthly",
"username": "KOIKW123"
},
"payment_behavior": "default_incomplete",
"payment_settings": {
"payment_method_types": {
"0": "card"
},
"save_default_payment_method": "on_subscription"
},
"trial_period_days": "3",
"trial_settings": {
"end_behavior": {
"missing_payment_method": "pause"
}
}
}
because I did ot enter any credit card information and close the payment window, but the status returns "trialing"
Right, this alone isn't enough to collect credit card information before the trial (it's close). You would need to handle the pending_setup_intent, which you are already expanding in your request. It's described a bit here:
https://docs.stripe.com/billing/subscriptions/deferred-payment
You would need to collect the card on the frontend using the SetupIntent client_secret. Again, this isn't the standard flow, the typical expectation for a Subscription with a free trial is that it will begin trialing without collecting payment method info
can you sent me a best practise? how to set the pending_setup_intent into my request
Hello 👋
I'm stepping in as my colleague needs to go. The link here https://docs.stripe.com/billing/subscriptions/deferred-payment is our canonical guide to collecting payment methods up front while still offerring a free trial. Please read it carefully. If you have questions about specific parts of this guide, I will be happy to answer them.
hi, is it possible that you tell me which part i'm missing to ask for a defereed-payment (from the request?)
It is important you fully understand what you are implementing. I strongly urge you to carefully read the complete document
based on the above reqeust, sometime you did provide status update "incomplete" but sometime you returns "trialing"
The above request creatred a Subscription with a free trial period. That means, even without a saved Payment Method, it is considered valid. This is what my colleague has already explained
your responses are not consists!
Can you share an example request where you received a status of incomplete?
req_Zv7LyXvefQEZwa {
"customer":
"cus_UXX8Z6WpKKFczX",
"expand"
: {
"0":
"latest_invoice",
"1":
"latest_invoice.confirmation_secret",
"2":
"pending_setup_intent",
},
"items"
: {
"0"
: {
"price":
"price_1TYPKWHIZOmrTGc0TmWq7by1",
},
},
"metadata"
: {
"billing_cycle":
"annual",
"pharmacy_id":
"1",
"pharmacy_name":
"test",
"plan_code":
"pro_annual",
"username":
"agtest",
},
"payment_behavior":
"default_incomplete",
"payment_settings"
: {
"payment_method_types"
: {
"0":
"card",
},
"save_default_payment_method":
"on_subscription",
},
}