Transfer with WRONG destination field


(Rongjian Lan) #1

Hi,

I initiated a transfer: “https://api-uat.dwolla.com/transfers/019e1481-0a0a-e711-80ee-0aa34a9b2388”, which is meant to pay to customer “255b92a7-300b-42fc-b72f-5301c0c6c42e”. However, when I retrieve the transfer with transfer API, the result is like this:

{
u’status’:u’processed’,
u’created’: u’2017-03-16T05:36:35.143 Z’,
u’clearing’:{
u’source’:u’standard’
},
u’amount’:{
u’currency’:u’usd’,
u’value’:u’333.00’
},
u’_links’:{
u’source’:{
u’resource-type’:u’funding-source’,
u’href’: u’https://api-uat.dwolla.com/funding-sources/593b86cd-7f6a-418e-8fce-61fa7d173b7b’,
u’type’:u’application/vnd.dwolla.v1.hal+json’
},
u’self’:{
u’resource-type’:u’transfer’,
u’href’: u’https://api-uat.dwolla.com/transfers/009e1481-0a0a-e711-80ee-0aa34a9b2388’,
u’type’:u’application/vnd.dwolla.v1.hal+json’
},
u’destination’:{
u’resource-type’:u’customer’,
u’href’: u’https://api-uat.dwolla.com/customers/45ad438b-dc6f-4210-b9d7-f651a870265b’,
u’type’:u’application/vnd.dwolla.v1.hal+json’
},
u’funded-transfer’:{
u’resource-type’:u’transfer’,
u’href’: u’https://api-uat.dwolla.com/transfers/019e1481-0a0a-e711-80ee-0aa34a9b2388’,
u’type’:u’application/vnd.dwolla.v1.hal+json’
}
},
u’id’:u’009e1481-0a0a-e711-80ee-0aa34a9b2388’
}

Clearly, the destination is not what I expected. It’s the paying customer, instead of the expected receiver.

Is there a problem with the API or I missed something?

Thanks


(Spencer Hunter) #2

Hi @Rongjian_Lan, It looks like the transfer you referenced (019e1481-0a0a-e711-80ee-0aa34a9b2388) is for Customer (45ad438b-dc6f-4210-b9d7-f651a870265b) paying Customer (255b92a7-300b-42fc-b72f-5301c0c6c42e). The transfer you fetched from the API is part of the overall transfer lifecycle and represents the funds moving from the source Customer’s bank to their balance. Hopefully I can help provide some clarity on how transactions work between these two Access API Customer types. Please let me know if you have any follow up questions after reviewing my reply. Apologies in advance for the lengthy reply. :grin:

With any transfer between two users that is sourced from a bank account or going to a recipient’s bank account, funds must pass through the Dwolla network. It looks like you are facilitating transactions between two Verified Customers so I will reply with the assumption that that transaction is from the bank of a Verified Customer going to the bank of a Verified Customer.

Since Verified Customers can hold a balance in the Dwolla network then there will be an additional transfer from the bank to the balance which will be represented as a unique id in the API. In addition, if the destination of the transfer is the funding source(Bank Account) for a Verified Customer there will be an additional transfer from the recipient’s balance to their bank.

Example scenario

A bank-to-bank transaction between two Verified Customers

Verified Customer A - Customer Id: https://api-uat.dwolla.com/customers/271d21f6-5a06-40f7-b9d6-5e5866ad48fb
Verified Customer A - Funding source Id: https://api-uat.dwolla.com/funding-sources/23627fab-36c3-494a-9927-34a273736a9a

Verified Customer B - Customer Id: https://api-uat.dwolla.com/customers/491b1fff-514b-4d90-9a3f-4360a51ab47b
Verified Customer B - Funding source Id: https://api-uat.dwolla.com/funding-sources/a5bee374-0a48-4fa3-8d12-9f13f75aa9de

Transfer request example:

POST https://api-uat.dwolla.com/transfers 
Accept: application/vnd.dwolla.v1.hal+json
Authorization: Bearer {access token}
Content-Type: application/json


{
    "_links": {
        "source": {
            "href": "https://api-uat.dwolla.com/funding-sources/23627fab-36c3-494a-9927-34a273736a9a"
        },
        "destination": {
            "href": "https://api-uat.dwolla.com/funding-sources/a5bee374-0a48-4fa3-8d12-9f13f75aa9de"
        }
    },
    "amount": {
        "currency": "USD",
        "value": "42.00"
    }
}

Response:
Location: https://api-uat.dwolla.com/transfers/28b670ab-7c0a-e711-80ef-0aa34a9b2388

Transfer and events:

If an application has an active webhook subscription, then we should fire the follow sequence of events. These will be fired throughout the complete lifecycle of the transaction.

Example request:
Retrieving transfer: https://api-uat.dwolla.com/transfers/28b670ab-7c0a-e711-80ef-0aa34a9b2388

GET https://api-uat.dwolla.com/transfers/28b670ab-7c0a-e711-80ef-0aa34a9b2388
Accept: application/vnd.dwolla.v1.hal+json
Authorization: Bearer {access token}

Response:

