Create a label reallocation - Dwolla Developer Portal
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
API Endpoint
POST
https://api-sandbox.dwolla.com/label-reallocations
cURL Example
POST https://api-sandbox.dwolla.com/label-reallocations
Content-Type: application/vnd.dwolla.v1.hal+json
Accept: application/vnd.dwolla.v1.hal+json
Authorization: Bearer pBA9fVDBEyYZCEsLf/wKehyh1RTpzjUj5KzIRfDi0wKTii7DqY
{
"_links":{
"from": {
"href": "https://api-sandbox.dwolla.com/labels/c91c501c-f49b-48be-a93b-12b45e152d45"
},
"to": {
"href": "https://api-sandbox.dwolla.com/labels/7e042ffe-e25e-40d2-b86e-748b98845ecc"
}
},
"amount": {
"value": "15.00",
"currency": "USD"
}
}
Node.js Example
// Using dwolla-v2 - https://github.com/Dwolla/dwolla-v2-node
var requestBody = {
_links: {
from: {
href: "https://api-sandbox.dwolla.com/labels/c91c501c-f49b-48be-a93b-12b45e152d45"
},
to: {
href: "https://api-sandbox.dwolla.com/labels/7e042ffe-e25e-40d2-b86e-748b98845ecc"
}
},
amount: {
currency: "USD",
value: "1.00"
}
};
dwolla
.post("label-reallocations", requestBody)
.then((res) => res.headers.get("location")); // => 'https://api-sandbox.dwolla.com/label-reallocations/fd36b78c-42f3-4e21-8efb-09196fccbd21'
Python Example
# Using dwollav2 - https://github.com/Dwolla/dwolla-v2-python
request_body = {
'_links': {
'from': {
'href': 'https://api-sandbox.dwolla.com/labels/c91c501c-f49b-48be-a93b-12b45e152d45'
},
'to': {
'href': 'https://api-sandbox.dwolla.com/labels/7e042ffe-e25e-40d2-b86e-748b98845ecc'
}
},
'amount': {
'currency': 'USD',
'value': '15.00'
}
}
labelReallocation = app_token.post('label-reallocations', request_body)
labelReallocation.headers['location'] # => 'https://api-sandbox.dwolla.com/label-reallocations/fd36b78c-42f3-4e21-8efb-09196fccbd21'
PHP Example
<?php
// Using dwollaswagger - https://github.com/Dwolla/dwolla-swagger-php
$labelReallocationsApi = new DwollaSwagger\LabelreallocationsApi($apiClient);
$labelReallocation = $labelReallocationsApi->reallocateLabel([
'_links' => [
'from' => [
'href' => 'https://api-sandbox.dwolla.com/labels/c91c501c-f49b-48be-a93b-12b45e152d45',
],
'to' => [
'href' => 'https://api-sandbox.dwolla.com/labels/7e042ffe-e25e-40d2-b86e-748b98845ecc'
]
],
'amount' => [
'currency' => 'USD',
'value' => '15.00'
]
]);
$labelReallocation; // => "https://api-sandbox.dwolla.com/label-reallocations/fd36b78c-42f3-4e21-8efb-09196fccbd21"
?>
Ruby Example
# Using dwolla_v2 - https://github.com/Dwolla/dwolla-v2-ruby
request_body = {
:_links => {
:from => {
:href => "https://api-sandbox.dwolla.com/labels/c91c501c-f49b-48be-a93b-12b45e152d45"
},
:to => {
:href => "https://api-sandbox.dwolla.com/labels/7e042ffe-e25e-40d2-b86e-748b98845ecc"
}
},
:amount => {
:currency => "USD",
:value => "15.00"
}
}
labelReallocation = app_token.post "label-reallocations", request_body
labelReallocation.response_headers[:location] // => "https://api-sandbox.dwolla.com/label-reallocations/fd36b78c-42f3-4e21-8efb-09196fccbd21"
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 label reallocation"
}
404 Not Found
{
"code": "NotFound",
"message": "Label not found"
}
Authorizations
Authorization
- Type: string in header
- Required: Yes
- Description: The access token received from the authorization server in the OAuth 2.0 flow.
Request Headers
- Accept: media type typically
application/vnd.dwolla.v1.hal+json
Request Body
- _links: object, required
- amount: object, required
Response
- 201 Created: Indicates that the label reallocation was successful.