Cancelling Mass Payments

How are mass payments cancelled? The docs indicate a deferred mass payment can be cancelled by updating the status of the mass payment - Is there a “mass cancel” for processing mass payments or do you have to cancel all of the items individually? Is updating the items individually sufficient to cancel the mass payment or is there more to it? I couldn’t find anything in the docs besides cancelling a deferred mass payment.

Hi @jmtichell – on a high level, once a masspayment is created in the Dwolla API, a job gets created in the queue which is picked up by a service that creates individual items off of the masspayment. The job starts running almost immediately, depending on the queue and the numbers of items in a masspayment. Essentially, there isn’t a way to cancel a masspayment as a whole once it get’s created, unless it’s created as a deferred masspayment like you mentioned.

As another alternative to cancelling individual transfers created from the masspayment, you could also listen to the webhook that gets sent for the creation of the debit portion of the masspayment and cancel it, which subsequently cancels the individual credit portions of the transfers. This discuss post by our team member is also a good read on masspayments in Dwolla - Mass Payments - Pay 5,000 People in Five Simple Steps

Hope that helps! Please let me know if you have any questions!

Thank you for sharing this. Just to confirm - the metadata/correlationID attribute this relies on is usable under the PAYG tier as well?

You’re welcome! Yes – this is supported under PAYG! :slight_smile:

Could you go into a little more detail on this? I’m not sure what you mean - is there somewhere in the docs that describe how to do this?

Sure, i can try to clarify further. Since masspays aren’t designed to be cancelled, this is more of a workaround which isn’t documented.

Essentially, when a masspayment is created and processed, there is a single debit transfer created for the total masspayment amount from the source bank. When this debit transfer is created, you’ll receive a webhook indicating the event customer_bank_transfer_created with the source Customer’s link in the payload. If you were to cancel this transfer, then the individual transfers outgoing to the multiple receivers would subsequently fail, or cancel.

Thank you @shreya. The one piece I"m still trying to work out is sending Operational Notifications after cancelling a Mass Payment - the only webhooks sent are each individual transfer cancelling, which would result in multiple emails being sent to the client if I fire off an email for each webhook - and none of which would be for the amount that the client would recognize (since the payment was broken down into transfers of a maximum of $5,000 each).

I’m going through the same mental gymnastics trying to figure out when transfers are successful as well. Do you have any suggestions on how to approach this?

You bet! :slight_smile:

As for sending a notification to your users, you can utilize the same customer_bank_transfer_created webhook sent for the debit portion of the masspayment which has the link to the source Customer to notify the Sender. This webhook contains the link to the single debit transfer for the total amount. As for notifying the receivers, they will all be individual transfers for which you’ll get individual webhooks.

As for following webhooks and the status of the transfer to figure out when a transfer finishes processing successfully, I’d recommend checking out this Gist -
It also covers ACH returns, late ACH returns, and the webhooks that are sent to notify about each, as well as the automatic actions Dwolla takes upon receiving these late returns.

Let me know if you come across any questions!

I circled back to this implementation now that I’m readying for production, and was wondering if some behavior in production would be different than the sandbox - particularly for getting the transfer urls from a masspayment. When I create the masspayment, will the transfer urls actually be available almost immediately or will this fail when I swap to production? I thought about using webhooks, but I don’t seem to be receiving a customer_transfer_created event when the mass payment is initiated (which I used to - is there an issue w/ webhooks currently)?

    transfer ='mass-payments', request_body)
    transfer_url = transfer.headers['location']
    transfer = app_token.get(transfer_url)
    # Get the mass payment items, iterate through them to update the database with transfer urls
    items_url = transfer.body['_links']['items']['href']
    items = app_token.get(items_url)

    # Will this information in particular be available?
    for item in items.body['_embedded']['items']:
        mp_item = MassPayment_Transfer.objects.get(pk=item['metadata']['itemID'])
        transfer_item = app_token.get(item['_links']['self']['href'])
        mp_item.dwolla_transfer_url = transfer_item.body['_links']['cancel']['href']

Also - do you have any idea why one of these transfers would fail to cancel and respond with this:

I submitted these 5 cancellation requests

and this one failed:

I submitted the request like below and the error I received follows. These items were in an array, and #1, 2,4, and 5 succeeded but I received this odd response for #3

request_body = {
            'status': 'cancelled'
for item in transfer_to_cancel:
    item_transfer =, request_body)

dwollav2.error.ValidationError: {"code":"ValidationError","message":"Validation error(s) present. See embedded errors list for more details.","_embedded":{"errors":[{"code":"NotAllowed","message":"Status not allowed.","path":"/status","_links":{}}]}}

I tried again through Postman - and was not able to cancel this particular transfer that way either, with the same error (the transfer is currently ‘pending’).

Hi @jmtichell! The transfer URLs will be made available depending on the queue of the masspayment items. Every item takes about a half-second to complete validation and be added to the batch. Knowing this, a Mass Payment job with 5,000 items will take around 45 minutes for full completion. Rather than waiting in the dark, Dwolla will inform you when the job is completed by sending a masspayment_completed webhook. This webhook will act as a notification that the Mass Payment is completed and you can move onto the next step. This also indicates that the transfer is created and that you should expect a single debit coming out of the bank associated with this Mass Payment job.

There isn’t an issue that we know of currently. Would you be able to share the Massayment ID for us to take a look?

For this one, it looks like it’s a bug on our end that’s preventing you from cancelling the transfer even though there exists a cancel link in the resource when you retrieve it via the API. Let me create a ticket for our team to take a look into the issue! I’ll provide any updates here!

I’m not sure exactly which masspayment it was and didn’t note it at the time.

If you need anything else from me to track this down, let me know.

No worries. Let us know if you do run into a similar instance again.

@shreya Has there been any update here? I’m a few days from swapping my keys to production keys and this seems like a pretty major issue if Dwolla’s having issues cancelling payments.

Hi @jmtichell – The issue with Sandbox is still open as of right now. However, I did forget to mention that this bug only affects Sandbox and not Production! Masspayments in Production is working as expected! :+1: