Facilitator fee on transfer request


#1

I am having trouble including the facilitator fee on transactions using White Label in the Sandbox.

I am using NodeJS and am successful in creating transfers with this JSON object:

var requestBody = { _links: { source: {href: path + source_id}, destination: {href: path + destination_id}}, amount: {currency: 'USD', value: amount} };

I am following the API docs and I am adding the facilitator fee data in the JSON object like so:

var requestBody = { _links: { source: {href: path + source_id}, destination: {href: path + destination_id}}, amount: {currency: 'USD', value: amount}, fees: [{ _links: { 'charge-to': {href: dwollaConf.URL + 'customers/84840474-e21d-431a-a6c7-e316636b0d48'}}, amount: {currency: 'USD', value: '0.99'}}] };

I am referencing these API docs:
https://developers.dwolla.com/resources/facilitator-fee.html
https://docsv2.dwolla.com/#initiate-transfer

Here is the log of the requestBody:

{ _links: { source: { href: 'https://api-uat.dwolla.com/funding-sources/0af98f50-9103-4e76-9c48-fe8d92f8c025' }, destination: { href: 'https://api-uat.dwolla.com/funding-sources/d086bbab-a8cd-4382-a23c-28de95aa72d6' } }, amount: { currency: 'USD', value: '0.05' }, fees: [ { _links: [Object], amount: [Object] } ] } [ { _links: { 'charge-to': [Object] }, amount: { currency: 'USD', value: '0.99' } } ] { 'charge-to': { href: 'https://api-uat.dwolla.com/customers/84840474-e21d-431a-a6c7-e316636b0d48' } }

The error I get is:
Unhandled rejection (<{"status":400,"headers":{"_headers":{"...>, no stack trace)

How do I correctly put the data related to the facilitator fees in the JSON object?
Is there a way to get a more detailed error message?


(Spencer Hunter) #2

From looking at your request body it looks like you just may need to fix a few items. “Fees” is an array of JSON objects. See an example of a raw JSON request body below. Also, are you using our node-v2 SDK?

{
	"_links": {
		"source": {
			"href": "https://api-uat.dwolla.com/funding-sources/0af98f50-9103-4e76-9c48-fe8d92f8c025"
		},
		"destination": {
			"href": "https://api-uat.dwolla.com/funding-sources/d086bbab-a8cd-4382-a23c-28de95aa72d6"
		}
	},
	"amount": {
		"value": "10.00",
		"currency": "USD"
	},
	"fees": [
		{
			"_links": {
				"charge-to": {
					"href": "https://api-uat.dwolla.com/customers/84840474-e21d-431a-a6c7-e316636b0d48"
				}
			},
			"amount": {
				"value": "1.00",
				"currency": "USD"
			}
		}
	]
}

#3

@spencer I am using the official dwolla-v2-node SDK. I am following that example and it is not working. You say there are a few items that I need to fix, but can you please look at what I posted originally and compare it to what you posted and explain what I am doing different specifically?


(Spencer Hunter) #4

Sorry for the delay here and confusion @scuba. I misread the log of your request body. It looks like the amount of the transaction is less than the fee amount. The fee amount cannot be more than 50% of the overall transaction amount. I believe this is what may be causing the 400.