Webhooks - accessing the payload

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.


Hi @dtj – yes, webhooks are sent for Sandbox accounts too as long as you have an acrtive webhook-subscription!

You can check via the API to see if we’ve sent webhooks to your subscription. Here’s the section in our docs with an example request - https://docs.dwolla.com/#list-webhooks-for-a-webhook-subscription

Thanks @shreya. I’m also curious if there is an example of the requests made to webhook endpoints. I see the example payload here, but I need to know where in the request this is. Any examples of endpoint implementations with Node/Express would be helpful too.

Hi @dtj – I’m afraid I don’t have any examples to share for a Node/Express implementation specifically, but we have a sample webhook-receiver app in Typescript which you might find helpful!

Thanks @shreya , that is helpful. Turns out I had set the webhook endpoint to the incorrect route, and was able to debug with appToken.get(${webhookSubscriptionUrl}/webhooks) :sweat_smile:

For anyone wondering in the future, here’s a simple node/express example (without validation):

router.post('/webhook', (request, response) => {
  const event = request.body;
  //save event somewhere

Ah yeah, that’s a handy endpoint that lets you view webhooks via the API over a rolling 30-day period. Glad you were able to get it working!

Also, thanks for posting your example! It’s very helpful! :raised_hands: