#jchannon

1 messages · Page 1 of 1 (latest)

plush shuttleBOT
shadow rune
#

Hi there, it is a JSON object.

charred heart
#

what does it look like?

shadow rune
#

It looks just like the data.object that you see in the example object there in the API Ref.

#

The specifics will depend on the object that the Event is for.

charred heart
#

the data .object in those docs are a string

#

ah no i see

#

Object containing the API resource relevant to the event. For example, an invoice.created event will have a full invoice object as the value of the object key.

#

i'm still confused 🙂

#

i listen to webhooks when an account.updated is fired

#

the webhook receives an account object

#

but it also contains properties like previous_attributes

#

in this scenario previous attributes can't surely contain the same account object?

#

ah i just looked at the webhook data

#

it kind of is a subset of the account object

#

for example if i change the metadata, the previous attrivbutes looks like this:

#
"previous_attributes": {
      "metadata": {
        "qw": "erdwgre"
      }
    }
#

ok thanks

#

sorry for the block of text

shadow rune
#

Yep

#

No worries

#

It is designed so you know what actually changed

#

Let me know if I can help any further!

charred heart
#

interestingly i changed some stuff in the ui and the webhook looks like this

#
 "previous_attributes": {
      "business_profile": {
        "url": null
      },
      "settings": {
        "dashboard": {
          "display_name": null
        },
        "payments": {
          "statement_descriptor": null
        }
      }
    }
#

i added a website url and a privacy policy url

shadow rune
#

Right, because it was not set before, correct?

charred heart
#

but why are the values null? and why does it incude display name and statement descriptor?

#

and not the privacy policy url

shadow rune
#

The values are null because they were not previously set with a value

charred heart
#

but i didnt change them

shadow rune
#

Can you provide the Event ID?

charred heart
#

"evt_1M2eCAPAS4Psk1cX4nOWtbcG"

shadow rune
#

Okay I see the confusion.

#

You did update the URL here.

#

The display_name and statement_descriptor use fallback logic if you don't set them explicitly

#

So in this case, they now use the URL that you set

#

Which is why they were previously null but now are set