#pro-pooja

1 messages · Page 1 of 1 (latest)

distant fieldBOT
tired nest
#

hello! the checkout.session.completed event doesn't have line_items expanded by default. You can either make a subsequent API request to retrieve the Checkout Session and expand [0] the line_items [1] to find the product, or alternatively, add the product as a metadata on the Checkout Session [2] and read the product data from that

[0] https://stripe.com/docs/api/expanding_objects
[1] https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items
[2] https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-metadata

frosty orchid
#

If I use API to get checkout session, which parameters do I've to pass in API call to get product info ?

tired nest
#

An example in node.js of how the request would look like

      'cs_test_...', {
      expand: ['line_items']
    });