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

Authorizations

Authorization

Headers

Path Parameters

Body