Labels
Create a label reallocation
Reallocates funds between two labels belonging to the same Verified Customer. Moves the specified amount from the source label to the destination label, creating ledger entries for both. The reallocation only succeeds if the source label has sufficient funds.
POST
/
label-reallocations
cURL
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"
}
}
// 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'
# 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
// 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"
?>
# 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"
{
"code": "BadRequest",
"message": "The request body contains bad syntax or is incomplete."
}{
"code": "Forbidden",
"message": "Not authorized to create label reallocation"
}{
"code": "NotFound",
"message": "Label not found"
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Headers
The media type of the response. Must be application/vnd.dwolla.v1.hal+json
Available options:
application/vnd.dwolla.v1.hal+json Body
application/json
Parameters to create a label reallocation
Response
created
Was this page helpful?
⌘I
cURL
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"
}
}
// 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'
# 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
// 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"
?>
# 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"
{
"code": "BadRequest",
"message": "The request body contains bad syntax or is incomplete."
}{
"code": "Forbidden",
"message": "Not authorized to create label reallocation"
}{
"code": "NotFound",
"message": "Label not found"
}