Create a customer - Dwolla Developer Portal

Create a Customer

Endpoint

POST

https://api.dwolla.com/customers

Request

cURL

curl --request POST \
  --url https://api.dwolla.com/customers \
  --header 'Accept: <accept>' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/vnd.dwolla.v1.hal+json' \
  --data '\n{\n  "firstName": "Account",\n  "lastName": "Admin",\n  "email": "accountAdmin@email.com",\n  "type": "<string>",\n  "ipAddress": "143.156.7.8",\n  "phone": "5555555555",\n  "correlationId": "fc451a7a-ae30-4404-aB95-e3553fcd733",\n  "businessName": "Jane Corp llc"\n}\n'```

#### JavaScript (Fetch)

const options = { method: 'POST', headers: { Accept: '', Authorization: 'Bearer ', 'Content-Type': 'application/vnd.dwolla.v1.hal+json' }, body: JSON.stringify({ firstName: 'Account', lastName: 'Admin', email: 'accountAdmin@email.com', type: '', ipAddress: '143.156.7.8', phone: '5555555555', correlationId: 'fc451a7a-ae30-4404-aB95-e3553fcd733', businessName: 'Jane Corp llc' }) };

fetch('https://api.dwolla.com/customers', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err));


#### Python (Requests)

import requests

url = "https://api.dwolla.com/customers"

payload = { "firstName": "Account", "lastName": "Admin", "email": "accountAdmin@email.com", "type": "", "ipAddress": "143.156.7.8", "phone": "5555555555", "correlationId": "fc451a7a-ae30-4404-aB95-e3553fcd733", "businessName": "Jane Corp llc" } headers = { "Accept": "", "Authorization": "Bearer ", "Content-Type": "application/vnd.dwolla.v1.hal+json" }

response = requests.post(url, json=payload, headers=headers)

print(response.text)


#### PHP (cURL)
"https://api.dwolla.com/customers",\ CURLOPT_RETURNTRANSFER => true,\ CURLOPT_ENCODING => "",\ CURLOPT_MAXREDIRS => 10,\ CURLOPT_TIMEOUT => 30,\ CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,\ CURLOPT_CUSTOMREQUEST => "POST",\ CURLOPT_POSTFIELDS => json_encode([\ 'firstName' => 'Account',\ 'lastName' => 'Admin',\ 'email' => 'accountAdmin@email.com',\ 'type' => '',\ 'ipAddress' => '143.156.7.8',\ 'phone' => '5555555555',\ 'correlationId' => 'fc451a7a-ae30-4404-aB95-e3553fcd733',\ 'businessName' => 'Jane Corp llc'\ ]),\ CURLOPT_HTTPHEADER => [\ "Accept: ",\ "Authorization: Bearer ",\ "Content-Type: application/vnd.dwolla.v1.hal+json"\ ],\ ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:" . $err; } else { echo $response; } ?>

#### Ruby (Net::HTTP)

require 'uri' require 'net/http'

url = URI("https://api.dwolla.com/customers")

http = Net::HTTP.new(url.host, url.port) http.use_ssl = true

request = Net::HTTP::Post.new(url) request["Accept"] = '' request["Authorization"] = 'Bearer ' request["Content-Type"] = 'application/vnd.dwolla.v1.hal+json' request.body = "{\n "firstName": "Account",\n "lastName": "Admin",\n "email": "accountAdmin@email.com",\n "type": "",\n "ipAddress": "143.156.7.8",\n "phone": "5555555555",\n "correlationId": "fc451a7a-ae30-4404-aB95-e3553fcd733",\n "businessName": "Jane Corp llc"\n}"

response = http.request(request) puts response.read_body


### Error Responses
#### 400 Bad Request

{ "code": "BadRequest", "message": "The request body contains bad syntax or is incomplete." }

#### 403 Forbidden

{ "code": "forbidden", "message": "Not authorized to create customers." }

#### 404 Not Found

{ "code": "notFound", "message": "not found." }


### Authorization
- **Authorization**: `string` (header, required)
  - Description: The access token received from the authorization server in the OAuth 2.0 flow.

### Headers
- **Accept**: `enum<string>` (default: application/vnd.dwolla.v1.hal+json, required)
  - Description: The media type of the response. Must be application/vnd.dwolla.v1.hal+json

### Request Body Parameters
- **firstName**: `string` (required)
  - Example: "Account"
- **lastName**: `string` (required)
  - Example: "Admin"
- **email**: `string` (required)
  - Example: "accountAdmin@email.com"
- **type**: `string` (required)
  - Allowed value: "receive-only"
- **ipAddress**: `string`
  - Example: "143.156.7.8"
- **phone**: `string`
  - Example: "5555555555"
- **correlationId**: `string`
  - Example: "fc451a7a-ae30-4404-aB95-e3553fcd733"
- **businessName**: `string`
  - Example: "Jane Corp llc"

### Additional Customer Creation Options
- CreateReceiveOnlyUser
- CreateUnverifiedCustomer
- CreateVerifiedPersonalCustomer
- CreateVerifiedSolePropCustomer
- CreateVerifiedBusinessCustomerWithController
- CreateVerifiedBusinessCustomerWithInternationalController