#Ajith-webhook

1 messages · Page 1 of 1 (latest)

dry pond
#

hello there! Can you share more about your use case? and what you've setup / tried thus far?

solar crest
#

At the start, I create a checkout session to start the subscription process with these values.

#

Please note the metadata, that is important for me

#

I need to get them when any of the invoice event is invoked in the webhook

#

How can i retrive the metadata in the webhook

dry pond
solar crest
#

yes

dry pond
solar crest
#

Will i get the metadata inside subscription_data or the outer metadata which i gave as params at the start of creating a checkout session above/

#

And is there any extra code needed to be written to retrieve the invoice event?

#

Currently my webhook looks like this

#

It is nodeja

#

nodejs*

dry pond
#

this is an example from an invoice.payment_succeeded event

...
"lines": {
    "object": "list",
    "data": [
      {
        "id": "il_1KZ8jVJQtHgRImA7Fgh9E7zO",
        "object": "line_item",
        "amount": 2000,
        "currency": "usd",
        "description": "1 × Customer Portal Test (at $20.00 / month)",
        "discount_amounts": [
        ],
        "discountable": true,
        "discounts": [
        ],
        "livemode": false,
        "metadata": {
          "key": "value"
        },
        "period": {
          "end": 1648969552,
          "start": 1646291152
        },
        "plan": {
          "id": "price_...
...
#

you can see

 "metadata": {
          "key": "value"
        },
#

i'd suggest you create a Checkout Session, complete it, then you'll be able to see how the events look like in the Stripe Dashboard

solar crest
#

Okay