parsing webhook payload with unknown object names...

parsing webhook payload with unknown object names...

Hello friends,

I'm setting up a webhook create a Deal when a order is made thru our 3rd party ecomm provider. All is good and well and working - except I'd like to record the 'license key' from the e-comm order. The trick is that that the json path to the key changes based on the product name. Really annoying and I can't edit the payload the e-comm service provides. For example, the part I'm concerned with is:

  1.         "fulfillments": {
  2.           "first_product_license_0": [
  3.             {
  4.               "license": "12345",
  5.               "display": "License Key",
  6.               "type": "license"
  7.             }
  8.           ],
  9.           "instructions": "<p>Here is your license key:<br/></p><p>This license key has been emailed to you, along with a link to download your product.</p>"
  10.         }
If the customer bought "second_product", then the name of that object would also be changed.

So: any clever ways to select the license key regardless of the product chosen?