#3l3ktr0l4mpe-subscriptions
1 messages · Page 1 of 1 (latest)
@spark seal hi! well there's no such thing really as having a trial period for a specific product.
I assume you mean something like, you charge for a $50/mo product and a $20/mo product, and you want somehow for the $20/mo to start later
that's not something we natively support so it requires some workarounds
the real world example is: we have a customer subscribing to user licences, and hardware products for using with the software. the hardware products are recurring too, but we dont want a trial period on this one. only the user licenses should have a trial period
usually the way to do this are :
- add a one-time coupon to the CheckoutSession so the $20 one is not charged right now(it starts charging the next month)
- use SubscriptionSchedules to update the subscription to start charging the $20 in future(https://stripe.com/docs/billing/subscriptions/subscription-schedules/use-cases) , but this doesn't really integrate directly into Checkout or show it to the customer unfortunately
yeah that's not a thing our API does unfortunately, a trial period is per-subscription, either the whole thing is on trial ,or nothing is
it is possible to have a Checkout with one-time prices that are charged now, and recurring prices that are on trial, but you can't have one recurring price on trial and another not
so what happens when setting the trial period for the price in web ui where it says "Legacy"
too bad :/
so the easiest way would be to add a coupon matching the price for the user licenses, right?
not best looking in checkout, but should be the same result we wanted
yep, a coupon would work
okay i will check the documentation on coupons
can we just provide this to stripe.checkout.sessions.create call?
yeah thats what i found in combination with this: https://stripe.com/docs/api/coupons
but seems like we have to create a specific coupon for every checkout session? is this the way to do it? feels like we will spam the coupons section with this?
because for every checkout the amount would be different. for example one customer orders 10 user licenses 10€ each, the amount would be 100€, another customer orders 5 user licenses for 10€ each, the amount would be 50€
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
the link you sent, also states that it is possible to add negative invoice items. maybe thats better? then we need to create a price once with negative currency amount and can set the amount to the same as the product we want to give the trial to
I was going to mention negative items too. I think that works but I haven't tested it. In theory, you create a Customer object, then https://stripe.com/docs/api/invoiceitems/create for a negative amount, then pass that Customer into customer when creating the CheckoutSession. In theory the CheckoutSession shows the negative amount then. Would have to be tested.
i will discuss this approaches with the customer and will come back to you if i need further help 🙂 thank you so much so far!
{
price_data: {
currency: 'eur',
product_data: {
name: '1 Month Test User License',
},
unit_amount: 400,
},
quantity: users * -1,
}
this throws the exception: "This value must be greater than or equal to 1."
seems like it is not accepting negative quantity :S
when setting the unit_amount to negative value, it says "Invalid non-negative integer"
hmm, well you can't pass a negative quantity no. I don't think that' what we were discussing
and yes, the line items in Checkout can not be negative
how do i have to understand this?
but invoice items (which is a different API, like I said above, you create a Customer and some InvoiceItems upfront) can be negative, and then pass that Customer to the session