#akdj16 - question
1 messages · Page 1 of 1 (latest)
Hi! Thank you @hard bone
Let's me describe first the project:
The background to the project: we have three main entities:
- our service platform
- some customer companies (virtual entity which groups a set of employees/customers)
- their employees (stripe customers)
Here the current workflow:
- Customers have to sign up on the service platform to access to the free content.
- Customers have to subscribe themselves to the service platform to enjoy the premium services.
- We use the stripe.subscription api to create subscription, and create & finalise invoices automatically (collection_method=charge_automatically)
- Company can create discount coupons (stripe coupons, let’s name it companyCoupon) on our platform, and its employees who subscribe for the first time will take advantage of it.
- The coupon is not applied to the customer, not on the invoice (as we have not the draft invoice). It is applied on the subscription, during the subscription creation.
- This coupon is used for encouraging employees to subscribe to our service platform.
- The coupon can be applied only once on each employee's subscription
What next?
Currently, we want to add a sponsorship feature, employees who are subscribed can send invitation link to their colleagues to encourage them to sign up and subscribe too (only colleague in the same corporation company)
Vocabulary:
- an employee who is signed up and subscribed by using the link, we call him/her a sponsored
- an employee(customer who already signed up and subscribed) who sends the link to invite a colleague: we call him/her a sponsor
The idea:
- each time a sponsored signed up via the link, we will create a discount coupon (stripe coupon, let’s name it userCoupon) and will apply it to the future subscription.
- each time, a sponsor succeeds to sponsor a colleague (signed up and subscribed), he/she will get a userCoupon in his/her virtual account
- the sponsor can accumulate two or more userCoupons and use them anytime he/she wants.
- after subscription, a sponsored can became a sponsor by inviting other colleagues
The issue:
We notice that the stripe.subscription creation api can only take one coupon but, invoice can take two or more coupons during the draft status. But invoices are automatically created and finalized for the first one and also at the subscription renewal.
We don’t want to send email to the user during the subscription, so don’t want to set collection_method=send_email, but we want to edit the invoice before finalize the payment.
Questions:
- Maybe stripe.subscriptionSchedule creation api is the solution, but how to retrieve the draft invoice? stripe.subscriptionSchedule creation doesn’t return invoice’s id,
- By default, do the stripe.subscriptionSchedule has the same behavior of the stripe.subscription?
- How should we create it to have the same configuration of the stripe.subscription except for invoice.
Did you have any other mechanism solution/advise about how to create the feature?
Sorry about that huge description, I tried to be clear and short...
If I understand correctly, you want to find a way to add multiple coupons to a subscription?
yes, exactly. For instance, we have already companyCoupon feature. therefor sometime, customer will have the two kinds of coupon available. so we need to add companyCoupon and also add userCoupon to his/her first subscription invoice
Got it! It's true that you cannot add multiple coupons when creating a subscription, but you can when creating an invoice. The issue, as you said, is that the fist invoice of the subscription is automatically finalized so it cannot be edited. But there are two workarounds to have the first invoice of the subscription in draft status:
- Add a very short free trial to your subscription (like a few seconds)
- Create the subscription with a subscription schedule
And to answer your specific questions:
- Maybe stripe.subscriptionSchedule creation api is the solution, but how to retrieve the draft invoice? stripe.subscriptionSchedule creation doesn’t return invoice’s id,
The subscription schedule will return a subscription object. And the subscription will have alatest_invoiceproperty- By default, do the stripe.subscriptionSchedule has the same behavior of the stripe.subscription?
If you are only use the subscription schedule to have the first invoice in draft, then yes it will behave the same way as a regular subscription- How should we create it to have the same configuration of the stripe.subscription except for invoice.
You create a subscription schedule with a single phase
Ok, that's very clear!
about the subscription schedule with a single phase, does that mean it will be renewal itself (every month) like a subscription? I read this https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-phases, but I still don't know very well what is a phase?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
You could have a single phase that lasts one month. And if you set end_behavior to release, the subscription will then continue as normal. https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-end_behavior
But I would recommend to test that on your end. You can use Test Clocks to see what happens exactly https://stripe.com/docs/billing/testing/test-clocks