Could not create transfer and was getting validation error


(Ias Innovative Advanced Solutions) #1

Hi Support,

I am using web api and .net framework.
How can I create transfer and send money to customer’s bank account ?
Can you send one example for .net Framework with rest api which I can use sending money to users banks’ accounts? I am getting validation error.

{“code”:“ValidationError”,“message”:“Validation error(s) present. See embedded errors list for more details.”,"_embedded":{“errors”:[{“code”:“Restricted”,“message”:“Sender restricted.”,“path”:"/_links/source/href","_links":{}}]}}

Thanks,
Eduard


(Cory Anderson) #2

Hello @IAS_Innovative
Looking at the response body, it would seem as if your source of the transfer is causing the bad request to be thrown.

There are a few reasons a 400 could be thrown:

  1. The source Customer is type=Receive-Only
    Receive-only Customers cannot send funds.
    Check to see the Customer type by calling GET https://api.dwolla.com/customers/{id} make sure the Customer is either an unverified or verified Customer type.
    ((https://docsv2.dwolla.com/#retrieve-a-customer))
    If you need to create an Unverified or Verified Customer, refer to our dev docs here:
    ((https://docsv2.dwolla.com/#create-a-customer))

  2. The Customer is deactivated or suspended
    Customers that in these states cannot interact with Dwolla until they are out of this status. To check this, you can call GET https://api.dwolla.com/customers/{id}
    If you want to reactivate your Customer, refer to these docs:
    ((https://docsv2.dwolla.com/#update-a-customer))
    Suspended Customers will need to be unsuspended by a member of the Dwolla team.


(Ias Innovative Advanced Solutions) #3

Hi All,

I tried to create customer with “type = Unverified” but again I got validation error.

{“code”:“ValidationError”,“message”:“Validation error(s) present. See embedded errors list for more details.”,"_embedded":{“errors”:[{“code”:“NotAllowed”,“message”:“Receiver cannot receive from sender.”,“path”:"/_links/destination/href","_links":{}}]}}

I have done the following steps.

  1. Authorization
    https://sandbox.dwolla.com/oauth/v2/token
    Content-Type: application/json
    request
    {
    “client_id” : “<client_id>”,
    “client_secret” : “<client_secret>”,
    “grant_type” : “client_credentials”
    }
    response
    {
    “access_token”: “<access_token>”,
    “token_type”: “bearer”,
    “expires_in”: 3607
    }

  2. Create customer
    https://api-sandbox.dwolla.com/customers
    Content-type: application/json
    Accept: application/vnd.dwolla.v1.hal+json
    Authorization: Bearer <access_token>

    request
    {
    “firstName”: “Edo”,
    “lastName”: “Antinyan”,
    “email”: "antinyan@gmail.com",
    “type”: “verified”,
    “businessName”: “Edo Antinyan”,
    “ipAddress”: “37.186.75.118”
    }
    response
    location: https://api-sandbox.dwolla.com/customers/0e00388a-7590-4ca8-9720-3851e8543f9e

  3. Create funding source
    https://api-sandbox.dwolla.com/customers/0e00388a-7590-4ca8-9720-3851e8543f9e/funding-sources
    Content-type: application/json
    Accept: application/vnd.dwolla.v1.hal+json
    Authorization: Bearer <access_token>
    request
    {
    “routingNumber”: “222222226”,
    “accountNumber”: “123456789”,
    “bankAccountType”: “checking”,
    “name”: “Edo Antinyan - Checking 6789”
    }
    response
    location: https://api-sandbox.dwolla.com/funding-sources/e501d6e3-3736-43fa-a415-a49357283ce3

  4. Make transfer
    https://api-sandbox.dwolla.com/transfers
    Content-type: application/json
    Accept: application/vnd.dwolla.v1.hal+json
    Authorization: Bearer <access_token>

request
{
“_links”: {
“source”: {
“href”: “https://api-sandbox.dwolla.com/funding-sources/e501d6e3-3736-43fa-a415-a49357283ce3
},
“destination”: {
“href”: “https://api-sandbox.dwolla.com/customers/0e00388a-7590-4ca8-9720-3851e8543f9e
}
},
“amount”: {
“currency”: “USD”,
“value”: “17.00”
},
“metadata”: {
“foo”: “bar”
}
}
response
{“code”:“ValidationError”,“message”:“Validation error(s) present. See embedded errors list for more details.”,"_embedded":{“errors”:[{“code”:“NotAllowed”,“message”:“Receiver cannot receive from sender.”,“path”:"/_links/destination/href","_links":{}}]}}

Can you say my steps is correct or not and where is my mistake?
I want to send money to customer bank account.

Thanks,
Edo


(Cory Anderson) #4

Hello @IAS_Innovative
Looking at the response body, it looks like you are trying to initiate a transfer within a Customer.

Source: Customer A Bank
Destination Customer A

I would recommend creating two different Customers and initiating a transfer between them. Remember that at least one Customer must be CIP verified, meaning one party must either be a verified Customer or the Dwolla Master Account.

{
“_links”: {
“source”: {
“href”: “https://api-sandbox.dwolla.com/funding-sources/{{DwollaMasterAccountFundingSourceId}}”
},
“destination”: {
“href”: “https://api-sandbox.dwolla.com/funding-sources/{{UnverifiedCustomerBankFundingSourceId}}”
}
},
“amount”: {
“currency”: “USD”,
“value”: “17.00”
},
“metadata”: {
“foo”: “bar”
}
}

(Ias Innovative Advanced Solutions) #5

Hello,

Thank you for your response and advice. 1) Can I create Dwolla Master Account FundingSource in Sandbox (for testing) ? 2) Where can I read about that? 3) When I transfer money from Dwolla Master Account FundingSource to Unverified Customer Bank FundingSource how that money will receive Unverified Customer Bank account ?


(Cory Anderson) #6

Hello @IAS_Innovative, happy Friday, hope your week has been going well so far!
1 - Can I create Dwolla Master Account FundingSource in Sandbox (for testing) ?
Yes, you can create a bank funding source for your Dwolla Master Account in the Sandbox. In the Sandbox environment, a Dwolla Master Account has a default max of two bank funding sources. We can raise or lower this based on your testing needs as well.
2 - Where can I read about that?
You can refer to our developer docs here:
((https://docsv2.dwolla.com/#create-a-funding-source-for-an-account))
3 - When I transfer money from Dwolla Master Account FundingSource to Unverified Customer Bank FundingSource how that money will receive Unverified Customer Bank account ?
When you kick off a transfer, Dwolla will do some basic validation to see if the API call looks correct and that the Unverified Customer has not sent more than $5,000 in that week. (As a reminder, an Unverified Customer can only send $5,000 per week).
From there, we will start processing the transfer and the funds will go through the ACH processing. To simulate this in the Sandbox, you will hit the Process Bank Transfers button at the top of the Sandbox dashboard.