Create Customer Not Returning Customer ID created

Here are my PHP codeigniter functions to create Test Customers. System is able to create the customer but the response is not returning CUSTOMER ID created. It just prints 1 there. Any help??

public function createTestCustomers() {
$data = array(
‘firstName’ => “Andy”,
‘lastName’ => “Ron”,
‘email’ => “andy@xyz.com”,
‘type’ => “receive-only”
);

		$this->createCustomer($data);		
}

public function createCustomer($dataArr) {

	$url = "https://api-sandbox.dwolla.com";

	$data_fields = json_encode($dataArr);
	$ch=curl_init($url . "/customers");

	//set options
	curl_setopt($ch, CURLOPT_POST, true);
	curl_setopt($ch, CURLOPT_POSTFIELDS, $data_fields);
	curl_setopt($ch, CURLOPT_HTTPHEADER, array(
			'Authorization: Bearer ' . $this->access_token,
		          'Accept: application/vnd.dwolla.v1.hal+json',                                                                                
      'Content-Type: application/vnd.dwolla.v1.hal+json')                                                                       
	);
	$rsltJson = curl_exec($ch);
	$ret = json_decode($rsltJson,true);
	print_r($ret); //---<-------- NOT RETURNING CUSTOMER ID in RESP
	curl_close($ch);
	return $ret;
}

Hi @Sharma, As referenced in our docs, POSTs to the the API to create a new resource will return a link to the resource (which includes the ID) in the Location response header. It looks like you’re attempting to decode the response body, which in this case would be empty.

Thanks that helped!

One more question - I did the following in the sandbox env

  1. Created DWOLLA processor_token through PLAID APIs
  2. Created customers (Customer A and Customer B) using DWOLLA APIs
  3. For A and B customers and using 2 different processor_tokens from Step 1 created funding sources
  4. Tried to do the transfer but this is where I got error code 400 [Please note I am able to put funding sources by ID successfully]

What am I doing wrong?

Here is my DEBUG LOG:

