#RK-hi
1 messages · Page 1 of 1 (latest)
can we do subscription for one time products as we can do for recurring products right!
Can you clarify what you mean here?
actually I have created a one time product
then at the backend I created a customer through api and want to subscribe that user through subscription api
\Stripe\Subscription::create(array(
"customer" => $customer->id,
"plan" => "price_1JcWieDucO0jOj0tam4rFlH6",
"trial_end" =>'now'
));
I used the above to create subscription
That price id looks like it is recurring so it should work
Correct, it needs to be a recurring price to be used with a subscription
but I want the user to be subscribed one time to that product and not getting any billing invoice later after each month
because on recurring product you will be invoiced monthly right?
Correct, you can still charge on one time prices just not with a subscription
What does your integration use? Checkout? Elements? Something else?
I can help find the documentation for one time payments with the product that you are working with
I want to have something like
the user subscribed to a product and will be initially charged of let say $100
and valid for 30 days only
after that he cannot use that product
if 30 days time period over
and if he again wants to use that product then he has to pay initial amount of $100 again for 30 days
If you want the subscription to cancel at the end of its first period you can set cancel_at_period_end to true when creating ithttps://stripe.com/docs/api/subscriptions/create#create_subscription-cancel_at_period_end
What is the difference between this and the customer being charged the normally at the end of each billing period?
Is it that they have to always opt in?
so in this case the user will not have to use that product service continously every month
he can opt in anytime and use that product for 30 days
and if he wants to come 6 months later then use that product then he can again subscribe and use it for 30 days
is that make sense?
So yes, you will want to use cancel_at_period_end. When the customer wants to renew you can reactivate the subscription https://stripe.com/docs/billing/subscriptions/cancel#reactivating-canceled-subscriptions
If the subscription has been cancelled like this, you will need to create a new subscription when they want to subscribe again
ok cool
I am looking in to the best way to do this. To reactivate the subscription you need to set cancel_at_period_end to false but then obviously you want it to be true again so it will cancel at the end of the next month
ok so cancel_at_period_end will cancel the subscription after 1 month right?
Correct