[500] Error connecting to the API (https://api-sandbox.dwolla.com/customers)


(rakeshpuri goswami) #1
<?php
require('vendor/autoload.php');
try{

DwollaSwagger\Configuration::$access_token = 'XndgPs3n8HmYy6UmoK5lDOFQRURgvgu9FCGhDc2HGDXZ30Byoz';
// DwollaSwagger\Configuration::$debug = 1;
$apiClient = new DwollaSwagger\ApiClient("https://api-sandbox.dwolla.com");

$customersApi = new DwollaSwagger\CustomersApi($apiClient);

$customer = $customersApi->create([
  'firstName' => 'Testone',
  'lastName' => 'Testone',
  'email' => 'Testone@nomail.net',
  'type' => 'personal',
  'address1' => '12rd St',
  'city' => 'TestoneCity',
  'state' => 'Testone',
  'postalCode' => '11101',
  'dateOfBirth' => '1970-02-01',

  # For the first attempt, only the
  # last 4 digits of SSN required

  # If the entire SSN is provided,
  # it will still be accepted
  'ssn' => '5678'
]);

$customer; # => "https://api-sandbox.dwolla.com/customers/25904886-10a2-4372-81df-5d195cd10ffb"


}catch(Exception $e){
	print_r($e->getMessage());
}

?>

(Spencer Hunter) #2

@Rakeshpuri, It looks like this an incorrect value for the state request parameter. The API only accepts two character state codes as a valid value. i.e. Iowa = IA