#surajpatidar
1 messages · Page 1 of 1 (latest)
how to set coupon use customer once time only
how to apply promotion code on subscription create time ?
Hi, I believe you have asked the same question before. The answer is you would want to implement in your own system to restricts the coupon one time per customer, and you can't specify Promotion code on Subscription start
You share the Promotion Code to the customer, that's correct. But customer will be the one to input that code into an UI
ie. into Checkout Session page
okay means promotion code only use in checkout right ?
in my checkout ui Promotion Code UI Not showing
Did you pass allow_promotion_codes when you create the Checkout Session?
expires_at=int(time.time()) + settings.STRIPE_CHECKOUT_SESSION_EXPIRE,
payment_method_types=["card"],
customer=stripe_customer.id,
line_items=[
{
"price_data": {
"currency": "usd",
"unit_amount": int(total * 100),
"product_data": {
"name": product.title,
"description": product.description,
},
},
"quantity": 1,
}
],
invoice_creation={
"enabled": True,
},
metadata={"order_id": order.id, "type": "order"},
mode="payment",
success_url=f"{prefix}{settings.HOST_NAME}/order/checkout/success",
cancel_url=f"{prefix}{settings.HOST_NAME}/order/checkout/cancel/",
)```
where i can add this ?
mode="payment",
allow_promotion_codes=True,
...
XOW54FMZ
i have this promotion code but it show invalied
What is the request id you created the promotion code? req_xxx from https://dashboard.stripe.com/test/logs
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
PROMO1NFCK1ECJUF37LWXJZVYI99S
yes i have created from stripe dashboard
PROMO1NFCK1ECJUF37LWXJZVYI99S
Apply
This code is invalid.
i have apply promotion code and coupon code but both show invalid
No I mean the request log which you created the promotion code. req_xxx
Not the actual value
Can you share you account id? acct_xxx
Can you try to input 67HA1ZL3 instead?
all show invalid
Can you share the Checkout URL here?
Can't access it anymore. Can you create another page?
Okie so this Promotion Code https://dashboard.stripe.com/test/logs/req_qbJhEdZ2IdGfux was created with first_time_transaction: true. which means it only apply to Customers who has the first Payment.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
This CheckoutSession, you created with cus_NjZVa9XGxohLC6 which has a lot of successful payment before
You can create Promotion Code but without the first_time_transaction restriction above
Uncheck the first checkbox here
okay
so in stripe checkout page how to check customer reedme code or not ?
i want like that if customer XYZ code use then second time he can't use
Like I said, that's a different thing we don't currently support right now, in Checkout Session, unfortunately
it imp things
i think you need to add this features
it possible to create my customer model under the stripe and work on that model ?
I will forward your feedback! But sorry if you really want it you would want to implement your own system to check the coupon usage per customer, and then build your own UI to accept the coupon code (aka move away from Checkout)