#lord-tcg9068_code
1 messages ยท Page 1 of 1 (latest)
๐ 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/1395554514807033877
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
I can log out the customer restriction via the customer field, but I cannot see anything linking to a specific product(s)
Promo Code: {
id: 'promo_1RlzzbIxuaMmAFwFQQLOpb3A',
object: 'promotion_code',
active: true,
code: 'FREECG',
coupon: {
id: 'V6oTrp9a',
object: 'coupon',
amount_off: null,
created: 1752790098,
currency: null,
duration: 'forever',
duration_in_months: null,
livemode: false,
max_redemptions: null,
metadata: {},
name: 'Free Ultra Tier',
percent_off: 100,
redeem_by: null,
times_redeemed: 3,
valid: true
},
created: 1752790171,
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: 3
}
I'm working in a sandbox environment using a coupon with 100% discount, and testing what I can do restriction wise with product and customer restrictions.
hi there ๐ is there a Stripe Docs you're following to build your project? If yes can you share with me the link please
Hey. I'm not following one specific guide, I'm integrating stripe to an already existing project so I'm dipping in and out of the docs
Gotcha, to answer your initial question then
I cannot see any mention of the product restrictions? How can I get that?
You need retrive the Coupon object instead of the Promo Code object. When retrieving the Coupon, you should expand the applies_to parameter: https://docs.stripe.com/api/coupons/object#coupon_object-applies_to
Ohhhhhh gotcha. Let me try that out
here's how you can retrieve a coupon: https://docs.stripe.com/api/coupons/retrieve
Oh amazing! These expands keep tripping me up!