#smiley-dev-promotion-code
1 messages ยท Page 1 of 1 (latest)
yes, you can, you can create a coupon of duration=once https://stripe.com/docs/api/coupons/create?lang=python#create_coupon-duration
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
then generate a promotion code from the coupon
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Thank you @frigid crater , but Where can I input promotion code?
so that customers input the promotion code and set coupon if the code is correct.
you are using Stripe Checkout right?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
yeah, that's the code user needs to enter
But I don't need it for the subscription. I use default payment method for now.
if it is valid, the coupon will be applied underneath
Yes, it works for the checkout page, but I am not sure how can add it to the subscription with default payment method.
I have tried to set promotion code to the subscription when create a subscription, but the coupon hasn't been set to the subscription, otherwise other coupon worked well.
I set a promotion code, but paid full payment.
I see
you are having a trial
the promotion code will be applied on the very first invoice
which is a 0 dollar invoice because you have a 30 days trial
you will need to apply the promotion on the trial end.
I see, how can I set promotion code through the UI. I am not sure how can I create subscription with UI.
If I input the promotion code and then click the apply, which endpoint should I hit then?
Coupon will be applied when the subscription is created. right? and how can I validate promotion code before creating subscription with UI like above input.
depends on your integration path, you can
- if you are creating subscription through API : directly pass promotion code here https://stripe.com/docs/api/subscriptions/create?lang=python#create_subscription-promotion_code
- if you are integrating with Stripe checkout session, you can https://stripe.com/docs/api/checkout/sessions/create?lang=python#create_checkout_session-discounts-promotion_code Or you can allow your customer to enter the codehttps://stripe.com/docs/api/checkout/sessions/create?lang=python#create_checkout_session-allow_promotion_codes, Stripe Checkout will validate the promotion code automatically
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
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 understand with subscription page by validating stripe, but what I want to know is that which endpoint can I hit to validate promo code, i.e. I am curious what will be happened after click the apply in here.
I see
You can just list the promotion code by codehttps://stripe.com/docs/api/promotion_codes/list?lang=python#list_promotion_code-code
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
and check if there are any active promotion code exists
The returned promotion code will contain a lot of information that you can use for further checking as well as the promotion code could be set to apply for a Single customer or a set of products etc.
Ok. I see. thank you, and I am curious about the limit param so far, I am a big fan about the stripe, ๐
If there are more than 100 items in promo, account, customer and so on, how can I get all items?
i.e. I have no filter param for promo code here, so I can only get 100 items as maximum? as others...
๐ฆ
I don't think coupon doesn't affect to the subscription.
If I use another coupon that has no promotion code, it works.
You can always get all the items by using our pagination feature https://stripe.com/docs/api/pagination?lang=python
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 default is that stripe returns 10 per page with max 100 per page
understood pagination .:)
How about this solution:
we can use subscription item for the first subscription payment if there is a validated promotion code???
how do you think?
a bit weired.
Yeah, let me check, that is indeed weird.
can you share your subscription created with the coupon?
sub_xxxx
I can check