I have a Node/Express API that I set up to retrieve webhooks. Unfortunately it doesn’t seem to be working - I have a few questions for troubleshooting.
Are webhooks sent for sandbox accounts?
Where can I check to see the webhooks that have been sent to my endpoint?
Where can I see an example of a Node/Express implementation of a webhook endpoint?
I see the following example of the webhook “payload” in your documentation.
{
“_links”: {
“account”: {
“href”: “https://api-sandbox.dwolla.com/accounts/0ee84069-47c5-455c-b425-633523291dc3”,
“resource-type”: “account”,
“type”: “application/vnd.dwolla.v1.hal+json”
},
“customer”: {
“href”: “https://api-sandbox.dwolla.com/customers/a6f09251-c2de-4833-94a8-5c70916cebbc”,
“resource-type”: “customer”,
“type”: “application/vnd.dwolla.v1.hal+json”
},
“resource”: {
“href”: “https://api-sandbox.dwolla.com/customers/a6f09251-c2de-4833-94a8-5c70916cebbc”,
“type”: “application/vnd.dwolla.v1.hal+json”
},
“self”: {
“href”: “https://api-sandbox.dwolla.com/events/29a82d20-a703-41cb-9b3c-bd409c499925”,
“resource-type”: “event”,
“type”: “application/vnd.dwolla.v1.hal+json”
}
},
“created”: “2019-05-30T18:21:11.490Z”,
“id”: “29a82d20-a703-41cb-9b3c-bd409c499925”,
“resourceId”: “a6f09251-c2de-4833-94a8-5c70916cebbc”,
“topic”: “customer_created”
}
My question is how this is sent in the request body. Currently my code does the following:
const event = request.body
if (event.topic.split('_').includes('transfer')) {
let timeStamp = event.timeStamp ? event.timeStamp : event.created;
// ^ conflicting info in Dwolla docs about what this property is called
const resourceURL = event._links.resource.href;
let transferInfo = await DWOLLA_APP_TOKEN.get(resourceURL);
let { status, correlationId, individualAchId } = transferInfo.body;
// *finds correlation ID and updates corresponding Transfer object in DB*
}
Should this code work? Or do I get the event via request.body.event? request.body.payload? Any examples of a working implementation in Node/Express would be much appreciated, I haven’t been able to find any.
Thanks!

