#ashuguptagamer

1 messages · Page 1 of 1 (latest)

hollow duneBOT
hollow shadow
#

Hi! Let me help you with this.

shut harness
#

Thanks :)

hollow shadow
shut harness
#

Here: req_hbxny2aMWSHKGL

hollow shadow
#

What happens if you remove "line_items.data.metadata"?

shut harness
#
  "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

hollow shadow
hollow shadow
shut harness
#

Hmm, so how am I suppose to fetch the metadata, I need it to find the product in my db?

hollow shadow
shut harness
#

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.
hollow shadow
#

But you can also expand it: line_items.data.price.product

shut harness
#

Yeah that works

#

Thanks :)

hollow shadow
#

Happy to help!