#MarkoBoras
1 messages · Page 1 of 1 (latest)
[
{
"id": "promo_1N3FAILOgsxKeN5yspmFKX4m",
"object": "promotion_code",
"active": false,
"code": "TEXTTEST",
"coupon": {
"id": "v82sMi9T",
"object": "coupon",
"amount_off": null,
"created": 1683018390,
"currency": null,
"duration": "once",
"duration_in_months": null,
"livemode": false,
"max_redemptions": null,
"metadata": {},
"name": null,
"percent_off": 25,
"redeem_by": null,
"times_redeemed": 0,
"valid": false
},
"created": 1683018390,
"customer": null,
"expires_at": null,
"livemode": false,
"max_redemptions": null,
"metadata": {},
"restrictions": {
"first_time_transaction": false,
"minimum_amount": null,
"minimum_amount_currency": null
},
"times_redeemed": 0
},
]
they're not active
so when I delete coupon they become "active: false"
and I can filter by that property?
tyy
and what field gets updated
when user uses this promotion code?
valid?
I've created to use code once
ok I need to create this requirement
I have successfully made creation of promotion codes that will be used once.
I want from user to enter that code in my app and if code is valid code is used, his purchase summary overview is decreased in price. When user goes to checkout he can see what promotion code he has used and how much was discount.
Hey! Taking over for my colleague. When creating a Checkout Session you can pass the discount/promotion code,:
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-discounts
Or let the customer enter the promotion code by their own:
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-allow_promotion_codes
thanks
what if my user passes wrong promotion code
can I still allow him to enter promtoion code in checkout
then the code won't be accepted in the Checkout Session
but can I pass this
allow_promotion_codes: true,
discounts: [{ promotion_code: promotionCodeId }],
pass both
No you can specify only one of these options.
so I'll then client side validation of discount code