{
  "_links": {
    "source": {
      "href": "https://api-uat.dwolla.com/customers/271d21f6-5a06-40f7-b9d6-5e5866ad48fb",
      "type": "application/vnd.dwolla.v1.hal+json",
      "resource-type": "customer"
    },
    "funding-transfer": {
      "href": "https://api-uat.dwolla.com/transfers/27b670ab-7c0a-e711-80ef-0aa34a9b2388",
      "type": "application/vnd.dwolla.v1.hal+json",
      "resource-type": "transfer"
    },
    "destination-funding-source": {
      "href": "https://api-uat.dwolla.com/funding-sources/a5bee374-0a48-4fa3-8d12-9f13f75aa9de",
      "type": "application/vnd.dwolla.v1.hal+json",
      "resource-type": "funding-source"
    },
    "self": {
      "href": "https://api-uat.dwolla.com/transfers/28b670ab-7c0a-e711-80ef-0aa34a9b2388",
      "type": "application/vnd.dwolla.v1.hal+json",
      "resource-type": "transfer"
    },
    "funded-transfer": {
      "href": "https://api-uat.dwolla.com/transfers/979dfde6-7c0a-e711-80ef-0aa34a9b2388",
      "type": "application/vnd.dwolla.v1.hal+json",
      "resource-type": "transfer"
    },
    "source-funding-source": {
      "href": "https://api-uat.dwolla.com/funding-sources/23627fab-36c3-494a-9927-34a273736a9a",
      "type": "application/vnd.dwolla.v1.hal+json",
      "resource-type": "funding-source"
    },
    "destination": {
      "href": "https://api-uat.dwolla.com/customers/491b1fff-514b-4d90-9a3f-4360a51ab47b",
      "type": "application/vnd.dwolla.v1.hal+json",
      "resource-type": "customer"
    }
  },
  "id": "28b670ab-7c0a-e711-80ef-0aa34a9b2388",
  "status": "processed",
  "amount": {
    "value": "42.00",
    "currency": "usd"
  },
  "created": "2017-03-16T19:13:43.630Z"
}

As you can see in the above response that there are link relations for funded-transfer and funding-transfer. In this example, funding-transfer points to the transaction that occurred from the source bank to the balance. Additionally, funded-transfer points to the transaction that occurred from the destination balance to the bank. We recommend that applications use the funded-transfer or funding-transfer link relations to determine if there is an additional transaction in the overall transaction lifecycle. With bank-to-bank transactions between two users there is always two sides. (An ACH debit from the source Customer & an ACH credit going to the destination Customer)

Hope this helps! There is a lot of content here so please don’t hesitate to reply back if I can clarify further. :slight_smile:


(Rongjian Lan) #3

That’s a great reply. Clarified my questions! Thanks.

Then if we don’t want to involve any Dwolla balance for users and only process bank-to-bank transfer. We should always specify funding-source as the source and destination, right?


(Spencer Hunter) #4

That sounds correct! When POSTing to /transfers the request body will contain a source href which would be a link that represents the source bank account (e.g. https://api-uat.dwolla.com/funding-sources/23627fab-36c3-494a-9927-34a273736a9a) and the destination href would be a link that represents the destination bank account (e.g. https://api-uat.dwolla.com/funding-sources/a5bee374-0a48-4fa3-8d12-9f13f75aa9de)


(Rongjian Lan) #5

In the uat environment, after I click “process bank transfers” and look into my logs, I can see all events for the Day1 and Day3 category in the list. However, I couldn’t find that single event for Day4. Is this just because of UAT env?


(Spencer Hunter) #6

@Rongjian_Lan, Strange. I just tested this funds flow and it fired the correct events for me. Does the last event process if you click “Process bank transfers” a third time? Is the destination in the request to transfer funds a bank account that belongs to a Customer?


(Rongjian Lan) #7

Hi, Spencer:

A related question: Recently in our test environment we experience that the money of a transfer from bank of a unverified customer to the bank of a verified customer stops at the receiver’s Dwolla balance, not the bank account.

Here is the transfer we get from the transfer request: https://api-sandbox.dwolla.com/transfers/71649077-5c49-e711-80f2-0aa34a9b2388

We figured out there is a problem because fetching this transfer doesn’t returns a “funding-trasnfer” url, which breaks our system.

Could you explain what happened here?


(Rongjian Lan) #8

@spencer Plz take a look at my question above. Thanks.


(Spencer Hunter) #9

Hi @Rongjian_Lan, Fetching the transfer you referenced above should give you back the “funded-transfer” link and not a “funding-transfer” link. Note: The funded-transfer link wont show up in the response until the source transfer (ACH debit) has completed. If you’re using the Process bank transfer button, then you’ll want to click it more than once to process both sides of the transfer.


(Rongjian Lan) #10

Hi, @spencer:

Yeah, I know that link is for funded-transfer. I guess I didn’t clarify my issue. This URL is what we get from the customer_bank_transfer_completed webhook event. The issue is: before, fetching this link will return a funded-trasnfer object which “contains” a link to the corresponding funding-transfer. But somehow when fetching this link, we couldn’t get the contained funding-transfer in it, which breaks our code.

Is there anything we are not doing right, or have different expectation when we get customer_bank_transfer_completed event? Can we expect that this event means the transfer is all done?

Thanks


(Spencer Hunter) #11

You can expect that this transfer is all done if this event is for the destination Customer involved in the transaction. Can you clarify if you were previously sending funds from a Verified Customer to a Verified Customer? The latest transaction references a transaction from an Unverified Customer to a Verified Customer which is a different transfer flow from what was mentioned initially in this thread.