#blueprintbrian_api

1 messages ยท Page 1 of 1 (latest)

queen orbitBOT
#

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

elfin scaffoldBOT
potent valve
#

Hello

manic wyvern
#

Hi

potent valve
#

You will have to expand line_items when you retrieve the Checkout Session as this property isn't returned by default

manic wyvern
#

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?

potent valve
#

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

manic wyvern
#

Would I use line_items.data.discounts or line_items.data.discounts.discount.promotion_code?

potent valve
#

Yep that would be the way to access the promotion_code directly

manic wyvern
#

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?

potent valve
#

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

manic wyvern
#

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?

potent valve
#

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

manic wyvern
#

okay that seemed to work

potent valve
#

Promo codes don't have a name property. Do you mean the coupon's name?

manic wyvern
#

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

potent valve
#

Oh yep

#

Just the one applied

manic wyvern
#

amazong

#

Thank you very much, bismarck

potent valve
#

๐Ÿ‘

manic wyvern
#

can I give you a kudos or something? how does tha twork in discord? Not super familiar with discord

potent valve
#

But mostly the kind words are plenty for me

manic wyvern
#

aesome

#

I do have one more quesiton actually.

Is there a way to pull the checkout sesssion from a completed charge?

#

or vice versa

potent valve
#

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

manic wyvern
#

Okay that makes sense

#

Thank you again!!!!!!

potent valve
#

Sure thing!