#bruno_api
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1248251922742247435
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
Hi, let me help you with this.
I see in the response active: true.
Where do you see that it's not?
Hey! Thanks for jumping in. ๐
When the promo code, it shows as Inactive at first in the UI. It got updated to true on event evt_1POf9gGXtcqHgDW8jsFkNdkQ
I just created a new one for testing: https://dashboard.stripe.com/test/promotion_codes/promo_1POfSPGXtcqHgDW8QGazfSeY
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Now the second promotion code became active, two minutes after its creation ๐ค
I see, not sure why is this happening. Let me check...
Thanks!
Hey! When the coupon is created, it shows as inactive in the UI, and it fails the integration test because it's not valid yet.
I just created this one for example: promo_1POfmmGXtcqHgDW8dY7qmLyD
When i check Stripe dashboard, it's inactive
Same when I run stripe promotion_codes retrieve:
โ ~ stripe promotion_codes retrieve promo_1POfmmGXtcqHgDW8dY7qmLyD
{
"id": "promo_1POfmmGXtcqHgDW8dY7qmLyD",
"object": "promotion_code",
"active": false,
"code": "TESTSINGLEUSEPROMOCODE100OFF88477",
"coupon": {
"id": "amzcxqRN",
"object": "coupon",
"amount_off": null,
"created": 1717678280,
"currency": null,
"duration": "once",
"duration_in_months": null,
"livemode": false,
"max_redemptions": null,
"metadata": {},
"name": null,
"percent_off": 100.0,
"redeem_by": null,
"times_redeemed": 0,
"valid": true
},
"created": 1717678280,
"customer": null,
"expires_at": null,
"livemode": false,
"max_redemptions": 1,
"metadata": {},
"restrictions": {
"first_time_transaction": false,
"minimum_amount": null,
"minimum_amount_currency": null
},
"times_redeemed": 0
}
It switches to active: true after two minutes for some reason, and I cannot understand why ๐
However, we do send active: true in the API request: req_R59lnW4Jg5Frgj
Now it got updated to true on event evt_1POfonGXtcqHgDW8GOvdyDeO. That can be checked by looking at previous_attributes
I'm also a bit shocked, I'm not sure whether this was always the behavior
It looks like a bug to me ๐
honestly I'm not a 100% sure about it
Could you please check if we are doing something wrong on our end? Or maybe.a setting somewhere
It started today as far as I can see. Our pipeline was working fine yesterday
๐ sorry, tarzan needed to step away.
We are taking a look here to see if this behavior changed on our side
Give us a few mins
Sure, no problem ๐
Okay
So it looks like what is happening here is that the Coupon/Promo code was created and then the Promo code was immediately applied on a Subscription creation via https://dashboard.stripe.com/test/logs/req_5mkQfLXsXGuM1S
That request "consumes" the promo code -- it hits the specified max_redemptions so updates to active:false
However, that Sub creation request ends up failing
So 2 minutes later we have an async job runs and recognizes that actually, the request failed so the redemption wasn't needed, and it undoes it , updating it back to active:true