#elBR
1 messages · Page 1 of 1 (latest)
Hey there
I am applying this promotion code
promo_1LhY69EMyoEBRsWZLbzkExON
that is created for a coupon that can be used only once
ok thank you
Okay so you created a promo code named ONETIME1 however there are no max_redemptions set on it. You can see the creation request here: https://dashboard.stripe.com/test/logs/req_JUSxdY9NEuJH3T
Duration "once" just means that it would only apply to one payment
yes but the customer can pay multiple invoices if I apply that coupon to the same customer
Correct
I am not understanding the part "would only apply to one payment"
If you only want the promo code to be used a single time then you set max_redemptions
Take a look at duration here for coupons: https://stripe.com/docs/api/coupons/create#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.
but then what does it mean when I just set once and no max_redemptions. Is it the same as a coupon that is not "once"?
This explains how duration works... it has to do with how many payments the coupon or promo code will apply to if you set it on a Subsscription
max_redemptions is specifically for how many times that promo code can be used
I am not using it for a subscription
Right, so once doesn't really have an effect for you, but it also doesn't do the behavior you want. You need to use max_redemptions if you don't want the promo code to be redeemed multiple times.
You may also want to look into using first_time_transaction: https://stripe.com/docs/api/promotion_codes/create#create_promotion_code-restrictions-first_time_transaction
As maybe you are trying to just allow your promo code to be used by new Customers?
ok thank you
I have another question
I make my customer type the promotion code code
What is the best approach to check if that is valid or not?
I'm not sure what you mean
I don’t see any api call for verifying it
I create for example a promotion code with name “SALE”
and then I give that name to the customer
as all platform do
right?
then I want to validate it with the right promotion code and apply the discount
Are you using Stripe Checkout?
no I am making custom
With one-off invoices?
Okay so then yeah this works a bit differently for you since we don't actually support applying promo codes directly to one-off invoices.
When you create an invoice you use the discounts hash
Which only takes either coupon or discount
So if you are going to use promo codes then when a promo code is entered in your site, you list the promo code by its code using: https://stripe.com/docs/api/promotion_codes/list#list_promotion_code-code.
Then you apply the coupon associated with the promo code.
Stripe Checkout allows for taking Promo Codes directly.
So all that happens is the Customer enters the promo code on Checkout and then it is applied directly
but what API call does Stripe use in Checkout. Why it isn’t also available for us that use one-off invoices?
Because it just hasn't been built yet on one-off invoices unfortunately