#ashuguptagamer
1 messages · Page 1 of 1 (latest)
Hi! Let me help you with this.
Thanks :)
Could you please share the Request ID req_xxx? https://support.stripe.com/questions/finding-the-id-for-an-api-request
Here: req_hbxny2aMWSHKGL
What happens if you remove "line_items.data.metadata"?
"line_items": {
"object": "list",
"data": [
{
"id": "li_1NprKXSBPFlltWzIV7nlKP3X",
"object": "item",
"amount_discount": 0,
"amount_subtotal": 283800,
"amount_tax": 0,
"amount_total": 283800,
"currency": "inr",
"description": "Refined Wooden Computer",
"price": {
"id": "price_1NprKXSBPFlltWzIowBNBiPO",
"object": "price",
"active": false,
"billing_scheme": "per_unit",
"created": 1694604841,
"currency": "inr",
"custom_unit_amount": null,
"livemode": false,
"lookup_key": null,
"metadata": {},
"nickname": null,
"product": "prod_Od7Z8YjlH7DFGJ",
"recurring": null,
"tax_behavior": "unspecified",
"tiers_mode": null,
"transform_quantity": null,
"type": "one_time",
"unit_amount": 283800,
"unit_amount_decimal": "283800"
},
"quantity": 1
}
],
"has_more": false,
"url": "/v1/checkout/sessions/cs_test_a1ffnHQQrzvYDrRyslLEJDuAFWyiWPNBnJq2CzSBJiOqfPhp9W7ext5Svw/line_items"
},
I don't get the metadata of the line items
Although I do provide it when building session
Note: Meta data is present in my product
I am not sure line_items has metadata: https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items-data
I see that the metadata is actually on the Product object not LineItem
Hmm, so how am I suppose to fetch the metadata, I need it to find the product in my db?
You get the Product ID in this response ☝️
Another thing is, if I try to expand line_items.metadata. The API tells me to try line_items.data.metadata
Error: This property cannot be expanded (line_items.metadata). You may want to try expanding 'line_items.data.metadata' instead.
But you can also expand it: line_items.data.price.product
Happy to help!