Production API issue (permissions?) 401

(Roberto Tijerino) #1

We have successfully created an application using the development environment with dwolla API. However, while deploying the same to the production environment, we are getting a 401 while trying to create a new customer.

We have verified the production account (I verified over the phone with Dwolla)
We created an application and granted all permissions available.
We generated a token/refresh token

Here is a snippet of the code:
DwollaSwagger\Configuration::$access_token = $accessToken ;
$apiClient = new DwollaSwagger\ApiClient($dwollaApiUrl); //from db, $dwollaApiUrl =
$customersApi = new DwollaSwagger\CustomersApi($apiClient);
$customerData = array (
‘firstName’ => $patient->FirstName,
‘lastName’ => $patient->LastName,
‘email’ => $patient->Email,
‘type’ => ‘personal’,
‘address1’ => $address->AddressStreet,
‘city’ => $address->AddressCity,
‘state’ => $address->AdressState,
‘postalCode’ => $address->AddressZip,
‘dateOfBirth’ => $formatedDob ,
‘ssn’ => “1234”, //$patient->SSN
’phone’ => $formatedPhone,
‘ipAddress’ => ‘’
) ;

               $new_customer = $customersApi->create($customerData);

The error occurs on the last line of the snippet.

https://api.dwolla.comException: 401[401] Error connecting to the API (

From the message above, I suspect it is a permission issue but I believe we have all the right settings.

Please let us know what are we missing?

(Spencer Hunter) #2

Hi @roberto_tijerino, As mentioned in the API documentation, calls that involve white label [Customers] use the ManageCustomers scope which requires a custom services agreement to be enabled in production. I am assuming your access token does not contain the ManageCustomers scope which is why you may be running into the 401.

To learn more about entering a White Label agreement, please contact Sales!