#marlon2k

1 messages ยท Page 1 of 1 (latest)

austere onyxBOT
icy marsh
#

If you have the Charge ID then you should be able to retrieve the Charge and check invoice right on the Charge object itself

#

and if you want to get the full Invoice object you can always expand invoice when you retrieve the Charge as well

warm trench
#

I'm not creating invoices for one-time payments, only subscriptions.

icy marsh
#

Ahhh I see what you're saying - sorry I read to fast and misinterpretted

#

How are you specifying these quantities when you create the charges? Are you using Checkout? Are you just calculating how much the cost should be and creating a charge/payment for the correct amount?

warm trench
#

We have a custom shopping cart built - users can select which product they want and the quantity (ie PRODUCT A x 10)

icy marsh
#

Are you storing/setting those quantities anywhere in the Stripe object you're creating? Like do you set the quantity as metadata when you create the charge/payment?

warm trench
#

Not using metadata. The only place the quantity is stored is here on the checkout summary from the Stripe payment page. I would need to pull it from here somehow.

icy marsh
#

Can you share that payment ID with me so I can see what you're doing?

warm trench
#

pi_3NkE5dKWz2MiE0fE1lce7llQ

#

Maybe I need to call checkout session using API?

icy marsh
warm trench
#

Yeah checkout session, my bad

#

So I need to find the checkout session for that payment ID

#

And then call it via API?

#

And that'll get me the quantity amount?

icy marsh
warm trench
#

OK 1st step,

I have the payment ID and charge ID.

How do I find the checkout session ID using either of these?

icy marsh
warm trench
#

Ok 1 step done. Found the checkout session ID.

#

Will try expanding line items now

#

How do I do that?

icy marsh
#

in your case, you'll want to expand data.line_items if youre expanding from the list api request

warm trench
#

What kind of request am I making here though

#

I'm calling checkout session ID right? Could you link me to that please

#

Nvm got it

#

Hey

#

Not working, can u spot a reason why maybe

#

I have authorization header at bottom, that's fine

icy marsh
#

It's because you're retrieving a single Checkout Session - if you're retrieving a single Checkout Session you should expand line_items not data.line_items

warm trench
#

Gotcha, testing

#

Hm still not working, 400 ERROR invalid array

austere onyxBOT
icy marsh
#

you'll probablly also want to do expand[] instead of expand

warm trench
#

That's it. You LEGEND!!!

icy marsh
#

๐Ÿ‘ glad you got it working ๐Ÿ™‚