#krishnaKanabar - subscription
1 messages · Page 1 of 1 (latest)
Hi there. This seems like a good use-case for Subscription Schedules: https://stripe.com/docs/billing/subscriptions/subscription-schedules
I recommend reading that first. Let me know if that helps
I have read this already
but not getting how to actually implement it
and also how to setup $1 paid trial...and take $24($25 actual amount - $1 trial period amount)
I think you could do it by having the first phase charge $1 and then end right after. Then, the second phase will be a 1 month long and start after that with a 14 day trial and a price of $24 dollars. Then, the third phase will just be the normal $25/month subscription
My 14 days trial start when user pays $1. $24 should be deducted after trial period only....then why "second phase will be a 1 month long and start after that with a 14 day trial and a price of $24 dollars"??
Ok I don't think I was clear. Here's a better way to do it actually:
Phase 1: Charge $1 on Aug 1st (set the end date to Aug 15)
Phase 2: Charge $24 (set the end date to Sep 15)
Phase 3: Charge $25 per month every month
okay let me try
this could solve my use-case
So I need to create 3 prices in One product right?
- $1 - one time
- $24 - one time
- $25 - recurring
You could create the price objects, or you could just pass price_data for the $1 and $24 amounts: https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-phases-items-price_data
in this what is 'plan_JiX4v6L7JY0Vyt' where it is configured
Looks like you shared your secret key in here
I deleted the message
Be sure to roll it now
As it's been compromised
All good!
Just be sure to roll it
Taking a look at your ask now
But yeah you can pass a plan id where you pass a price id. Plans are just the older version of prices
okay
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
is there way to add 14 days to current date
in parameter end_date??
curl https://api.stripe.com/v1/subscription_schedules
-u 'secret key':
-d customer='my customer id'
-d start_date=now
-d end_date=now + 14
-d end_behavior=release
-d "phases[0][items][0][price]"=plan_id
-d "phases[0][items][0][quantity]"=1 \
What language are you coding in? Or are you doing everything in curl
Your language should be able to add dates
I am using php but right now first testing in curl
it's fine for now but if you know then do let me know
Not a PHP expert, but looks like a couple options: https://www.geeksforgeeks.org/how-to-add-days-to-date-in-php/
If you're only testing in curl, just manually add
I am getting this error
{
"error": {
"message": "All phase items prices must be recurring.",
"type": "invalid_request_error"
}
}
curl https://api.stripe.com/v1/subscription_schedules
-u secret_key
-d customer=customer_id
-d start_date=now
-d end_behavior=release
-d "phases[0][items][0][price]"=price_id_for_$1
-d "phases[0][end_date]"=1660003200
-d "phases[0][items][0][quantity]"=1
-d "phases[1][items][0][price]"=price_id_for_$24
-d "phases[1][end_date]"=1662681600
-d "phases[1][items][0][quantity]"=1
-d "phases[2][items][0][price]"=price_id_for $25
-d "phases[2][end_date]"=1665273600
-d "phases[2][items][0][quantity]"=1
👋 I'm hopping in since @still sequoia has to head out - let me take a look
Do you mind sharing the request ID of the failing request?
how do I find it?
req_OFNgu4YaHDkB2L
You're getting this error because Price price_1LPp9eSJsXH2azWQ9DyDOzYW and price_1LPp9eSJsXH2azWQDSVf2oyl are not recurring - is there a specific reason you're using these one-time prices with subscription schedules?
Lurking back real quick. Sorry I might have caused some confusion there. Even though the user will just be charged 1 time for $1 and one time for $24, the prices will still need to be recurring since it is a subscription schedule. The end dates will just take care of the fact that the customer is only charged once
okay
$1 susbscription schedule is generating fine
but upcoming invoice is showing AUG 9 - AUG 26, 2022
rather than AUG 9 - SEP 9 and amount is $11.99
(Consider my main amount is $9(instead of $25) and $1 will be trial and rest $8 should be deducted on Aug-9 to SEP 9)
Can you share the subscription ID you're looking at?
Thanks! Let me take a look now
Ah, I see the issue - in your second phase you need to set billing_cycle_anchor: phase_start
In 3rd phase also this parameter required or only in second phase
I belive you'd only need it in the second p hase
I am getting values fine
where can I see my invoice SEP 9 - OCT 9 which will be my third phase
The only way for you to preview that would be to either wait until it's the next phase, or use test clocks to advance time and get to the next phase
I am able to see Upcoming invoice AUG 9 - SEP 9? ....In that also some price value is being deducted
"Unused time on LinkJoy MRR Plan after 09 Aug 2022" - $0.57
So second phase invoice is $8-$0.57 = $7.43 but I want $8 only
Then you also need to set proration_behavior: none https://stripe.com/docs/api/subscription_schedules/update?lang=ruby#update_subscription_schedule-phases-proration_behavior
I am using test clock...I am not finding clock_id
where do I find it?
I need it to
curl https://api.stripe.com/v1/customers
-u secret_key:
-d email="jenny.rosen@example.com"
-d test_clock="{{CLOCK_ID}}"
-d payment_method=pm_card_visa
-d "invoice_settings[default_payment_method]"=pm_card_visa
call it
How was the test clock created?
from dashboard
You can get it from the url of the test clock view in the dashboard: https://dashboard.stripe.com/test/test-clocks/clock_abc123
I followed above steps of subscription schedule
All working fine but initial invoice is of JUL 26 - AUG 26, 2022
but Ideally it should be JUL 26 - AUG 9 because first phase of schedule is 14 days
Can you post the ID of the Clock?
clock_1LPrbqSJsXH2azWQGpz64D6u
And have you created a Subscription Schedule with a Phase for the customer you're testing?
Apologies for the wait, the server is very busy.
It doesn't look like you've advanced the clock yet. I believe the initial invoice is going to be created as though there were no phase, until you advance the clock and a new invoice is created. Can you try advancing the clock and seeing if that has the default behavior you're expecting?
My issue is not solved yet
So I created subscription schedule
with 3 phases
- JULY 26 - 9 AUG( $ 1 charge - this is my 14 days trial with $1 fee)
- 9 AUG - 9 SEP ( $8 charge - Main price is $9 - $1 = $8 as user as already paid for 14 days trial)
- 9 SEP- 9 OCT - (recurring for every next month)
I used time clock to test
All working fine but initial invoice is of JUL 26 - AUG 26, 2022
but Ideally it should be JUL 26 - AUG 9 because first phase of schedule is 14 days
Okie. It's a long chat log so could you provide again your request id to create above Subscription, and the clock id if possible?
I want to start fresh
give me some time
Invoice Id -in_1LQ40GSJsXH2azWQWzRV1T3N
this is generating for JUL 27 - AUG 27, 2022
but first phase for subscription is from JUL 27 - AUG 9, 2022
Subscription Id - sub_1LQ40GSJsXH2azWQkGE0ICxn
what i want is that when user sign ups he need to paid $1 for 14 days trial. When trial ends he will be charged $8($9 main amount - $1 ). For example user sign up on JUL-26 then JULY 26- AUG 9 will be first phase where he will pay $1 and $1 invoice should be generated for time period JULY 26- AUG 9. Again on 9th AUG - 9th SEP , $8 invoice should be generated. And after that SEP 9- OCT 9, OCT 9- NOV 9,so on $9 invoice should be generated
Gimme some times to get through it
req id - req_mpzdLHG186zqX5
Your request looks correct. I can see your initial Invoice is https://dashboard.stripe.com/test/invoices/in_1LQ40GSJsXH2azWQWzRV1T3N and I believe it's for Jul 26 -> Aug 9. Where do you see it's Jul 26 -> Aug 26?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
in invoice description....also when invoice is getting downloaded ...that pdf file also shows Jul 26 -> Aug 26
okay
btw it's still a draft Invoice. Have you tried finalized it and see the PDF after that?
So I am getting why it's showing for 1 month....because subscription schedules requires phases to be recurring price only
so yesterday I tried $1 and $8 to be one time and $9 price to be recurring but api shows error
.
.
price Ids -
price_1LQ3b2SJsXH2azWQa2LY3ev2
price_1LQ3b2SJsXH2azWQ5NYlwGT6
price_1LQ3b2SJsXH2azWQrQC4UT6m
how to finalize
You can do it in Dashboard, or use the finalize API
The price should be recurring yes, otherwise api will error. I checked your setup at req_mpzdLHG186zqX5 and think you are doing it correctly
It's just the initial Invoice, while in darft mode, PDF displayed Jul 26-Aug 26 instead of Jul 26 - Aug 9
Could you try to finalize it and see if the finalized verseion's PDF displays correctly?
from dashboard I am not finding option
and API shows error
curl -X POST https://api.stripe.com/v1/invoices/in_1LQ40GSJsXH2azWQWzRV1T3N/finalize
-u secret_key:
"error": {
"message": "As per Indian regulations, export transactions require a customer name and address. More info here: https://stripe.com/docs/india-exports",
"type": "invalid_request_error"
}
Hmm looks like a different error. Can you update the Customer, adding a name and address as the error suggested?
I see. This looks like a bug on our end. Sorry for the inconvenience. Gimme some time to reproduce it
Hey, sorry the server is busy. Please bear with me. I might be able to test it in 5-10 mins ish
But generally I think this is a bug on our end, so you can write to Support to initialize an email thread, and we can track it from there
Please write to support@stripe.com
I am building a Monthly recurring plan of $9. Now when user sign-up I want to charge $1 and start 14 days trial. After trial ends, it should automatically deduct pending amount ($8).
For example, User does signup on 1st Aug. He will be asked to pay $1. After succesful payment, 14 days of trial will get start. On 15th Aug, $8 should be deducted from his card . Again on 15th Sep he will be charged $9, so on and on...How to achieve this in stripe?...As stripe only provides free trial. I saw online not but not getting exactly how to do it.
is there any other way I can fulfill this scenario other than subscription schedules?
I think you can just provide the summary here #1001496422283227167 message and mention this thread link
Perfect! We'll take a look a respond to you there via email
This thread has been archived. If you need help with anything else please ask in #dev-help or contact Stripe Support: https://support.stripe.com/contact
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
@shell orbit how may I help you?
this one
but didn't received reply
It's little bit urgent can you verify whether it's a bug or mistake from my side
.........................Use-case..........................
I am building a Monthly recurring plan of $9. Now when user sign-up I want to charge $1 and start 14 days trial. After trial ends, it should automatically deduct pending amount ($8).
For example, User does signup on 1st Aug. He will be asked to pay $1. After succesful payment, 14 days of trial will get start. On 15th Aug, $8 should be deducted from his card . Again on 15th Sep he will be charged $9, so on and on...How to achieve this in stripe?...As stripe only provides free trial. I saw online not but not getting exactly how to do it.
....................................................................
what's the email address that you sent the email from?
you can delete it if you want to
Someone is working on your ticket and they will be in contact with you shortly
okay
Issue will get fixed right?
So according to that I start building my product
Approx how much time it will take?
I'm not the one working on that ticket unfortunately so I'm not sure what the context is. Please wait for a reply on your ticket.
I can't say to be honest. it depends on the bandwidth and the time it takes for the ticket to be solved
we will reply asap. in the meantime I would have to close this thread now that someone is working on your ticket and ask you to be patient and we will attend to your case asap.