#j_api

1 messages ¡ Page 1 of 1 (latest)

thin vaporBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always 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/1291394425939034144

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

oblique path
#

Hello

#

Do you have a request ID for that error?

pine harbor
#

Sure do!

#

"requestId":"req_HEWnBaIX80lWHR"

#

some extra info: here's some logs

api:dev: [0] {
api:dev: [0]   id: 'promo_1O4xVcEk6sr5GyDh6WYpzO44',
api:dev: [0]   object: 'promotion_code',
api:dev: [0]   active: true,
api:dev: [0]   code: 'Test123',
api:dev: [0]   coupon: {
api:dev: [0]     id: '2KodLqlS',
api:dev: [0]     object: 'coupon',
api:dev: [0]     amount_off: 2500,
api:dev: [0]     created: 1698203360,
api:dev: [0]     currency: 'usd',
api:dev: [0]     duration: 'once',
api:dev: [0]     duration_in_months: null,
api:dev: [0]     livemode: false,
api:dev: [0]     max_redemptions: null,
api:dev: [0]     metadata: {},
api:dev: [0]     name: 'Referral Test',
api:dev: [0]     percent_off: null,
api:dev: [0]     redeem_by: null,
api:dev: [0]     times_redeemed: 0,
api:dev: [0]     valid: true
api:dev: [0]   },
api:dev: [0]   created: 1698203512,
api:dev: [0]   customer: null,
api:dev: [0]   expires_at: null,
api:dev: [0]   livemode: false,
api:dev: [0]   max_redemptions: null,
api:dev: [0]   metadata: {},
api:dev: [0]   restrictions: {
api:dev: [0]     first_time_transaction: false,
api:dev: [0]     minimum_amount: null,
api:dev: [0]     minimum_amount_currency: null
api:dev: [0]   },
api:dev: [0]   times_redeemed: 0```
oblique path
#

Thanks! looking

pine harbor
#

and the associated code

#

console.log(promotionCodeId);
const maybePromotionCode = promotionCodeId
? await stripe.promotionCodes.retrieve(promotionCodeId)
: undefined;

console.log(maybePromotionCode);
#

so theres clearly an item there lol

oblique path
#

Ah okay if you pass in discounts like that then you pass the promo code ID

#

So you need to pass promo_xxx there

pine harbor
#

mmm... i see. so what im hearing is, i just pass in promotionCodeId directly

oblique path
#

Yep

pine harbor
#

lets give that a whirl

pine harbor
#

all good, thanks!