Stripe Webhook Subscription Updates & $_POST Data Model Differences

If a customer changes their subscription plan, Stripe sends my endpoint an object model that contains "object" and "previous_attributes". The "object" contains the new subscription info while "previous_attributes" contains the old subscription info.

The existence of "previous_attributes" tells me there was a change to the subscription product (like an upsell) versus some other customer.subscription.update (like a cancelation or pause).

In Wappler, the customer.subscription.update webhook only presents "object" as the available data model as in:
Screenshot 2025-01-16 at 6.04.26 PM

Is there a way to see if "previous_attributes" exists and then parse that data model if it does? There are many events that can trigger the customer.subscription.update event. I want to quickly capture changes to subscription products from Stripe so I can update my customer plan table to match. It's important because a change to a product will change entitlements.

I’ve re-written the Wappler code which receives the webhook to get everything which comes across…

It is for PHP but happy to share if it helps!