[DEBUG] HTTP Request body ~BEGIN~
{"_links":{“source”:{“href”:“https://api-sandbox.dwolla.com/funding-sources/2ee1759d-090d-464d-acdc-5ce27a3b5e59"},“destination”:{“href”:“https://api-sandbox.dwolla.com/funding-sources/f4d39f76-3f37-4b20-a8fa-e9640e369236”}},“amount”:{“currency”:“USD”,“value”:“23.00”},“correlationId”:"8a2cdc8d-629d-4a24-98ac-40b735222f33”}
~END~
[DEBUG] HTTP Response body ~BEGIN~
{“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":{}}]}}
~END~
* Hostname was NOT found in DNS cache
* Trying 104.18.125.12…
* Connected to api-sandbox.dwolla.com (104.18.125.12) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: none
CApath: /etc/ssl/certs
* SSL connection using TLSv1.2 / ECDHE-ECDSA-AES128-GCM-SHA256
* Server certificate:
* subject: C=US; ST=CA; L=San Francisco; O=Cloudflare, Inc.; CN=dwolla.com
* start date: 2020-02-24 00:00:00 GMT
* expire date: 2020-10-09 12:00:00 GMT
* subjectAltName: api-sandbox.dwolla.com matched
* issuer: C=US; ST=CA; L=San Francisco; O=CloudFlare, Inc.; CN=CloudFlare Inc ECC CA-2
* SSL certificate verify ok.
> POST /transfers HTTP/1.1
User-Agent: php-swagger-1.3.0
Host: api-sandbox.dwolla.com
Accept: application/vnd.dwolla.v1.hal+json
Content-Type: application/vnd.dwolla.v1.hal+json
Authorization: Bearer A6ykQkZpZ7Oh9b7bXrHuVHcC47OJmWsstN9yZ3eLxA5hYD2QKL
Content-Length: 332
* upload completely sent off: 332 out of 332 bytes
< HTTP/1.1 400 Bad Request

Hi @Sharma – Thanks for posting a detailed req/res log. :slight_smile: It looks like, while the sender has a verified funding-source (id: 2ee1759d-090d-464d-acdc-5ce27a3b5e59), the sender itself was created as a Receive-only Customer (RO). ROs aren’t able to send funds.

You’d want to create the sender as a Verified Customer type in order to send funds to the Receiver (which is also an RO). Please check out this resource on Customer Types in Dwolla for more information on what types there, what limitations each have, and which types you would want to choose based on your use-case. Let us know if you come across any questions!

Hi @sharma, A Restricted error (either sender or receiver) typically implies an issue with the underlying Customer type you have created for your end-user. An example can include invalid user status such as deactivated or suspended. In this specific instance, the Sender restricted error is returned due to the underlying business rules tied to the sending Customer Type being used in this request. The sending party is created as a Receive-only User, which are only eligible to receive funds from an identity verified account. For more information on the different types of Customer types, refer to this resource article. Keep in mind, as the name implies, a Receive-only user can only receive funds and not send funds.

Hightlighting an important paragraph within the article I linked to which is key to a successful integration.

As you decide what Customer types to create for your application, a good thing to keep in mind is Customer Identification Program (CIP) Verification. Remember that regardless of your application type, a transfer between two parties requires that at least one party must be CIP verified. It is your decision about which party completes this process based on your business model. Your own Dwolla Master Account can count as a verified party. You may also consider having both parties complete CIP verification, as we also require CIP verification in order for a customer to hold funds in the Dwolla network in the form of a balance.

Any one of the following combination of Customer types will work for facilitation funds flows:

  1. Unverified Customer A -> Verified Customer B
  2. Verified Customer A -> Unverified Customer B
  3. Verified Customer A -> Verified Customer B
  4. Verified Customer A -> Receive-only User B

Hope this helps, please let us know if you have any follow up questions!

Thanks Shreya! Thats helpful. Follow up questions:

  1. In the sandbox environment, if I have the customer already created as “Receive-only” - is there any User Interface to make it Verified ? If there any API to update it?
  2. I am using PLAID + DWOLLA - My customers are going to have plaid access code - how do I create these customers Verified customer in DWOLLA - do I have to ask for SSN last 4 and address on my app or can DWOLLA get that from PLAID?

Thanks Spencer, this is very helpful.

Spencer,

Sorry to bug you with this - but here is what I just tried:

I created a verified Customer and I already have “Receive-Type” customer.
[DEBUG] HTTP Request body ~BEGIN~
{"_links":{“source”:{“href”:“https://api-sandbox.dwolla.com/funding-sources/2ee1759d-090d-464d-acdc-5ce27a3b5e59"},“destination”:{“href”:“https://api-sandbox.dwolla.com/funding-sources/c971ae70-eec0-4a08-bb59-de56f51db8f2”}},“amount”:{“currency”:“USD”,“value”:“23.00”},“correlationId”:"8a2cdc8d-629d-4a24-98ac-40b732222f33”}
~END~
[DEBUG] HTTP Response body ~BEGIN~
{“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":{}}]}}
~END~

  • Hostname was NOT found in DNS cache
  • Trying 104.18.125.12…
  • Connected to api-sandbox.dwolla.com (104.18.125.12) port 443 (#0)
  • successfully set certificate verify locations:
  • CAfile: none
    CApath: /etc/ssl/certs
  • SSL connection using TLSv1.2 / ECDHE-ECDSA-AES128-GCM-SHA256
  • Server certificate:
  • subject: C=US; ST=CA; L=San Francisco; O=Cloudflare, Inc.; CN=dwolla.com
  • start date: 2020-02-24 00:00:00 GMT
  • expire date: 2020-10-09 12:00:00 GMT
  • subjectAltName: api-sandbox.dwolla.com matched
  • issuer: C=US; ST=CA; L=San Francisco; O=CloudFlare, Inc.; CN=CloudFlare Inc ECC CA-2
  • SSL certificate verify ok.

POST /transfers HTTP/1.1
User-Agent: php-swagger-1.3.0
Host: api-sandbox.dwolla.com
Accept: application/vnd.dwolla.v1.hal+json
Content-Type: application/vnd.dwolla.v1.hal+json
Authorization: Bearer nR0gbNkXfvZkgFUmKZA2NrT8ny7txMRMHB4zYCW4MUc45QjK9O
Content-Length: 332

Here is the https://api-sandbox.dwolla.com/funding-sources/c971ae70-eec0-4a08-bb59-de56f51db8f2 lookup

[DEBUG] HTTP Request body ~BEGIN~

~END~
[DEBUG] HTTP Response body ~BEGIN~
{"_links":{“transfer-from-balance”:{“href”:“https://api-sandbox.dwolla.com/transfers",“type”:“application/vnd.dwolla.v1.hal+json”,“resource-type”:“transfer”},“self”:{“href”:“https://api-sandbox.dwolla.com/funding-sources/c971ae70-eec0-4a08-bb59-de56f51db8f2”,“type”:“application/vnd.dwolla.v1.hal+json”,“resource-type”:“funding-source”},“transfer-to-balance”:{“href”:“https://api-sandbox.dwolla.com/transfers”,“type”:“application/vnd.dwolla.v1.hal+json”,“resource-type”:“transfer”},“transfer-send”:{“href”:“https://api-sandbox.dwolla.com/transfers”,“type”:“application/vnd.dwolla.v1.hal+json”,“resource-type”:“transfer”},“remove”:{“href”:“https://api-sandbox.dwolla.com/funding-sources/c971ae70-eec0-4a08-bb59-de56f51db8f2”,“type”:“application/vnd.dwolla.v1.hal+json”,“resource-type”:“funding-source”},“customer”:{“href”:“https://api-sandbox.dwolla.com/customers/50f7e383-1c24-48cc-8c5e-1d8397a01062”,“type”:“application/vnd.dwolla.v1.hal+json”,“resource-type”:“customer”},“transfer-receive”:{“href”:“https://api-sandbox.dwolla.com/transfers”,“type”:“application/vnd.dwolla.v1.hal+json”,“resource-type”:“transfer”}},“id”:“c971ae70-eec0-4a08-bb59-de56f51db8f2”,“status”:“verified”,“type”:“bank”,“bankAccountType”:“checking”,“name”:"Steve Becker”,“created”:“2020-03-25T18:37:23.616Z”,“removed”:false,“channels”:[“ach”],“bankName”:“SANDBOX TEST BANK”,“fingerprint”:“bf5d32eb4989111929781a0a5a805fd4a3640b3e4f2792ec3da8df185161ddf9”}
~END~

  • Hostname was NOT found in DNS cache
  • Trying 104.18.122.12…
  • Connected to api-sandbox.dwolla.com (104.18.122.12) port 443 (#0)
  • successfully set certificate verify locations:
  • CAfile: none
    CApath: /etc/ssl/certs
  • SSL connection using TLSv1.2 / ECDHE-ECDSA-AES128-GCM-SHA256
  • Server certificate:
  • subject: C=US; ST=CA; L=San Francisco; O=Cloudflare, Inc.; CN=dwolla.com
  • start date: 2020-02-24 00:00:00 GMT
  • expire date: 2020-10-09 12:00:00 GMT
  • subjectAltName: api-sandbox.dwolla.com matched
  • issuer: C=US; ST=CA; L=San Francisco; O=CloudFlare, Inc.; CN=CloudFlare Inc ECC CA-2
  • SSL certificate verify ok.

GET /funding-sources/c971ae70-eec0-4a08-bb59-de56f51db8f2 HTTP/1.1
User-Agent: php-swagger-1.3.0
Host: api-sandbox.dwolla.com
Accept: application/vnd.dwolla.v1.hal+json
Content-Type: application/json
Authorization: Bearer nR0gbNkXfvZkgFUmKZA2NrT8ny7txMRMHB4zYCW4MUc45QjK9O

Hello @Sharma, hope your week is going well.
We can refer to the request example you specified above and break this down by source and destination.
Your source Customer - a292db07-cd0d-4169-a8c7-4bfa7d20667f - is classified as receive-only
Your source Funding Source - 2ee1759d-090d-464d-acdc-5ce27a3b5e59 - has a status of verified.
Even though the Funding Source is in a verified status, due to your Customer being classified receive-only, they are not able to send funds

Your destination Customer - 50f7e383-1c24-48cc-8c5e-1d8397a01062 - has a status of verified
Your destination Funding Source - c971ae70-eec0-4a08-bb59-de56f51db8f2 - has a status of verified.
It looks like this Customer and Funding Source are eligible to send funds.

I would recommend switching your source to be the verified Customer’s Funding Source.
And the destination to be the receive-only Customer’s Funding Source.

{
    "_links": {
        "source": {
            "href": "https://api-sandbox.dwolla.com/funding-sources/c971ae70-eec0-4a08-bb59-de56f51db8f2"
        },
        "destination": {
            "href": "https://api-sandbox.dwolla.com/funding-sources/2ee1759d-090d-464d-acdc-5ce27a3b5e59"
        }
    },
    "amount": {
        "currency": "USD",
        "value": "10.00"
    }
}

Awesome thanks Cory! That did the magic. You guys are awesome! Thank you!

One more question.
My use case is - users login to my portal to send and recieve money to other folks in the network and part of my portal.
I am using PLAID to get my customers onboarded - with that I am having the following steps:

  1. Create customer using DWOLLA API - creating “VERIFIED” users as user can send and recv money
  2. Get and register funding source for customers - input for this is the PLAID PROCESSOR TOKEN for DWOLLA
  3. Initiate Transfer

Question is for step 1 - for me to make everybody VERIFIED customer - I have to ask their Address and Last 4 of SSN. Is there a way to avoid SSN ask to make customer VERIFIED?

I have to ask their Address and Last 4 of SSN. Is there a way to avoid SSN ask to make customer VERIFIED?

In order to create a Verified Customer, Dwolla requires the last four of a user’s SSN to comply with Know Your Customer (KYC) compliance. Currently, there is no way to avoid passing an SSN to create a Verified Customer.