async-stripe icon indicating copy to clipboard operation
async-stripe copied to clipboard

Missing API Endpoint: /v1/checkout/sessions/:id/line_items

Open Aseeef opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe.

Currently, it doesn't seem we are able to retrieve a session's line items. CheckoutSession::retrieve() lets you retrieve the session, but the lineitems requires a separate call to: https://stripe.com/docs/api/checkout/sessions/line_items

Describe the solution you'd like

Maybe an optional parameter to CheckoutSession::retrieve() on whether or not to also retrieve the line items?

Ideally, also a method to an existing CheckoutSession object on populating missing line items.

Describe alternatives you've considered

I needed to get the quantity purchased by the user when CheckoutSessionCompleted is fired by the webhook. Since quantity lives in the line items, and line items aren't returned by default, I can't get the quantity from the CheckoutSession object.

Simple alternative is to store the sessions in my own application.

Additional context

No response

Aseeef avatar Jan 14 '24 09:01 Aseeef

Probably a similar underlying codegen bug as #475 . Will take a look

dgramop avatar Jan 15 '24 17:01 dgramop

Ok so not trivially solvable by doing the same thing that I did for #475. There's some additional handling being done for sessions stuff, and I don't completely understand the nuances there. Will revisit once that PR is merged

dgramop avatar Jan 15 '24 23:01 dgramop