Unable to find destination customer information from customer_bank_transfer_created webhook

I’m trying to setup a webhook for this event, and am having some issues with properly identifying the recipient of the funds. The _links[‘destination’] in the below body is actually the sender of the funds.

If I follow _links[‘funded_transfer’] and then follow _links[‘destination-funding-source’] and then follow _links[‘account’] I can get to the correct account that will be receiving the funds - but that doesn’t get me the info I need on the email address to send a notification to either.

It can’t be this difficult, so certainly I’m missing something. How should I get the e-mail address to send this notification from the initial webhook event?

This is the transfer / body…
https://api-sandbox.dwolla.com/transfers/cfe684ce-6ad3-ea11-8126-fb48ed1dda28

{
    "_links": {
        "cancel": {
            "href": "https://api-sandbox.dwolla.com/transfers/cfe684ce-6ad3-ea11-8126-fb48ed1dda28",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "transfer"
        },
        "source": {
            "href": "https://api-sandbox.dwolla.com/funding-sources/3d3f1e08-886c-4de3-b500-8c56274a02c8",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "funding-source"
        },
        "self": {
            "href": "https://api-sandbox.dwolla.com/transfers/cfe684ce-6ad3-ea11-8126-fb48ed1dda28",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "transfer"
        },
        "funded-transfer": {
            "href": "https://api-sandbox.dwolla.com/transfers/d0e684ce-6ad3-ea11-8126-fb48ed1dda28",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "transfer"
        },
        "destination": {
            "href": "https://api-sandbox.dwolla.com/customers/306a6900-2cb9-405d-aff7-5251d45f2108",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "customer"
        }
    },
    "id": "cfe684ce-6ad3-ea11-8126-fb48ed1dda28",
    "status": "pending",
    "amount": {
        "value": "10.00",
        "currency": "USD"
    },
    "created": "2020-07-31T20:17:11.153Z",
    "clearing": {
        "source": "standard"
    },
    "individualAchId": "INXR2ZEK"
}

Hi @jmtichell, you should be able to identify the customer involved in the transfer by customer link contained in the webhook payload.

{
  "id": "c6694e91-a425-4e69-819a-2e033e33df8a",
  "resourceId": "98603beb-63df-e611-80ee-0aa34a9b2388",
  "topic": "customer_bank_transfer_completed",
  "timestamp": "2017-01-20T22:58:44.900Z",
  "_links": {
    "self": {
      "href": "https://api-sandbox.dwolla.com/events/c6694e91-a425-4e69-819a-2e033e33df8a"
    },
    "account": {
      "href": "https://api-sandbox.dwolla.com/accounts/ad5f2162-404a-4c4c-994e-6ab6c3a13254"
    },
    "resource": {
      "href": "https://api-sandbox.dwolla.com/transfers/98603beb-63df-e611-80ee-0aa34a9b2388"
    },
    "customer": {
      "href": "https://api-sandbox.dwolla.com/customers/491b1fff-514b-4d90-9a3f-4360a51ab47b"
    }
  },
  "created": "2017-01-20T22:58:44.900Z"
}

The customer link in the payload indicates who the event belongs to. You could then do a GET /customer/{id} to pull the email address. Keep in mind, you will receive events for both Customers involved in the transaction if this is a facilitation funds flow. As referenced in this gist.

The customer link in the webhook payload body (customer_bank_transfer_created event) is not the destination, it is the source of the funds.

I’m not sure if this matters, but the destination account is my sandbox account.