Webhook Handling


(Darryl Stefan Fernandez (Darryldecode)) #1

Hello, in webhook, example when a transfer completed, there are 3 webhooks triggered:

#for successful transfer
transfer_completed
customer_bank_transfer_completed (customer transfer in bank succeed)
customer_transfer_completed (customer event)

Same goes with failure events…
#for failed transfer
transfer_failed
customer_bank_transfer_failed
customer_transfer_failed

which of the three webhooks I can only listen that overall the transfer was successful or failed? Because it is confusing to handle these 3 events. I mean I only care about if the transfer was overall succeeded or failed so I can audit my local record or revert if needed. Thank you so much for your guidance.


(Cory Anderson) #2

Hi @Darryl_Stefan_Fernan hope your week has been going well!
Recommending what webhooks to listen to is difficult right now, as I do not know what your funds flow is yet. Seeing how you have both transfer_ and customer_transfer_ webhooks, I’m assuming the funds flow involves a Verified Customer and your Dwolla Master Account.

transfer_completed

  • Party involved - Dwolla Master Account
  • A transfer has been completed to a Dwolla Master Account balance

If the Destination Customer is your Dwolla Master Account - This may not be the ideal webhook to listen to. If you are sending to your Dwolla Master Account Bank, you will want to listen to bank_transfer_completed.

transfer_failed

  • Party involved - Dwolla Master Account
  • A transfer has failed to clear to a Dwolla Master Account

If the Destination Customer is your Dwolla Master Account - The funds failed to reach the Dwolla Master Account balance, generally no funds move if this Customer type is involved

customer_transfer_completed

  • Party involved - Any Customer type (receive only, unverified, or Verified)

  • A Customer transfer has cleared successfully. Represents funds clearing either to an unverified Customer’s bank or to a verified Customer’s balance.

If the Destination Customer is an Unverified Customer or Receive Only Customer - Listen to this webhook to see if the transfer has been successful
If the Destination Customer is a Verified Customer - This would not be the ideal webhook to listen to if you are looking to check if the funds have cleared to their bank. If you are only looking to check if the funds hit this Customer’s balance funding source, however, then this would be suitable.

customer_transfer_failed

  • Party involved - Any Customer type (receive only, unverified, or Verified)
  • A Customer transfer failed to clear successfully. Represents funds failing to clear either to an unverified Customer’s bank or to a verified Customer’s balance.

If the Destination Customer is an Unverified Customer or Receive Only Customer - Listen for this webhook to see if the transfer has failed.
If the Destination Customer is a Verified Customer - The funds failed to reach the Verified Customer’s balance, generally no funds move if this Customer type is involved

customer_bank_transfer_completed

  • Party involved - Verified Customer only
  • A bank transfer that was created for a Customer has cleared successfully. Represents funds clearing either from a verified Customer’s bank to the Dwolla network or from the Dwolla network to a verified Customer’s bank.

If the Destination Customer is Verified - This is the final webhook you will receive for the transfer. The funds have settled in the destination Customer bank.

customer_bank_transfer_failed

  • Party involved - Verified Customer only
  • A Customer bank transfer failed to clear successfully. Usually, this is a result of an ACH failure (insufficient funds, etc.). Represents funds failing to clear either from a verified Customer’s bank to the Dwolla network or from the Dwolla network to a verified Customer’s bank.

If the Destination Customer is Verified - Listen for this webhook to see if funds failed to clear to the Destination Bank. You will want to check their Dwolla balance to see if the funds settled there.

Let us know if you have any other questions as you go forward!


(Darryl Stefan Fernandez (Darryldecode)) #3

Hello, thank you for your response. Much appreciated. I am not sure what webhook to listen since almost all transfer webhooks are triggering. So here is my app setup:

The web app involves tenant, landlord and the company. So for funds flow, here are the following transfer that occurs:

1.) tenant to landlord & vice-versa (customer to customer)
2.) tenant to master account (customer to master account)
3.) landlord to master account (customer to master account)

where landlords are the verified customer and tenants are the unverified customers. Tenants and landlords can add funding sources via IAV and then choose from its added funding sources when paying and receiving. A tenant can pay directly to landlord (take some facilitator fee) and a tenant can also push payments to dwolla master account. A landlord can push payments to tenant as well (for ex. deposit returns) and also can push payments to dwolla master account.

So if you can see all flow above, customer and account transfer events are triggering. And I want to use webhook to update or audit my accounting records but not yet sure what exact webhook. Would it be nice if there is a 1 single event we could just listen for fund transfer success or failure as a single source of truth so I can update my records accordingly? And then just listen to all other more granular event if needed. Thank you in advanced :slight_smile:


(Cory Anderson) #4

The source of truth webhook will be different due to the fact that you have different funds flows. For simplicity sake, we will assume all funds will be settling in the respective party’s bank.

1 - Tenant (Unverified Customer) ----> Landlord (Verified Customer)
Since your destination Customer is a Verified Customer type, the webhook that will indicate full transfer completion is customer_bank_transfer_completed. This indicates that funds have completely settled in the Verified Customer’s bank. The transfer has now completed successfully.

2 - Tenant (Unverified Customer) ----> Dwolla Master Account (Account)
Since your destination is a Dwolla Master Account, the webhook that will indicate full transfer completion is bank_transfer_completed. This indicates that funds have completely settled in your Dwolla Master bank Account. The transfer has completed successfully.

3 - Landlord (Verified Customer) ----> Dwolla Master Account (Account)
Refer to #2

Let us know if that helps!


(Darryl Stefan Fernandez (Darryldecode)) #5

Hello, thanks for the response. I really appreciate it. That made more sense to me and looks like I found now where to hook in. But as I implemented the webhooks above, there is another problem it introduce to me. The “customer_bank_transfer_completed” was perfect to hook in for customer to customer transfer successful. But I noticed that this returns a different or new transfer ID. I was expecting it will return the original transfer ID that was saved on my local records so I can audit my record accordingly but now I have no way to identify what was the transfer related to this event since it returns a new transfer ID.

In the image above, its the events when a customer to customer transfer was cleared successfully. However, the “customer_bank_transfer_completed” event which is the single source of truth on this fund flow turns out geenrating a new transaction ID which I cannot now used to audit my local records. There is no way for me to identify what was the related transfer on this event. Or am I missing something? Any idea? Thanks you so much :slight_smile: