# Send from Master Account balance to Customer Funding Source NETStandard C#

**URL:** <https://discuss.dwolla.com/t/send-from-master-account-balance-to-customer-funding-source-netstandard-c/5522>\
**Category:** API Support\
**Created:** [January 31, 2020, 2:23pm UTC](https://discuss.dwolla.com/t/send-from-master-account-balance-to-customer-funding-source-netstandard-c/5522 "2020-01-31T14:23:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neuren](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/neuren/32/2315_2.png) [@Neuren](https://discuss.dwolla.com/u/Neuren)\
**Post date:** [January 31, 2020, 2:23pm UTC](https://discuss.dwolla.com/t/send-from-master-account-balance-to-customer-funding-source-netstandard-c/5522/1 "2020-01-31T14:23:50Z")

</div>

Hi there,  
I’m using NETStandard Dwolla.Client Nuget v. 5.1.1 (the last at this point). What I try to do is transferring from Master Account balance to a verified funding source of receive-only Customer. I use “send” link of the Account entity and failed to perform transfer successfully on my own or find a solution. Here’s what I have right now:

```
var root = await GetRootAsync();
//Account inherits BaseResponse and has Id and Name properties
var accountResponse = await GetAsync<Account>(root.Links[DwollaConsts.Account].Href);
ValidateResponse(accountResponse, nameof(ChargeAsync));
var account = accountResponse.Content;

var fundingSourcesResponse = await GetAsync<GetFundingSourcesResponse>(new Uri(
    $@"{new Uri($"{root.Links[DwollaConsts.Customers].Href}/{input.PaymentGatewayCustomerIdentifier}")
        .AbsoluteUri}/{DwollaConsts.FundingSources}"));

ValidateResponse(fundingSourcesResponse, nameof(ChargeAsync));

var destinationFundingSource = fundingSourcesResponse.Content.Embedded.FundingSources.FirstOrDefault(fs =>
    fs.Id == input.SourceIdentifier);

Check.NotNull(destinationFundingSource, nameof(destinationFundingSource));
Debug.Assert(destinationFundingSource != null, "destinationFundingSource != null");

var createTransferRequest = new CreateTransferRequest
{
    Amount = new Money {Currency = input.Currency, Value = input.Amount},
    Links = new Dictionary<string, Link>(new List<KeyValuePair<string, Link>>
    {
        //new KeyValuePair<string, Link>(DwollaConsts.Source, account.Links[DwollaConsts.Self]),
        new KeyValuePair<string, Link>(DwollaConsts.Destination, destinationFundingSource.Links[DwollaConsts.Self])
    })
};

var sendResponse = await PostAsync<CreateTransferRequest, TransferResponse>(
    account.Links[DwollaConsts.Send].Href, createTransferRequest);

//that fails with a message "A server error occurred. Error ID: 1d1a5862-2110-45d1-82bc-8c247e9610ff."
ValidateResponse(sendResponse, nameof(ChargeAsync));
var sendTransfer = sendResponse.Content;
```

---

<div class="post-metadata">

**Author:** ![spencer](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/spencer/32/2143_2.png) [@spencer](https://discuss.dwolla.com/u/spencer)\
**Post date:** [January 31, 2020, 2:39pm UTC](https://discuss.dwolla.com/t/send-from-master-account-balance-to-customer-funding-source-netstandard-c/5522/2 "2020-01-31T14:39:52Z")

</div>

Hi @Neuren, I pulled your request body from our logs and here is what we are receiving:

```
{
    "_links": {
        "destination": {
            "href": "https://api-sandbox.dwolla.com/funding-sources/280509b3-a13d-4bf1-afce-15054f0a9402",
            "type": "application/vnd.dwolla.v1.hal+json",
            "resource-type": "funding-source"
        }
    },
    "amount": {
        "value": 1.0,
        "currency": "USD"
    }
}
}

```

It appears that you are missing the `source` JSON object which indicates what the source funding source is in the Transfer request. Try updating your request body to add that in and let us know if it works! Here’s an example of a valid request body:

```
{
"_links": {
    "source": {
        "href": "https://api-sandbox.dwolla.com/funding-sources/{{BalanceFundingSourceId}}"
    },
    "destination": {
        "href": "https://api-sandbox.dwolla.com/funding-sources/{{BankFundingSourceId}}"
    }
},
"amount": {
    "currency": "USD",
    "value": "42.00"
}
}
```

---

<div class="post-metadata">

**Author:** ![Neuren](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/neuren/32/2315_2.png) [@Neuren](https://discuss.dwolla.com/u/Neuren)\
**Post date:** [January 31, 2020, 2:46pm UTC](https://discuss.dwolla.com/t/send-from-master-account-balance-to-customer-funding-source-netstandard-c/5522/3 "2020-01-31T14:46:19Z")

</div>

Hi, @spencer, ok got it, thanks. I thought “send” link used from Account doesn’t require source and uses its balance. Trying…

---

<div class="post-metadata">

**Author:** ![spencer](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/spencer/32/2143_2.png) [@spencer](https://discuss.dwolla.com/u/spencer)\
**Post date:** [January 31, 2020, 3:06pm UTC](https://discuss.dwolla.com/t/send-from-master-account-balance-to-customer-funding-source-netstandard-c/5522/4 "2020-01-31T15:06:08Z")

</div>

Ah, gotcha! That sounds like a valid assumption. If we allowed you to set a default funding source (since there are multiple types), then I think this would be an interesting approach.

---

<div class="post-metadata">

**Author:** ![Neuren](https://sea2.discourse-cdn.com/dwolla/user_avatar/discuss.dwolla.com/neuren/32/2315_2.png) [@Neuren](https://discuss.dwolla.com/u/Neuren)\
**Post date:** [January 31, 2020, 3:08pm UTC](https://discuss.dwolla.com/t/send-from-master-account-balance-to-customer-funding-source-netstandard-c/5522/5 "2020-01-31T15:08:33Z")

</div>

It worked. I didn’t realize balance is a funding source with a type “balance” and “send” still has to have Source provided. I’ve added

```
var accountFundingSourcesResponse =
                await GetAsync<GetFundingSourcesResponse>(account.Links[DwollaConsts.FundingSources].Href);

            ValidateResponse(accountFundingSourcesResponse, nameof(ChargeAsync));
            var accountFundingSources = accountFundingSourcesResponse.Content.Embedded.FundingSources;

            var balanceAccountFs =
                accountFundingSources.FirstOrDefault(fs => fs.Type == DwollaConsts.BalanceFundingSourceType);

```

and

```
var createTransferRequest = new CreateTransferRequest
{
    Amount = new Money {Currency = input.Currency, Value = input.Amount},
    Links = new Dictionary<string, Link>(new List<KeyValuePair<string, Link>>
    {
        new KeyValuePair<string, Link>(DwollaConsts.Source, balanceAccountFs.Links[DwollaConsts.Self]),
        new KeyValuePair<string, Link>(DwollaConsts.Destination, destinationFundingSource.Links[DwollaConsts.Self])
    })
};

```

@spencer thank you once again.
