Closed Mohamed-1954 closed 10 months ago
Hey @Mohamed-1954, Github issues are limited to bugs with the SDK itself. Your question is an integration support question better directed at our support team: https://support.stripe.com/contact
You mentioned you set the metadata on the Product itself using product_data
so the metadata would only live on that object. When you expand the line items of the Session you get the line items which don't have metadata or the Price which does but won't have the metadata you set since it was set on the Product. You have to expand the product
property and look at the metadata on that resource.
If you need further help, make sure to reach out to our support team: https://support.stripe.com/contact
Describe the bug
Hello everyone, I've created a stripe checkout session and in the line_items property I'm passing the products I receive from the request's body. In the product_data of each product I added a metadata that contains the product's id. Then I created a webhook that listens to the checkout.session.completed event type, where I retrieve the line_items so that I can create an order document (because I'm working with mongoose) and save it in my database. The problem is: I can't find the id I defined in each product's metadata.
To Reproduce
N/A
Expected behavior
When retrieving the line_items and looping through the data property, I expect to find the id I defined in the metadata of each product.
Code snippets
OS
Wndows
Node version
Node v21.2.0
Library version
stripe-node v14.11.0
API version
2023-10-16
Additional context
No response