#adam-coupon
1 messages · Page 1 of 1 (latest)
Hi there, is your customer going to input the code manually or you want to attach the coupon when creating a Checkout session?
Preferably both. I'd prefer an automated option, but I'm trying to go no-code
So, I'll be using the new pricing tables features
If you are applying the coupon programmatically, you can write your own business logic to only apply coupon if the customer email address matches certain domain.
Does this coupon show up in the checkout panel? ie, can someone 'cheat' and share it with their friends?
If you allow the customer to apply the promo code, you can specify the customer property when creating a promo code (https://stripe.com/docs/api/promotion_codes/create#create_promotion_code-customer) so that this promo code can only be use be this customer.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I think this is what I want, but for a domain
There are two types of discount code
- coupon - a merchant facing code, you usually apply it programmatically when creating a checkout session
- promo code - customer facing code, the customer can use it a checkout page
There's no direct way to apply promo code to a group of customer with the same domain, you need to create a promo code for each of the customer.
OK. So- if we knew the email address beforehand we can probably do something like: if email matches the criteria, then we can create a coupon just for that user then go to checkout
We'd end up with lots of coupons but hey, it'll work
Actually you just need to create one coupon, if you are going to apply the coupon programmatically.
Huh, you're right
You only need to create many promo codes if you want to allow the customer to apply it manually in checkout page.
Thanks! I think I understand now
Cool! happy to help.
Next question: if we have a bunch of subscription products (e.g. student products, commercial products) can we restrict which products a customer can see in the customer portal?
e.g. if they've got a commercial email address, and have signed up to a commercial subscription, we don't want them to be able to visit the customer portal and switch to a student plan
Ideally we'd have multiple portals
Sure, you can use a portal configuration to specify the list of products (https://stripe.com/docs/api/customer_portal/configurations/create#create_portal_configuration-features-subscription_update-products) that you wish a customer can update to.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Not necessary, you can use the same portal configuration for many customers
So you can create a few configurations (e.g., a customer config and a commercial config), and use the appropriate config when creating a customer portal session for a particular customer.
Cool! And this would define what they see in the portal
This is exactly what I wanted, thanks
No problem!