#blueprintbrian_api
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/1230971194417877183
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello
Hi
You want to look at the line_items.data.discounts: https://docs.stripe.com/api/checkout/sessions/object#checkout_session_object-line_items-data-discounts
You will have to expand line_items when you retrieve the Checkout Session as this property isn't returned by default
So if I'm using Zapier for this I could have a trigger of checkout session completed, then an action of Webhook by Zapier to get the line item from that checkout session?
Hmm I don't know how the Zapier integration works, sorry. We only support the API directly here.
If you have questions about how you would retrieve the Checkout Session when using Zapier then you would need to reach out to them
Would I use line_items.data.discounts or line_items.data.discounts.discount.promotion_code?
Yep that would be the way to access the promotion_code directly
I got a invalid request 400 code when I tired using the .promotion_code
My current set up for the promo codes is the same API ID has multiple promo code names. Do you know if it's possible to pull the promo code name instead of ID?
You are going to need to expand the promo code itself to see that
Ah actually this is too deep to expand
Since we only support expansion for 4 levels
So instead you would retrieve the Promo code using the ID
In order to see the name
Okay so expand the discount then expand the promo ID?
Once I do that, how would I be able to retrieve the right promo code name?
I'm not sure what you mean exactly
You set the name yourself
The ID is unique
Sorry, not the name, the code for a promotion code
okay that seemed to work
Promo codes don't have a name property. Do you mean the coupon's name?
I wasn't sure if doing anothe rexpand on the promo code id would bring up the entire list
but it brought up just the promo code name for that session
๐
can I give you a kudos or something? how does tha twork in discord? Not super familiar with discord
If you like, you can submit feedback via the #1211832777608273960 channel ๐
But mostly the kind words are plenty for me
aesome
I do have one more quesiton actually.
Is there a way to pull the checkout sesssion from a completed charge?
or vice versa
You would go Checkout Session --> PaymentIntent --> Charge
So if you expand payment_intent.latest_charge when you retrieve your Checkout Session then you would see the Charge
Sure thing!