#bruno_api

1 messages ยท Page 1 of 1 (latest)

pale adderBOT
#

๐Ÿ‘‹ 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.

sharp panther
#

Hi, let me help you with this.

#

I see in the response active: true.

#

Where do you see that it's not?

median horizon
#

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

#

Now the second promotion code became active, two minutes after its creation ๐Ÿค”

sharp panther
#

I see, not sure why is this happening. Let me check...

median horizon
#

Thanks!

latent owl
#

๐Ÿ‘‹ taking over for my colleague. Let me catch up.

#

where did you see it as inactive

median horizon
#

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

latent owl
#

I'm also a bit shocked, I'm not sure whether this was always the behavior

split capeBOT
median horizon
#

It looks like a bug to me ๐Ÿ˜…

latent owl
#

honestly I'm not a 100% sure about it

median horizon
#

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

blissful hollow
#

๐Ÿ‘‹ 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

median horizon
#

Sure, no problem ๐Ÿ™‚

blissful hollow
#

Okay

#

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

median horizon
#

I see... Makes sense to me.

We should be able to fix it by setting a billing address to the customer then, allowing automatic_tax to go through

#

Thanks for the feedback! I will give that a try