Create a label for a customer - Dwolla Developer Portal
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Create a Label for a Customer
POST
https://api-sandbox.dwolla.com/customers/{id}/labels
Example cURL Request
POST https://api-sandbox.dwolla.com/customers/AB443D36-3757-44C1-A1B4-29727FB3111C/labels
Content-Type: application/vnd.dwolla.v1.hal+json
Accept: application/vnd.dwolla.v1.hal+json
Authorization: Bearer pBA9fVDBEyYZCEsLf/wKehyh1RTpzjUj5KzIRfDi0wKTii7DqY
{
"amount": {
"currency": "USD",
"value": "10.00"
}
}
Node.js Example
// Using dwolla-v2 - https://github.com/Dwolla/dwolla-v2-node
var customerUrl =
"https://api-sandbox.dwolla.com/customers/AB443D36-3757-44C1-A1B4-29727FB3111C";
var requestBody = {
amount: {
currency: "USD",
value: "10.00",
},
};
dwolla
.post(`${customerUrl}/labels`, requestBody)
.then((res) => res.headers.get("location")); // => 'https://api-sandbox.dwolla.com/labels/375c6781-2a17-476c-84f7-db7d2f6ffb31'
Python Example
# Using dwollav2 - https://github.com/Dwolla/dwolla-v2-python
customer_url = 'https://api-sandbox.dwolla.com/customers/AB443D36-3757-44C1-A1B4-29727FB3111C'
request_body = {
'amount': {
'currency': 'USD',
'value': '10.00'
}
}
label = app_token.post('%s/labels' % customer_url, request_body)
label.headers['location'] # => 'https://api-sandbox.dwolla.com/labels/375c6781-2a17-476c-84f7-db7d2f6ffb31'
PHP Example
<?php
// Using dwollaswagger - https://github.com/Dwolla/dwolla-swagger-php
$customersApi = new DwollaSwagger\CustomersApi($apiClient);
$label = $customersApi->createLabel([\
'amount' => [\
'currency' => 'USD',\
'value' => '10.00'\
]\
], "https://api-sandbox.dwolla.com/customers/AB443D36-3757-44C1-A1B4-29727FB3111C");
$label; # => "https://api-sandbox.dwolla.com/labels/375c6781-2a17-476c-84f7-db7d2f6ffb31"
?>
Ruby Example
# Using dwolla_v2 - https://github.com/Dwolla/dwolla-v2-ruby
customer_url = 'https://api-sandbox.dwolla.com/customers/AB443D36-3757-44C1-A1B4-29727FB3111C'
request_body = {
:amount => {
:currency => "USD",
:value => "10.00"
}
}
label = app_token.post "#{customer_url}/labels", request_body
label.response_headers[:location] # => "https://api-sandbox.dwolla.com/labels/375c6781-2a17-476c-84f7-db7d2f6ffb31"
Error Codes
400 Bad Request
{ "code": "BadRequest", "message": "The request body contains bad syntax or is incomplete." }403 Forbidden
{ "code": "Forbidden", "message": "Not authorized to create customer label" }404 Not Found
{ "code": "NotFound", "message": "Customer not found" }
Authorizations
Authorization
- Type: string
- Location: header
- Required: Yes
- Description: The access token received from the authorization server in the OAuth 2.0 flow.
Headers
- Accept
- Type: enum
- Default: application/vnd.dwolla.v1.hal+json
- Required: Yes
- Description: The media type of the response. Must be application/vnd.dwolla.v1.hal+json
- Type: enum
Path Parameters
- id
- Type: string
- Required: Yes
- Description: ID of customer to create a label for
Body
- amount
- Type: object
- Required: Yes
- Description: Parameters to create a customer label